Tux-passwortloser login
Linux_notes_-_passwortloser_login
Wolfs-Mac-mini:~ wolfpeterbuchholz$ mkdir -p ~/.ssh
root@h2405883:~# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
78:f2:0d:9b:87:b8:78:40:d3:92:ec:06:5a:c7:0e:3f root@h2405883.stratoserver.net
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| o o |
| + O .. |
| o O oo S |
|. E = * |
| . o. = o |
| ... . |
| ... |
+-----------------+
root@h2405883:~# cat ~/.ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
I_UfE_Ssh_without_password
How to configure ssh to use it without a passwort
We will show this on an example: we want to get a ssh connection between the Client user ufe on steffis laptop to the user steffi on the ufe Server in Luebeck.
Produce a pair of keys
In order to produce the pair of keys on the Client side, you go into the directory ~/.ssh. if this does not exist, create it with the rights drwx------. than you create a private and a public key with the command
ssh-keygen -t rsa -b 2048
it says:
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ufe/.ssh/id_rsa):
you type ENTER
Enter passphrase (empty for no passphrase):
you type ENTER (this can be dangerous, but axel wants it so...)
Your public key has been saved in /home/ufe/.ssh/id_rsa.pub.
The key fingerprint is:
ab:a2:21:41:ea:f7:76:66:fc:fa:84:cc:23:ac:f4:40 ufe@stef
After the generation of the keys two files are produced: one with the public (id_rsa.pub) and one with the private (id_rsa) key.
Export the public key
The public key (id_rsa.pub) must be copied on the server into the file ~/.ssh/authorized_keys. maybe you have to produce the folder .ssh first.
cat id_rsa.pub | ssh steffi@l.ufegmbh.de 'cat >>~/.ssh/authorized_keys'
Connection
ssh steffi@l.ufegmbh.de
(if this does not work without a passwort helps the option -v)
First this does not work by me. The solution was that the .ssh folder on the server has to have the rights drwx------.
--ag 18:33, 25 October 2008 (UTC) Passwort wird verlangt.
Meistens ein Problem der Permissions auf der eigenen und/oder der anderen Seite: Das Verzeichnis .ssh/ und die die Datei .ssh/authorized_keys darf nur für den Eigentümer, der auch der "angepeilte" Nutzer sein muß, schreibbar sein. Auch das Home-Verzeichnis des angepeilten Nutzers darf ausschließlich für den Eigenümer beschreibbar sein.\n\n