Skip to content

Powered by Grav

User management

User management

How to rule them all

User commands

Create users

Create a sudo user named mountdoom and set their password

BASH
sudo useradd -m -G sudo -s /bin/bash mountdoom
sudo passwd mountdoom

Create a system user named morgul unable to login and without /home directory

BASH
sudo useradd -r -s /usr/sbin/nologin morgul

Delete users

Delete a regular user bombadil, along with their group and home directory

BASH
sudo userdel -r bombadil && sudo groupdel bombadil

SSH key authentification

Connect passwordless from a client to remote.ip.address in a terminal using key pairs as authentification

Creating and storing keys

On the client, create a pair of public/private named keys of high KDF rounds

BASH
ssh-keygen -t ed25519 -a 100 -f ~/.ssh/mordor

Copy this key to the remote device; mountdoom user must already exist on the remote

BASH
ssh-copy-id -i ~/.ssh/mordor.pub mountdoom@remote.ip.address

Connect to the remote

BASH
ssh -i ~/.ssh/mordor mountdoom@remote.ip.address

Creating a connection alias

On the client, open SSH config

BASH
nano ~/.ssh/config

And paste

TEXT
Host mordor
  HostName remote.ip.address
  User mountdoom
  IdentityFile ~/.ssh/mordor

Connect to the remote using

BASH
ssh mordor

© 2026 howto.cogip.be. All rights reserved.