Log on to Ubuntu using a digital certificate through SSH

Source: Internet
Author: User
First, there are two different paths. you can use OpenSSH on the Ubuntu Server to generate a pair of Public and Private keys, or use Putty on Windows. there is no difference in nature. PublicKey is put on the server, and Private key is put on the client. the following assumption is that Putty is directly used for generation:

First, there are two different paths. you can use OpenSSH on the Ubuntu Server to generate a pair of Public and Private keys, or use Putty on Windows. there is no difference in nature. The Public Key is put on the server, and the Private key is put on the client. the following assumes that Putty is directly used for generation:

Put the Public uploaded server in the user's home directory/home/xxx/. ssh, and then convert the format.

 

Ssh-keygen-I-f keyfile. pub> newkeyfile. pub

Cat newkeyfile. pub> authorized_keys

Cat is used mainly to add it at the end of the file, because authorized_keys can contain multiple Public keys. if it is the first one, you can directly generate authorized_keys using mv.

Chmod 700. ssh

Chmod 600 authorized_keys

If you want to use the key generated by putty on linux or mac, you need to convert putgen to openssh format, and then you can log on with ssh xxx@example.com-I privatekey. ssh

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.