How To SSH without a password

On your Mac laptop:
# move into the .ssh directory, which is where ssh keys are stored.
cd ~/.ssh

# generate a new key pair

# (give a name like "itp_rsa" or whatever you want.  Just hit enter through all other questions)
# for this example, let's pretend we called it itp_rsa.  This will generate two files:
# itp_rsa and
#change permissions on the private key so no one else can see it.
chmod 600 ~/.ssh/itp_rsa

#use the command line sftp to put the keys in your itp account's .ssh directory
sftp [NETID]

# put in your net-id password. Issue the following commands at the > prompt, replacing # [MAC-USER-NAME] with your mac's current user account name:
put /Users/[MAC-USER-NAME]/.ssh/ .ssh/

#That's it! The public rsa key file is now on your ITP server.

In your account on the ITP server:

## ssh into your account
cd ~/.ssh

# "cat" will print out the contents of a text file.
# The ">>" will append that text into another file.  In this case, "authorized_keys"
#If the file doesn't exist, then the file will get created.
cat >> authorized_keys

# that's it!

Now, you can ssh on to the ITP server from your laptop without a pasword!

ssh -i ~/.ssh/itp_rsa [NETID]

So why is this potentially more convenient? Because we can now automate the ssh process. For example, you could add an alias to your .bash_profile or .bashrc file:

alias redial='ssh -i ~/.ssh/itp_rsa [NETID]'

Now you just have to type “redial” to gain access to your remote directory at