Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Operate Remote Servers Using SSH

General Tips and Traps

  1. The permissions of the directory ~/.ssh and its subcontents on both the local machine and the remote server must be properly set in order for SSH login via public key to work. A good pratice is to set the permission of ~/.ssh to 700 (on both …

Copy SSH Public Key Using "ssh-copy-id"

You can use the following command to copy your SSH public key to a Linux server.

ssh-copy-id -i ~/.ssh/id_rsa.pub host_machine

However, if a Linux server runs the SSH deamon on a non default port (default is 22), you have to specify the port with option -p port. In …