Passwordless ssh for different user

Hello Folks,

I lost touch in ssh key gen topics.

I am in need of ssh to a server without password, kindly help me in configuring.

I have two servers,
server1 with user name apha & server1 with user name beta.

I need to ssh to the server2 from server1 with respective users,
Manually i do like this:- apha@server1: ssh beta@server2 which can be login with only providing beta password.

Kindly let me know how to login without password.

PS: I have password for both user accounts

Thanks in Advance!

In server1, as user alpha, create a ssh pair key

ssh-keygen -t rsa -b 4096 -N ''

That creates an id_rsa and id_rsa.pub files in ~/.ssh

Copy the content of id_rsa.pub into /home/alpha/.ssh/authorized_keys in server2

That's it for alpha.
Repeat the process as beta user.

1 Like

Hello Thala,

There are plenty of links available on google, following 2 of them may help you understanding this procedure.
SSH Passwordless Login Using SSH Keygen in 5 Easy Steps
SSH login without password

Thanks,
R. Singh

1 Like

ok it works now!

thanks Aia, - you only forgot to mention permission attributes required for ssh & .ssh/authorized_keys.

But Ravinder link made it work!

1 Like