In this article, we will see how to access remote PC/Server via ssh without using password. Password less access can be useful in time saving.
To start with, make sure you have OpenSSH server install on remote PC/Server and OpenSSH client on PC/Device you are going to use.
Steps to be done on Client PC
Pass the ssh-keygen command
$ ssh-keygen -t rsa
While passing above command, you will be ask for passphrase, either you can enter a different password for key generated or you can skip and use blank password by pressing enter key twice.
Above command will save files “.ssh/id_rsa.pub” in current user directory
Copy the content of ~/.ssh/id_rsa.pub over clipboard.
Steps to be done on remote PC/Server
- Make .ssh directory (If not exist) in home directory of user. eg. “/root/.ssh” or “/home/someuser/.ssh”
- Create or append the file “authorized_keys” under “.ssh” directory with content on clipboard(copy content of ~/.ssh/id_rsa.pub on client PC)
- Save the file.
Now login from client pc to remote pc, you won’t be asked password(or in case you given password in ssh-keygen, use that password)
You can create shortcut/launcher on your desktop on LINUX machine as
gnome-terminal --tab -e "ssh someuser@remotehost"