- root login (OR) sudo login
Login using key pair
, then follow the below steps
# Add user with home directory & bash shell
sudo useradd -s /bin/bash -d /home/{home directory} -m {user name}
# Add bash shell
sudo chsh -s /bin/bash {userName}
# Make sudo user
sudo usermod -aG sudo {username}
# Change pass
sudo passwd {userName}
- Open
sudo vi /etc/ssh/sshd_config
and modify the following
** To enable password authentication, uncomment
#PasswordAuthentication yes
** To enable root login, uncomment
#PermitRootLogin yes
** To enable ssh key login, uncomment
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
** Add user name in
AllowUsers thirumal ubuntu
** After modification, restart ssh:
sudo service ssh restart