Learn about Centmin Mod LEMP Stack today
Register Now

PubkeyAuthentication yes but it doesn't connect using the key file and asks for password

Discussion in 'System Administration' started by pamamolf, Mar 6, 2016.

  1. pamamolf

    pamamolf Well-Known Member

    3,108
    294
    83
    May 31, 2014
    Ratings:
    +529
    Local Time:
    6:32 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Hi

    I try to use rsync by connecting from server 2 (backup) to server 1 (main) and get the backup files and i create the correct key and add it on the second server and i close the firewall on both and then i try to run my script.sh that is using a key file that i was create and is asking for a password and is not using the key file :(

    I enable the:
    Code:
    PubkeyAuthentication yes
    on server two in sshd config file and restart sshd but nothing :(

    I was try also to disable the:
    Code:
    PermitRootLogin yes
    so i can force it to use the key but nothing :(

    Any ideas?

    Maybe is related to an authentication method that the old Centminmod server is using?

    Maybe old server is using RSA and new DSA?

    How can i check it?

    Do we use something newer now as the server 1 is a new Centminmod one?

    Thanks
     
    Last edited: Mar 6, 2016
  2. pamamolf

    pamamolf Well-Known Member

    3,108
    294
    83
    May 31, 2014
    Ratings:
    +529
    Local Time:
    6:32 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Main server has:
    Code:
    [[email protected] .ssh]# ls -l *
    -rw-r--r--. 1 root root 398 Mar  3 22:26 authorized_keys2
    -rw-r--r--  1 root root 395 Mar  3 21:41 known_hosts
    Backup server has:
    Code:
    [[email protected] .ssh]# ls -l *
    -rw-r--r--. 1 root root   0 Mar  3 13:28 authorized_keys2
    -rw-r--r--  1 root root 403 Mar  3 16:43 known_hosts
     
..