I have created alias for username and it works fine
alias yb="ssh name@hostname"
It works fine, but I also want to create alias for password, Can anyone help how can I do this?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityI have created alias for username and it works fine
alias yb="ssh name@hostname"
It works fine, but I also want to create alias for password, Can anyone help how can I do this?
Before we start, it's not a good thing to do... you should use ssh keys instead!
You can use sshpass
, it's a non-interactive ssh password authentication.
Install it using your package manager, for example in Debian based distributions:
sudo apt install sshpass
then in your bashrc:
alias yb="sshpass -p password_in_plain_text ssh name@hostname"
cat /home/b/.bashrc
to see what B got there.
– Ravexina
Jul 2 '19 at 7:47