- [[administration:linux:adm]]
====== SSH ohne Passwort ======
~~TASK:Stephan Linz?~~
===== Schlüsselpaar auf dem Client erzeugen =====
user@client:~> ssh-keygen -t rsa -N ""
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Created directory '/home/user/.ssh'.
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:
ee:74:8c:bb:32:c6:0f:3e:a0:d8:62:73:58:86:61:c1 user@client
===== Auf dem Server das Ablageverzeichnis erzeugen =====
user@client:~> ssh user@server mkdir -p -m 0700 .ssh
user@server's password:
===== Auf dem Server den Ablageort erzeugen =====
user@client:~> ssh user@server touch .ssh/authorized_keys
user@server's password:
user@client:~> ssh user@server chmod 0640 .ssh/authorized_keys
user@server's password:
===== Öffentlichen Schlüssel im Ablageverzeichnis auf dem Server hinterlegen =====
user@client:~> cat .ssh/id_rsa.pub | ssh user@server 'cat >> .ssh/authorized_keys'
user@server's password:
===== Zugangstest jetzt ohne Passwort =====
user@client:~> ssh user@server
user@server:~> _
{{tag>linux ssh}}