1. Login to a root account using root credentials
ssh root@myserver.com
2. Create a new user admin
adduser admin
3. Add the user to sudoers
usermod -aG sudo admin
Make sure the user got the privileges:
sudo -l -U admin
4. Allow ssh access, copying the public key to authorized keys
Login to admin:
su - admin
Then run
ssh-keygen
to create ~/.ssh
folder with the correct permissions. Then
echo $public_key > ~/.ssh/authorized_keys
and set the permissions for the file:
chmod 600 ~/.ssh/authorized_keys .
Now you should be able to login into admin account without password:
ssh admin@yourserver.com
5. Disable root access
Disable root access to the system through sshd:
sudo vim /etc/ssh/sshd_config
and set:
PermitRootLogin no
PasswordAuthentication no
PermitEmptyPassword no
UsePAM no
Also, disable password auth defined in /etc/ssh/sshd_config.d/50-cloud-init.conf
.
6. Use the server as a proxy
ssh -D 7777 -f -N admin@yoursever.com
Now you can setup firefox proxy settings: manual, socks5 and port 7777. No need for password.
END