-
Notifications
You must be signed in to change notification settings - Fork 0
Setup new user on new server
Allan Roger Reid edited this page Dec 4, 2024
·
5 revisions
sudo visudo
Modify content to:
#### Allow members of group sudo to execute any command
#%sudo ALL=(ALL:ALL) ALL
%sudo ALL=(ALL) NOPASSWD: ALL
sudo -v
sudo userdel eco
sudo useradd -m eco
sudo usermod -a -G sudo eco
sudo mkdir /home/eco/.ssh
sudo vi /home/eco/.ssh/authorized_keys
sudo chown -R eco:eco /home/eco
vi /etc/ssh/sshd_config
UsePAM no
PasswordAuthentication no
vi /etc/ssh/sshd_config
Port 4492
sudo systemctl restart sshd
sudo usermod --shell /bin/bash eco
ssh eco@1.2.3.4 -o ServerAliveInterval=5 -o "ServerAliveCountMax 100000" -p 4492 -o PubkeyAuthentication=no
sudo usermod -p 123 eco
sudo usermod --unlock eco
sudo usermod -p '' eco