Connection & user
How to connect to server and create a new user
To install a new server, you have to choose a provider. I use Hetzner VPS with Debian 12. Of course you can use any other provider and any other OS.
INFO
When I offer to create new user, I call it jack, you can use any other username.
Connect to server
If it's setup of server, you have to disable ssh with root and allow it with a custom user.
ssh root@xxx.xx.xx.xxxGet IP address from server
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'Add sudo (Debian)
If sudo is not installed, you have to install it. To execute this, you have to be connected with root.
su - rootapt install -y sudoAfter that, you can add new user and add it to sudo group.
adduser jack
usermod -aG sudo jackNow you can exit SSH session and connect with new user.
INFO
You have to kill current session with exit command to reload groups.
exitYou can now connect with new user and use sudo command.
sudo timeout
You can set sudo timeout to 10 minutes, so you don't have to type password every time you use sudo command. And it's more secure than 15 minutes, which is default.
sudo visudoDefaults timestamp_timeout=10Add new user
Add new user (you can use any other name)
sudo adduser jack
sudo usermod -aG sudo jackExit SSH connection to reload groups
exitFix locales
Fix locales for new user
sudo vim /etc/default/localeLC_CTYPE="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LANG="en_US.UTF-8"Generate locales
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
dpkg-reconfigure localesCopy SSH keys from root
Copy SSH keys from root to new user
sudo mkdir /home/jack/.ssh/
sudo cp /root/.ssh/authorized_keys /home/jack/.ssh/
sudo chown -R jack:jack /home/jack/.ssh/
sudo chmod -R 700 /home/jack/.ssh/Exit SSH connection
exitConnect with new user
Connect to server with new user
ssh jack@xxx.xx.xx.xxxThan now you can reboot server
sudo rebootChange root password
sudo -ipasswdexitGRUB
Change GRUB timeout
sudo nano /etc/default/grubSetting it to 0 means GRUB will boot immediately without showing the menu unless you press a key.
-GRUB_TIMEOUT=5
+GRUB_TIMEOUT=0If you want the menu hidden by default but accessible if you hold Shift or Esc during boot, you can set it to hidden:
-GRUB_TIMEOUT=5
+GRUB_TIMEOUT=hiddenUpdate GRUB configuration after making changes:
sudo update-grubAnd reboot the server to apply the changes:
sudo reboot now