Linux – Add User Password as Alias in bashrc File

aliasbashrclinux

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?

Best Answer

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"
Related Question