Administrationshölle

SSH ohne Passwort

SSH ohne Passwort Aufgabe
verantwortlich:Stephan Linz
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
user@client:~> ssh user@server mkdir -p -m 0700 .ssh
user@server's password:
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:
user@client:~> cat .ssh/id_rsa.pub | ssh user@server 'cat >> .ssh/authorized_keys'
user@server's password:
user@client:~> ssh user@server
user@server:~> _