Aamazon Web Service EC2 Create a new user and connect to host with SSH

Source: Internet
Author: User

This article refers to Http://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/managing-users.htmlhttp://docs.aws.amazon.com/zh_ Cn/awsec2/latest/userguide/ec2-key-pairs.html#retrieving-the-public-key1. Obtaining a public key by key pair (KeyPair) In the local Terminla execution $ssh-keygen-y when prompted for the file where the key is located, specify the path to your. Pem file, for example/PATH_TO_KEY_PAIR/MY-KEY-PAIR.PEM the command will return a public key: such as Ssh-rsa aaaab3nzac1yc2eaaaadaqabaaabaqclksfknkusevgj3eyhce53pcjqp3maahdfcvbs7o6vhz2itxcih+pndsuaw+wnqn/mzphtk/a/ gu8jezoowbkm4yxyb/wb96xbifvesfjuop/d6rjhjoi0ibxrlslnbitntckij7fbtxjmxlvvwjryduilbmtjytwb+qhyxumozce5pjz5/ i8sejtjnv3iaog/cqk+0fzzqaejaahco+cy/5wrubkrhmfjr6hcxkvjdwpkyqs3xqc0+fmuzofz221cbt5imucxxpkx4rwi+ Z7wb3rbbqoqzd8v7yeb7ozlpnwoyn0qfu0xa246ra8qfyicnywi3f05p6klxexample2. Then ssh the remote server with the initial account. If the EC2 instance system is Ubuntu, the local terminal executes: $ssh-i YOURPRIVATEKEY.PEM [email protected] New User$adduser NewUser switch to NewUser and then configure the public key $sudo Su-newuser$mkdir. Ssh$chmod. Ssh$touch Authorized_keys Open Editor Editor. Ssh/authorized_keys add the public key that you obtained in step 1 to the file to save the exit. 3. TestingCan you sign in to AWS at the last exit of Step 2 (which should be two times) with the new account until you exit AWS and return to local. Execution: $ssh-i YOURPRIVATEKEY.PEM [email protected] If successful, the above configuration will take effect.

Aamazon Web Service EC2 Create a new user and connect to host with SSH

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.