Re: SSH Key generation question



I wrote:
You don't even need the mkdir/chmod stuff, or most of the arguments to
ssh-keygen.

Todd <todd@xxxxxxxxxxx> wrote:
From: http://wiki.centos.org/HowTos/Network/SecuringSSH
$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/authorized_keys

The above permissions are required if StrictModes
is set to yes in /etc/ssh/sshd_config (the default).

Yes, that's right. And like I said you don't need to do it, as ssh-keygen
does it for you. Look:

$ ls -lad .ssh
ls: cannot access .ssh: No such file or directory
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/chris/.ssh/id_rsa):
Created directory '/home/chris/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/chris/.ssh/id_rsa.
Your public key has been saved in /home/chris/.ssh/id_rsa.pub.
The key fingerprint is:
[...]
$ ls -lad .ssh
drwx------ 2 chris chris 4096 Jun 21 23:14 .ssh
$ ls -lA .ssh
total 32
-rw------- 1 chris chris 1675 Jun 21 23:14 id_rsa
-rw-r--r-- 1 chris chris 400 Jun 21 23:14 id_rsa.pub
$

Chris
.