SSH ohne Passwort
Aus MattWiki
Schlüssel erstellen
$ ssh-keygen
Ergebnis:
Generating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/user/.ssh/id_rsa. Your public key has been saved in /home/user/.ssh/id_rsa.pub. The key fingerprint is: b2:ad:a0:80:85:ad:6c:16:bd:1c:e7:63:4f:a0:00:15 user@host The key's randomart image is: +--[ RSA 2048]----+ | E. | | . | |. | |.o. | |.ooo o. S | |oo+ * .+ | |++ +.+... | |o. ...+. | | . .. | +-----------------+
Schlüssel zum remote Host kopieren
$ ssh-copy-id user@remotehost.tld
Einloggen ausprobieren
$ ssh user@remotehost.tld
Überprüfen, welche Schlüssel hinterlegt sind, um auszuschließen, dass weitere Schlüssel Zugriff haben:
$ less ~/.ssh/authorized_keys