um meine Own Cloud Daten zu sichern, würde ich mich gerne ohne Passwort auf meinem Server per SSH einloggen. Anschließend könnte ich die Daten dann automatisiert per rsync auf einen anderen Rechner sichern.
Mit Passwort klappt das alles wunderbar, mit Publik Key leider nicht. Irgend etwas mache ich falsch, ich weiß nur leider nicht was.
Inhalt der /etc/ssh/sshd_config:
Code: Alles auswählen
grep -v "#" /etc/ssh/sshd_config | grep -v '^$'
Code: Alles auswählen
PermitRootLogin yes
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
Code: Alles auswählen
Oct 7 18:01:02 Stretchvirt sshd[439]: Server listening on :: port 22.
Oct 7 18:01:21 Stretchvirt sshd[440]: Accepted password for root from 192.168.122.1 port 52558 ssh2
Oct 7 18:01:21 Stretchvirt sshd[440]: pam_unix(sshd:session): session opened for user root by (uid=0)
Oct 7 18:01:21 Stretchvirt systemd-logind[343]: New session 3 of user root.
Code: Alles auswählen
drw------- 2 root root 4,0K Okt 7 18:41 .ssh
-rw------- 1 root root 1,7K Okt 5 21:49 mcdarulinzugang
-rw------- 1 root root 391 Okt 5 21:49 mcdarulinzugang.pub
Jetzt kopiere ich den Schlüssel vom Client auf den Server
Code: Alles auswählen
root@x230:~/.ssh# ssh-copy-id -i /root/.ssh/mcdarulinzugang.pub root@192.168.122.107
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'root@192.168.122.107'"
and check to make sure that only the key(s) you wanted were added.
Code: Alles auswählen
root@Stretchvirt:~# grep -v "#" /etc/ssh/sshd_config | grep -v '^$'
PermitRootLogin prohibit-password
PubkeyAuthentication yes
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
Code: Alles auswählen
root@x230:~/.ssh# ssh -v root@192.168.122.107
OpenSSH_7.4p1 Debian-10+deb9u1, OpenSSL 1.0.2l 25 May 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.122.107 [192.168.122.107] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Debian-10+deb9u1
debug1: match: OpenSSH_7.4p1 Debian-10+deb9u1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.122.107:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:KP9D1CCJgQvPR8+2ljjytQcBtRLf39wEdUnVW5/y1M0
debug1: Host '192.168.122.107' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:3
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: Next authentication method: password
root@192.168.122.107's password:
Vielen Dank schon mal
Flori