New Server Setup¶
This documentation contains various notes on setting up a new Debian server. (At the time of writing, based on Debian 13.)
Set time zone¶
For consistency, all Figure13 servers are set to America/New_York.
sudo timedatectl set-timezone
Create a non-root user¶
These steps create a user besides the root user. In this case, the account will be called f13-warp.
In the Server_Creds vault in 1Password, duplicate the
exampleserver_f13-warpcredential (direct link) to the same vault and update the copy for that specific server. Generate a new secure password.On the server, run:
sudo adduser f13-warpCopy the account password from 1Password to the
adduserprocess.Press Enter to save (blank) defaults for the rest of the user information.
Press Enter to choose Yes (default) when asked if information is correct.
Enable sudo access for a user¶
Assuming that you want to enable sudo access for the f13-warp account you created above:
sudo usermod -aG sudo f13-warp
Set up passwordless sudo¶
Normally, the first time a user invokes a sudo command, they are prompted for their account password. When using Ansible, or a shared account like f13-warp, we want to skip the password prompt.
Create
wheeluser group:sudo groupadd wheelEnable passwordless
sudofor thewheelgroup:Open
sudopolicy:sudo visudoAdd the following lines near the bottom of the file, under the
%sudosection:# Allow members of group wheel to execute sudo commands without password verification %wheel ALL=(ALL) NOPASSWD: ALL
Save and close the
sudopolicy file with Ctrl+X, Y to confirm, and Enter to select the save location.
Add account(s) to the new
wheelgroup. Assuming you’re using the samef13-warpaccount:sudo usermod -aG wheel f13-warp
Add SSH key for a user¶
When logged in as root, you can add an SSH key for a user with the following steps. (These steps assume you’re adding a key for the same f13-warp account we’ve used for the rest of these examples.)
Impersonate the user:
sudo su - f13-warpMake sure the
.sshdirectory exists for that user:mkdir -p ~/.sshOpen the
authorized_keysfile:nano ~/.ssh/authorized_keysPaste the SSH public key in this file, and save and close the file with Ctrl+X, Y to confirm, and Enter to select the save location.
Ensure the
.sshdirectory and files have the proper permissions:chmod -R go= ~/.sshEnsure the
.sshdirectory and files are owned by the specific user (and notrootor your user):chown -R f13-warp:f13-warp ~/.sshStop impersonating the user:
exit