Skip to content

Instantly share code, notes, and snippets.

@ctkjose
Last active February 9, 2023 05:26
Show Gist options
  • Save ctkjose/86d0c8a5de64e8cce19f67d0e88f4700 to your computer and use it in GitHub Desktop.
Save ctkjose/86d0c8a5de64e8cce19f67d0e88f4700 to your computer and use it in GitHub Desktop.
Guide Ubuntu

Users

Create a group:

sudo groupadd mygroup

Add user to group:

usermod -a -G mygroup user

Networking

Command Description
ls /sys/class/net/ List network interfaces
ip link show List network interfaces
ip address show Show ip address
hostname -I Show IP associated with hostname.
ip -c -br addr Lists all interfaces and their IP addresses.
ip a s dev enp0s1 Show IP of a given device. In this example the divice is enp0s1.
hostname Show machine hostname.
ip link set <device> down
ip link set <device> up
Turn device on or off.

Copy SSH key to VM Server

cat ~/.ssh/id_rsa.pub | ssh ctk@192.168.64.2 "cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment