- #Login with ssh on mac how to#
- #Login with ssh on mac mac os x#
- #Login with ssh on mac mac os#
- #Login with ssh on mac install#
Click on this button to authorize the key. Newly generated keys are not initially authorized for use.
#Login with ssh on mac mac os#
You will now have to re-login, to make the global variables work and have SSHKeychain popup every time you try to SSH to a server that has your public key!Īs a final step, you can finetune Mac OS X’s keychain settings for extra security. Open “System Preferences”, go to “Accounts” and open the “Login Items” tab. In the “SSH Keys” tab, ensure your Key Location is listed (/Users/yourname/.ssh/id_dsa).įor extra convenience, add SSHKeychain to your Login Items.
This is required for ssh to be able to find the application later. In the “Environment” tab, check the “Manage (and modify) global environment variables” tickbox. Next, run SSHKeychain, and go into it’s preferences.
This nifty little tool will act as a gateway to Mac OS X’s keychain.
#Login with ssh on mac install#
The next step is to get this keychain to keep our SSH keys as well.įirst, download and install SSHKeychain.
#Login with ssh on mac mac os x#
While this certainly is a nice improvement, it still isn’t that easy to use.įortunately, Mac OS X already has a great feature for managing your keys: the keychain. Having verified that the previous steps worked, we’ve created a situation where instead of all kinds of different passwords, you have to type in a generic passphrase for every new connection. You should be prompted for your passphrase and it should work :) Integrating into Mac OS X Test it by typing in (on the client):Ĭlient:~ user$ ssh -o PreferredAuthentications=publickey Now we have basic public key authentication working. Next, we SSH to the server, and add our key to the list of authorized mkdir ~/.ssh #if it doesn't chmod 700 cat ~/id_rsa.pub > chmod 600 rm ~/id_rsa.pub Any other UNIX running OpenSSH will do fine.įirst, we copy the key from your Mac to the server using SCP:Ĭlient:~ user$ scp ~/.ssh/id_rsa.pub will put the key in your homedir. In my example, the server is a Linux system. Needless to say, the private key (~/.ssh/id_rsa) should be kept private at all times, and the public key (~/.ssh/id_rsa.pub) is meant for distribution. This will generate a public/private key pair. Generating keys for the client (your Mac)Ĭlient:~ user$ mkdir ~/.ssh # if it doesn't existĬlient:~ user$ ssh-keygen -q -f ~/.ssh/id_rsa -t rsaĮnter passphrase (empty for no passphrase): … Since Mac OS X is just like any other UNIX, this should be basic knowledge.
#Login with ssh on mac how to#
If you already know how to do this, and are just interested in the Mac OS X specific part, skip to the end :) Key generation and exchange What I am going to explain, is how to get it to work seamlessly on Mac OS X.įirst, I’m going to explain how to get the authentication to work in a client/server configuration. If you want to know (and you should), just read Dave Aaldering’s SSH with Keys HOWTO. I’m not going to explain here what public key authentication is and why you would want to use it for increased security. For those of you who are as lazy as I am, and don’t want to type in and remember all kinds of different passwords for different hosts, it is the solution. One of OpenSSH’s great features is ssh public key authentication. 28 May, 2006 SSH public key authentication on Mac OS X