SSH

作者: 曲元洪 | 来源:发表于2019-05-20 15:35 被阅读0次

    SSH means secure shell. Below is its definition from Wikipedia:
    Secure Shell ( SSH ) is a cryptographic network protocol for operating network services securely over an unsecured network. Typical applications include remote command-line login and remote command execution, but any network service can be secured with SSH.

    SSH mechanism

    SSH uses RSA (非对称加密) to transfer information over the network. It provides two levels of authentication.

    1. Based on password. In order to login the server remotely, account and password need to be provided.
    2. Based on secret key. A pair keys (public and private) should be generated. Then place the public key on the remote server. You can login the server directly without inputting the password.

    SSH default port: 22. The port can be specified via -p parameter.

    ssh -p 23 qyh@192.168.0.1
    

    Login via public key

    1. Generate key
    ssh-keygen -t rsa -C "qyh@example.com"
    

    associate the key with your email helps you to identify the key later
    under the directory of /home/current account/.ssh, there are two key files generated, include id_rsa (private key) and id_rsa.pub (public key)

    1. Copy the public key to the remote server
    ssh-id-copy -i .ssh/id_rsa.pub qyh@192.168.0.1
    

    the key file should be copy to ~/.ssh/authorized_keys file on the remote server.

    Finally, you can login the remote server directly, no password is required to input.

    相关文章

      网友评论

          本文标题:SSH

          本文链接:https://www.haomeiwen.com/subject/bfckzqtx.html