Add a new user to existing Ubuntu Server
Login with sudo-user, then:
-
-
-
sudo adduser <UserName>
- Enter password as stated in command line
-
-
Make user sudo-user
-
-
sudo adduser <UserName> sudo
- To verify type
id <UserName>
. To the left under „user groups“ it should state „sudo
„
-
Source: https://www.cyberciti.biz/faq/how-to-create-a-sudo-user-on-ubuntu-linux-server/
Allow user to login via ssh
-
-
- Open the ssh config file using vim:
vim /etc/ssh/sshd_config
- Scroll to button until you find AllowUsers
- Add username, separate multiple usernames by space:
AllowUsers user1 user2 user3
- Reload ssh:
service sshd restart
- Open the ssh config file using vim:
-
Source: https://kifarunix.com/allow-deny-specific-users-to-login-via-ssh-on-ubuntu-18-04/