What is ~/.ssh?


#1

I’m working through this: http://wiki.dreamhost.com/SSH#Windows — specifically using PuTTY.

I’m familiar with the software, but setting up a SSH 2-RSA key is new to me. I’ve generated the public/private keys, but it says this next:

[quote]Upload the public key to your Dreamhost home directory. After you’ve generated the key and copied it to the server, you’ll need to import and append the key to authorized_keys with the following command. Use >> instead of > to append to the file instead of overwriting the contents. (If the directory ~/.ssh does not already exist use an FTP program, such as FileZilla, to create it. Make sure to enable FileZilla to show hidden files (Server > Force showing hidden files)).

ssh-keygen -i -f key.pub >> ~/.ssh/authorized_keys chmod go-rwx ~/.ssh ~/.ssh/authorized_keys rm key.pub[/quote]

First, I assume that by “home directory” it means root? Second, it refers to ~/.ssh as a directory. Is that to say “.ssh”, or “~/.ssh” is a directory? Or am I completely misunderstanding this?

It then says to “import and append the key to authorized_keys with the following command.” What? Where’s this authorized_keys file? Is this a custom FTP command I send? If I send the first line I get “500 SSH-KEYGEN not understood”.

I feel like I’m really just missing something here. Can someone please explain?

Thanks!


#2

I think that by “home directory” they mean not the root directory, but the directory which you first arrive at when you log in, which is /home/username

However, clarity of thinking in unix directory-naming conventions is nothing to write home about.

Did you know that the root directory contains a directory called ‘root’ (which is not a root directory, but is the home directory of the user called ‘root’)?

And did you know that the root directory also contains a directory called ‘home’ (which is not a home directory, but is a directory containing home directories)?

So anyway, I think that what you want to do is create a directory named ‘.ssh’ in your home directory, which is /home/username and which, as a special convenience, is also designated by the character ‘~’

(which, incidentally, is called a ‘tilde’ by some authorities but is called a ‘swung dash’ by others)


#3

The ~ means “home directory”, the home directory of the user, the full path would be /home/username

Thus ~/.ssh is short for /home/username/.ssh

Using FTP you should normally land in /home/username, you can then create .ssh as a subdirectory.

ssh-keygen is not an FTP command, but a command line instruction. Those instruction you need to run in a shell as username@mysite.com (basically using PuTTY in your case to connect to your user at DH).