Ssh am Client - Permission denied (publickey) - Warum?

Hallo zusammen!

Ich den xenial -cloop heruntergeladen. Funktioniert alles so weit sehr gut. Nur: Wenn ich mich per ssh dorthin verbinden will, bekomme ich die Fehlermeldung:

Permission denied (publickey).

ssh -v liefert:

> 12:25/130 server01 ~ # ssh -v hp8100-01
> OpenSSH_5.9p1 Debian-5ubuntu1.10, OpenSSL 1.0.1 14 Mar 2012
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: /etc/ssh/ssh_config line 19: Applying options for *
> debug1: Connecting to hp8100-01 [10.16.110.1] port 22.
> debug1: Connection established.
> debug1: permanently_set_uid: 0/0
> debug1: identity file /root/.ssh/id_rsa type 1
> debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
> debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
> debug1: identity file /root/.ssh/id_rsa-cert type -1
> debug1: identity file /root/.ssh/id_dsa type 2
> debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
> debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
> debug1: identity file /root/.ssh/id_dsa-cert type -1
> debug1: identity file /root/.ssh/id_ecdsa type 3
> debug1: Checking blacklist file /usr/share/ssh/blacklist.ECDSA-256
> debug1: Checking blacklist file /etc/ssh/blacklist.ECDSA-256
> debug1: identity file /root/.ssh/id_ecdsa-cert type -1
> debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
> debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 pat OpenSSH*
> debug1: Enabling compatibility mode for protocol 2.0
> debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.10
> debug1: SSH2_MSG_KEXINIT sent
> debug1: SSH2_MSG_KEXINIT received
> debug1: kex: server->client aes128-ctr hmac-sha1 none
> debug1: kex: client->server aes128-ctr hmac-sha1 none
> debug1: sending SSH2_MSG_KEX_ECDH_INIT
> debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
> debug1: Server host key: ECDSA cb:67:f4:7d:e9:7d:fb:e5:3e:96:9f:fe:e3:c8:57:67
> debug1: Host 'hp8100-01' is known and matches the ECDSA host key.
> debug1: Found key in /root/.ssh/known_hosts:1
> debug1: ssh_ecdsa_verify: signature correct
> debug1: SSH2_MSG_NEWKEYS sent
> debug1: expecting SSH2_MSG_NEWKEYS
> debug1: SSH2_MSG_NEWKEYS received
> debug1: SSH2_MSG_SERVICE_REQUEST sent
> debug1: SSH2_MSG_SERVICE_ACCEPT received
> debug1: Authentications that can continue: publickey
> debug1: Next authentication method: publickey
> debug1: Offering RSA public key: /root/.ssh/id_rsa
> debug1: Authentications that can continue: publickey
> debug1: Offering DSA public key: /root/.ssh/id_dsa
> debug1: Authentications that can continue: publickey
> debug1: Offering ECDSA public key: /root/.ssh/id_ecdsa
> debug1: Authentications that can continue: publickey
> debug1: No more authentication methods to try.
> Permission denied (publickey).
> 12:29/255 server01 ~ # 

Ssh zu den „alten“ 14.04 Clients geht problemlos…

Hat wer eine Idee?

Lg,
Alex

Hi Alex,

hast du deinen public key schon im Xenial-Image?

vG

Nein, habe ich da was vergessen? :slight_smile:
Ich dachte das geht automatisch…

Dein public key, z.B. der vom Server in /root/.ssh/id_rsa.pub, muss beim Xenial-Client in der /root/.ssh/authorized_keys stehen. Das kannst du per postsync machen oder direkt im Image einpflegen.

Ich kann dir leider nicht sagen, ob das eigentlich automatisch gehen sollte :slight_smile:

vG

Hallo,

Ich kann dir leider nicht sagen, ob das eigentlich automatisch gehen
sollte :slight_smile:

nein, das geht nicht automatisch.
Man kopiert den .pub key nach
/var/linbo/linuxmuster-client/xenial/common/root/.ssh/ und nennt ihn um
zu authorized_keys
Dann Rechte anpassen: 600
Und vielleicht noch eine paar Zeilen in die postsync Datei:


.ssh verzeichnis

chmod 700 /mnt/root/.ssh/
chmod 600 /mnt/root/.ssh/authorized_keys

LG

Holger

Liebe Leute!
Vielen Dank, jetzt geht es. Nur das authorized_keys file wollte 644 als Rechte haben.
Danke und lg,
Alex

Hallo,

ich grabe diesen alten Thread wieder hoch.
Ich habe leider das gleiche Problem als Raabi.
Fehlermeldung Permission denied (publickey).
Ausgabe von ssh -v wie bei Raabi.

Ubuntu cloop Xenial.
Ich habe alles hier probiert, bin aber nicht zum Erfolg gekommen.
Auch die Anleitung: https://www.linuxmuster.net/wikiarchiv/anwenderwiki:linuxclient:defaultcloop_14.04#ssh_-_zugriff_vom_server_passwortlos_per_zertifikat befolgt.
inkl. Anpassung von /etc/ssh/sshd_config

Folgende Dateien habe ich zur Verfügung:
Server:
/root/.ssh:
authorized_keys id_dsa.pub id_ecdsa.pub id_rsa.pub known_hosts.old
id_dsa id_ecdsa id_rsa known_hosts linbo_hosts

/var/linbo/linuxmuster-client/xenial/common/root/.ssh:
authorized_keys

Client:
/root/.ssh/:
authorized_keys

Wenn ich richtig verstehe ist der Inhalt der /root/.ssh/id_rsa.pub auf dem Server wichtig. Nur wo muss das hin? Auf dem Client (/root/.ssh/authorized_keys) oder auf dem Server (/var/linbo/linuxmuster-client/xenial/common/root/.ssh/authorized_keys)
Ich habe es an beide Stelle kopiert.
Muss ich dann etwas neu starten (ssh), oder Bild neu laden oder…???

Dann die Rechte wo einstellen? Server? Client?

Jean-Francois

9 Beiträge wurden in ein neues Thema verschoben: Linux-Client keine Verbindung vom Server mittles PublicKey-Verfahren