Tag: ssh

I just did this, and I don’t want to forget how. This explains how to set up a public authentication key and make it executable

First, create your public key. Open the terminal. Navigate to the directory where you want to keep your key. You will have to run your key from this folder once you’re done. In my case, it’s Users/MyName

Now, enter:

1

ssh-keygen-tdsa

It will ask you where to store the key – hit enter for the current directory. You will be prompted for a passphrase. Hit enter if you don’t want to use one, then hit enter again to confirm.

You should see:

1

2

Your identification has been saved in/Users/YourName/.ssh/id_dsa.

Your publickey has been saved in/Users/YourName/.ssh/id_dsa.pub.

Then a string of digits that are the digital representation of your public key, and some neat ASCII art that is a visual representation of same.

Next, upload your key to your server with scp:

1

scp~/.ssh/id_dsa.pub username@servername.com:.ssh/authorized_keys2

Enter your server password when prompted.

You’re good to go. Now you can connect with ssh like so:

1

ssh username@servername.com

And it won’t bug you for a password. But that’s still kind of a lot of typing. Let’s make this an executable.