Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSH login without password on Solaris.

Status
Not open for further replies.

Yarka

Technical User
Jan 14, 2007
192
ES
I have a Solaris 5.8 and I want to do an user ssh login without password to this machine. I have configured it, but it doesn't work:

ssh -v userA@mymachineA
....

debug1: authentications that can continue: publickey,password
debug1: next auth method to try is publickey
debug1: try pubkey: /home/myuser/.ssh/id_rsa
debug1: authentications that can continue: publickey,password
debug1: try pubkey: /home/myuser/.ssh/id_dsa
debug1: authentications that can continue: publickey,password
debug1: next auth method to try is password
userA@mymachineA's password:

My configuration is:

mymachineA[root]/export/home/userA/.ssh>ls -altr
total 10
drwxr-xr-x 3 userA other 512 Mar 4 16:00 ..
-rw------- 1 root other 606 Mar 4 16:
drwxr-xr-x 2 userA other 512 Mar 13 15:00 .
-rw-r--r-- 1 userA other 606 Mar 13 15:01 authorized_keys

mymachineA[root]/export/home/userA>ls -altr |grep .ssh
drwxr-xr-x 2 userA other 512 Mar 13 15:00 .ssh


mymachineA[root]/export/home>ls -altr |grep userA
drwxr-xr-x 3 userA other 512 Mar 4 16:06 userA

and where authorired_keys is used ssh-dss


Moreover, the userA user has a password.

Could anybody help me?

Thanks.
 
Ok, if you want to log onto machineA, and then [tt]ssh[/tt] to machineB without using a password, do the following...

1) Log onto machineA.

2) Type: [tt]cd .ssh[/tt]

3) Type: [tt]ssh-keygen -t rsa[/tt]

Hit return for all prompts. Use default file name. Do NOT supply a passphrase. This will create both private (id_rsa) and public (id_rsa.pub) key files.

4) Type: [tt]cat id_rsa.pub | ssh userB@machineB "cat - >> .ssh/authorized_keys"[/tt]

You will be prompted for the password of userB, go ahead and type it.

5) At this point, you are done. You will be able to connect to userB on machineB, FROM userA on machineA without supplying a password.

6) Test: [tt]ssh userB@machineB[/tt]

This should log you onto machineB with no password.

Do the same from machineB to machineA if you want to be able to do it from either direction.


 
sshd is pretty picky about directory permissions on the target side. I believe if others can read authorized_keys, that is going to be a problem. Here is a quick note on the correct perms, I did not write it but there are other tutorials on this:

 
Hi,

But I have done the same with other machines and they work well. I want to connect from a machine1 to machineA, as:

machine1#ssh userA@mymachineA (without password)

and I use ssh-dss for the authorized_keys file.

Thank you!
 
The other machines probaly don't have StrictModes set to yes.

Check your sshd_config file for settings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top