Article title: methods and techniques for improving OpenSSH speed in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Although public key verification is a good way to improve secure SSH data transmission. Transferring an SSH identity key is also a pain point. First, you need to create your key pair. Then, you copy the public key to all the correct locations where you want to log on to the machine. The key must be in a special format, and you must go to a specific directory with the correct permissions.
Fortunately, ssh-copy-id, a small tool in OpenSSH, makes it easy.
SSH is a secure remote management tool that provides many shortcuts and capabilities for processing. For example, you can log on and execute a remote command, which requires only one command. Instead of logging on first, enter the following command:
Carla @ host1 :~ $ Ssh terry @ host2 ls ~
This is an interesting example and there is a small xuanjicang-ls ~ Will list the home directory of Carla, rather than Terry's. If you want to view Terry's home directory, you must use ls/home/terry. to do this, you only need to enter one command. For example, start a backup script, view the process, or print a document.
$ Ssh-copy-id-I id_rsa.pub terry @ host2
Ssh-copy-id copies the identity key in the correct format. Make sure that the file permission and owner are correct and that the private key is not accidentally uploaded.
If you use key-based authentication instead of password authentication, you do not need to disclose your system password. To make it easier to manage multiple remote machines, you can use any name you want to create a key, as shown below:
$ Ssh-keygen-t rsa-f id_apacheserver
To connect, you can easily use the correct fixed key:
$ Ssh-I id_apacheserver carla@host.alrac.net
Finally, do not forget the powerful sshfs command to use it to load a remote file system. This is faster than Samba and NFS servers. First create a local directory as the Mount point, and then load the remote file system:
$ Sshfs hostname:/remotedir localdir/
Now you can operate on the remote file system like operating local files.