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.
Create a new user account for billybob -
useradd billybob
and set the password withpasswd 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.Edit the following areas of /etc/sshd_config;
Set – PasswordAuthentication yes
And add billybob toSet – AllowUsers
making sure you separate the users with a space not a comma.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.