SSH into your server and run the following commands: chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys chown username. Now we want to ensure that all is well on the recipient server. After the password is entered the file will be synced up to the server. Here is an example for port 2222, the default port for HostGator shared servers: ssh-copy-id -p 2222 -i ~/id_rsa.pub running this command you will be prompted for your root password. Be sure to replace username with the username intended to access the server and the IP address with the address of your server: ssh-copy-id -i ~/id_rsa.pub the event your server uses a non-standard port for ssh, you can specify this inside the quotes around ssh. Now we just need to get that file up to the server.īelow is an example of a properly formatted command that does so. Once this has been completed it will generate a key in the ~/.ssh/ directory. Do not enter a password when asked please simply press return. This will ask you a few questions, the defaults for which are just fine. In terminal, type the following command: ssh-keygen SSH keys are fairly simple to setup, especially when using the native terminal applications available in either Linux or Mac OSX.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |