Unix/Linux Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Passwordless ssh for different user

UNIX for Advanced & Expert Users


Tags
solved, ssh

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 05-18-2017
Thala Thala is offline
Registered User
 
Join Date: Dec 2013
Last Activity: 9 June 2017, 5:07 PM EDT
Posts: 46
Thanks: 15
Thanked 1 Time in 1 Post
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!

Last edited by rbatte1; 05-19-2017 at 06:26 AM.. Reason: Added ICODE tags
Sponsored Links
    #2  
Old Unix and Linux 05-18-2017
Aia's Unix or Linux Image
Aia Aia is offline
Registered User
 
Join Date: May 2008
Last Activity: 2 August 2017, 1:08 AM EDT
Posts: 1,633
Thanks: 46
Thanked 623 Times in 584 Posts
In server1, as user alpha, create a ssh pair key

Code:
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.
The Following User Says Thank You to Aia For This Useful Post:
Thala (05-19-2017)
Sponsored Links
    #3  
Old Unix and Linux 05-18-2017
RavinderSingh13 RavinderSingh13 is online now Forum Advisor  
Registered User
 
Join Date: May 2013
Last Activity: 20 August 2017, 1:14 PM EDT
Location: Chennai
Posts: 2,570
Thanks: 567
Thanked 1,213 Times in 1,092 Posts
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
The Following User Says Thank You to RavinderSingh13 For This Useful Post:
Thala (05-19-2017)
    #4  
Old Unix and Linux 05-19-2017
Thala Thala is offline
Registered User
 
Join Date: Dec 2013
Last Activity: 9 June 2017, 5:07 PM EDT
Posts: 46
Thanks: 15
Thanked 1 Time in 1 Post
SOLVED!

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!
The Following User Says Thank You to Thala For This Useful Post:
Corona688 (05-23-2017)
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passwordless sftp using a different user than the runtime user mady135 Shell Programming and Scripting 4 05-25-2016 07:50 AM
Check whether user has passwordless setup ryandegreat25 Shell Programming and Scripting 2 09-03-2012 05:25 AM
passwordless entry using ssh from one user to a different user on the same server deshaipet AIX 3 08-20-2011 09:04 AM
su -m <user> passwordless? jacki Shell Programming and Scripting 4 03-25-2011 03:27 AM
passwordless ssh for non-root user??? rs6000er AIX 9 11-11-2010 03:06 PM



All times are GMT -4. The time now is 01:20 PM.