Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enter token without leaving history in terminal? [closed]

I'm trying to call GitHub API in the terminal. It requires to input the username and token. Token are entered with plain text. For security purposes, I don't feel like leaving some token history on this public computer.

How can I enter the token without leaving history?

like image 375
o_yeah Avatar asked Nov 30 '25 08:11

o_yeah


1 Answers

If $HISTCONTROL is set to ignorespace or ignoreboth (which is the default):

You can type a space before the command to prevent it from being recorded in the history.

See also: https://unix.stackexchange.com/a/115922/198262

If you need to use this command several times, you can first store the token in a variable and prefix the variable assignment with a space and then just use the variable in your commands without having to remember the space. You could also disable the history for the current session entirely using set +o history.

like image 102
CherryDT Avatar answered Dec 01 '25 23:12

CherryDT