LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SSH login without password not working (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-login-without-password-not-working-4175561052/)

Darkyputz 12-09-2015 09:19 AM

SSH login without password not working
 
Hello out there...
This is my first threat here, so if i mess up with some rules, please be gentle...smile
I have to NAS devices...and i have root access to both of them.
And i want to do a rsync between them.
The Rsync command is clear...but i always get prompted for pass phrase...which makes it impossible to automate that via cron job
I already created the rsa key...and tried to get it into the authorized keys on the other NAS, but even after that...still pass phrase...
Tried this here:
"cat /root/.ssh/id_rsa.pub | ssh root@destinationip 'cat >> .ssh/authorized_keys'

And get:
"The authenticity of host 'dest ip (destip)' can't be established.
RSA key fingerprint is 35:60:b9:53:a4:08:fb:1a:be:7a:7d:b5:4f:ee:cc:2c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'destip' (RSA) to the list of known hosts.
root@destip's password:

Can someone give me a hint where the culprit could be?

Thx in advance

suicidaleggroll 12-09-2015 09:30 AM

Improper permissions are usually the cause of this:
Code:

chmod 750 ~
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

On the destination machine

Darkyputz 12-09-2015 09:32 AM

Thx...i will check that in a minute

Darkyputz 12-09-2015 09:41 AM

Hello...
Just tried it...
That is the log of it:

login as: root
root@localip's password:
Last login: Wed Dec 9 09:27:24 2015 from jm-8
Last login: Wed Dec 9 10:34:17 2015 from jm-8 on pts/1
Linux Pro6bak 2.6.37.6.RNx86_64.2.4 #1 SMP Wed Aug 20 11:41:34 PDT 2014 x86_64 GNU/Linux
Pro6bak:~# cat /root/.ssh/id_rsa.pub | ssh root@destip 'cat >> .ssh/authorized_keys
Enter passphrase for key '/root/.ssh/id_rsa':
Pro6bak:~# ssh root@destip
Enter passphrase for key '/root/.ssh/id_rsa':

Welcome to ReadyNASOS 6.2.4

Last login: Tue Dec 8 15:22:17 2015 from 96.80.133.17
root@ReadyNas312:~# chmod 750 ~
root@ReadyNas312:~# chmod 700 ~/.ssh
root@ReadyNas312:~# chmod 600 ~/.ssh/authorized_keys
root@ReadyNas312:~# exit
logout
Connection to destip closed.
Pro6bak:~# ssh root@destip
Enter pass phrase for key '/root/.ssh/id_rsa':

Still pass phrase question...any ideas?

suicidaleggroll 12-09-2015 09:45 AM

Now it's asking for the passphrase, not the password. You need to leave the passphrase prompt blank when you're creating the key.

You'll need to make a new key, this time just keep pressing enter through all of the prompts, then copy it over to the destination again.

Darkyputz 12-09-2015 09:47 AM

Oh...ok...that could make a difference...
Will check that...one sec

Darkyputz 12-09-2015 09:50 AM

You are my hero...
I don't know why i kept putting this pass phrase is...
Without it just works...

Thx so much...

suicidaleggroll 12-09-2015 10:51 AM

Glad you got it sorted! SSH keys aren't too bad to set up and get going once you know the gotchas, the only issue is the complete and utter lack of any error logging, even with verbosity turned up. You have to know what the problem is, because for security reasons SSH is not going to tell you...a little annoying.


All times are GMT -5. The time now is 01:56 AM.