Operating System - HP-UX
1833405 Members
3006 Online
110052 Solutions
New Discussion

Passwordless SSH using differing IDs

 
Tariq Hasan_1
Frequent Advisor

Passwordless SSH using differing IDs

I have a User who wishes to use passwordless ssh from, for example, ID 'idA' on server 'server1' to ID 'idB' on server 'server2', and vice versa. Is this possible? What I am getting is a prompt for a password when I type:

ssh -l idB server2 (from server1 as idA)
and
ssh -l idA server1 (from server2 as idB)

Any ideas?
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: Passwordless SSH using differing IDs

I have not tried this.

I believe this is possible.

It presents serious security concerns.

Look at the $HOME/.ssh/authorized_keys
file.

You will see a user name in the file.

You can append entries onto the file.

Then your issue has to do with ownership of the home directories and the .ssh folders.

You MIGHT be able to get away with creating a group for the two or more users and having that group own the folders and have rw permissions for that group alone.

That is how I'd go about it anyway.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
paolo barila
Valued Contributor

Re: Passwordless SSH using differing IDs

Yes you can,
you have do configure a publickey authentication:


login IDA@SERVER1

SERVER1# ssh-keygen -t rsa -C "ssh_for_`whoami`@`hostname`" -f ~/.ssh/id_rsa
empty for no passphrase



SERVER1# cp -p id_rsa.pub authorized_keys.SERVER1
SERVER1# chmod 600 auth*
SERVER1# scp -p authorized_keys.SERVER1 SERVER2:/$PWD


login IDB@SERVER2

SERVER2# cat authorized_keys authorized_keys.SERVER1 > authorized_keys.new
SERVER2# mv authorized_keys.new authorized_keys
SERVER2# chmod 600 authorized_keys

IDA@SERVER1

SERVER1# ssh IDB@SERVER2
yes

(and viceversa)

Pablo
share share share