Linux new account, and open SSH login

Source: Internet
Author: User

New account requires root account or sudo permissions, sudo configuration saved in/etc/sudoers file.

Create an account using the/usr/sbin/useradd command, it is best to use absolute path, because different creation account command parameter format slightly different.

/usr/sbin/useradd-c koala-d/opt/code/home/koala  9013

-d:home Directory

-G: Main owning Group

-G: Other owning Group

-M: Create home Directory

-u:userid

The last koala on behalf of the user name, after creation and then set a password for the account:

/USR/BIN/PASSWD Koala

Once created, the Koala account information can be found in the/etc/passwd file. However, the new account cannot be accessed by SSH by default, then SSH login is required for external access.

Insert Configuration statement:

Allowusers:koala

If you want all users to have access, direct:

Allowusers *

After these steps, you can login to the Koala account directly via SSH.

SSH [email protected]

However, each login need to enter a password, more cumbersome, a login password-free tips:

Under the created Koala account, enter the ~/.ssh directory (if one is not created),

Create a new Authorized_keys file to write the public key information for the remote account that needs to log in to koala. That is, join is to log in to the Koala account from the test account of another machine (IP assumed to be 192.168.66.60),

The test account under the ~/.ssh directory has two files Id_rsa and id_rsa.pub, respectively, represents the private key and the public key, the contents of the id_rsa.pub copied into the koala account under the ~/.ssh/authorized_keys file.

In this way, every time you log into the Koala account from the test account, you do not need to enter a password.

Linux new account, and open SSH login

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.