![]() ![]() Once again, there may be the odd situation where you can only run the command within the single quotes from the remote system.Īnd, that’s basically all there is to it. This fixes the permissions on the authorized_keys file on the remote system. ![]() If you already have such a file and don’t want it overwritten, then you’ll have to manually add the contents of your local ~/.ssh/id_rsa.pub file to the end of the ~/.ssh/authorized_keys file on the remote system. Then, if you don’t already have an authorized_keys file on the remote system, go back to your local terminal or iTerm window for this: scp ~/.ssh/id_rsa.pub above creates a new list of authorized keys on the remote system (overwriting any existing file with that name) and copies your public key to it. If the command fails (for example, I’ve had it complain that mkdir isn’t a valid command, even though it is on just about every Unix/Linux system), then either you have copied and pasted the above line and WordPress changed the single quotes to the “prettified” versions (so change them back) or you may have to actually log into the remote system (using a password) and enter the two commands individually ( mkdir ~/.ssh followed by chmod 700 ~/.ssh). ssh directory on the remote system and gives it the correct permissions. Note that you should NOT be logged into the remote system when you execute these – these are run from a command prompt on your local system, and you probably will be prompted to enter your password (for the remote system): ssh ‘mkdir ~/.ssh chmod 700 ~/.ssh’ ![]() Whichever method you use, replace username with your login name and remote with the address of the remote system. In the event your system does not have ssh-copy-id installed, you can instead run the following three commands from a terminal or iTerm window on your local system. ![]() Now, from your terminal window on your local system, execute this command: ssh-copy-id can run ssh-copy-id -h or man ssh-copy-id to see the available options, but normally you don’t need any. To check that theory, see How to Disable SELinux, which will show you how to disable it temporarily (for testing) or permanently. If this process fails with a “Permission denied” error, it might be because SELinux is enabled. ssh-keygen -t rsa -f ~/.ssh/id_rsa -C with your email address – this is just to make sure the keys are unique, because by default it will use which might come up with something too generic, like It’s unlikely that anyone else is using your e-mail address in a key. If either the directory or the files do not exist, you will need to create them. ssh”) and see if there are two files called id_rsa and id_rsa.pub (use “ls -a” again). Note that Finder will NOT show you this directory unless you have it set to show all file extensions, so since we are at a command line prompt anyway, it’s easiest to just type “cd ~” (without the quotes) to go to your home directory in Terminal or iTerm and type “ls -a” (again without the quotes – always omit the quotes when we quote a command) to see if the. First, navigate to your home directory, and see if there is a folder called. Here’s how to set up ssh public/private key authentication so you don’t have to use the password on future logins, or so you can use Public Key authentication with MacFusion.įirst, open a terminal or iTerm window as we will be using it for most of the following operations. This article assumes that you are already able to ssh into a remote server using a password (that is, that your account has been created on the remote system and you are able to access it). Comments dated before the year 2013 were originally posted to The Michigan Telephone Blog. This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which in turn was reposted with the permission of the original author from a now-defunct Macintosh-oriented blog. ![]()
0 Comments
Leave a Reply. |