Handy New Server Install Commands

Spread Some Love

Your new server install is up and running, do I get up to login at the keyboard or do I just SSH in from the couch via laptop and live with the fact that being that lazy doesn’t bother me? We all know that mental battle 😀 SSH in it is…

So now for some handy new server commands that I always find I use and sometimes forget (don’t tell anyone).

Can’t quite remember exactly which version of Ubuntu you are running?

stoke@zeus:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

How much Hard Drive storage do I have left?

stoke@zeus:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 389M 1.3M 388M 1% /run
/dev/sda2 183G 6.2G 167G 4% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/loop1 68M 68M 0 100% /snap/lxd/21835
/dev/loop2 44M 44M 0 100% /snap/snapd/14978
/dev/loop0 62M 62M 0 100% /snap/core20/1328
tmpfs 389M 0 389M 0% /run/user/1000

How do I switch to Root account after fresh install?

stoke@zeus:/root$ sudo su

How do I change the password for the root account?
First make sure I am logged in with a user that has sudo priviliges

stoke@zeus:~$ sudo passwd root
New password:
Retype new password:
passwd: password updated successfully
stoke@zeus:~$ su root
su: Authentication failure

In the example shown we have just installed Ubuntu Server