Use ssh to connect to a non-default user on a CIS Hardened Image


Product Name

CIS Hardened Images® (AWS)

Product Version

All

Date

Oct 14, 2020



 

Problem

How can I create a new user with password authentication to connect to a CIS Ubuntu Hardened Image?

Solution

Note that AWS and CIS recommend that is is best practice to use keys instead of passwords.

 

  1. Create a new user account for billybob - useradd billybob and set the password with passwd billybob Note that the password will need to be 14 characters long with one uppercase, one lower case, one number and one special character. You will be prompted 5 times for that password.

  2. Edit the following areas of /etc/sshd_config;
    Set – PasswordAuthentication yes And add billybob to Set – AllowUsers making sure you separate the users with a space not a comma.

  3. Run the following commands;

  • mkdir /home/billybob

  • chown –R billybob:billybob /home/billybob

  • service ssh restart

Open a new ssh session and logon with the billybob account and password.

Copyright © 2020

Center for Internet Security®