Lab user and ssh - acavataio/ITC-136 GitHub Wiki
First, install SSH on your build:
Open a console windows and become SUDO by entering 'sudo su'
now,
apt-get install vim
apt-get install openssh-server
now create a copy of the sshd_config and modify sshd_config for the new users:
cd /etc/ssh
ls -ltra
cp sshd_config sshd_config.orig
vim sshd_config
The change you will make is to uncomment line 52:
#PasswordAuthentication yes
so that it becomes
PasswordAuthentication yes
Now, save the document and then merge the copy with the original:
pwd
ls -l
diff sshd_config sshd_config.orig
Now, restart the sshd service:
systemctl restart sshd
Second, add users:
Use the adduser command to add a new user to system.
adduser username
Set and confirm the new user's password at the prompt.
A strong password is highly recommended!
Set password prompts:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Follow the prompts to set the new user's information. It is fine to accept the defaults to leave all of this information blank.
Use the usermod command to add the user to the sudo group.
usermod -aG sudo username
By default, on Ubuntu, members of the sudo group have sudo privileges.
Test sudo access on new user account
Use the su command to switch to the new user account.
su - username
As the new user, verify that you can use sudo by prepending "sudo" to the command that you want to run with superuser privileges.
sudo command_to_run
For example, you can list the contents of the /root directory, which is normally only accessible to the root user.
sudo ls -la /root
The first time you use sudo in a session, you will be prompted for the password of the user account. Enter the password to proceed.
Third, check to see the IP of the machine you are currently logged into:
/sbin/ifconfig
Fourth, Connect to the remote machine via SSH:
from the command line
ssh (username)@(ipaddress of remote)
from putty
Fifth, check IP of the machine that you are logged into to verify.
/sbin/ifconfig
For example, here is a screenshot of me connecting to SSH on Joe's computer: