Ubuntu 24.04 Setup

·

1 min read

ssh root@<ip>
adduser <name>
usermod -aG sudo <name>

# firewall
ufw app list
ufw allow OpenSSH
ufw enable
ufw status

# setup ssh
rsync --archive --chown=<user>:<user> ~/.ssh /home/<user>
vi /etc/ssh/sshd_config # see below
service sshd restart

# use oh-my-zsh
su <user>
sudo apt install zsh git
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
vi .zshrc # see below
source ~/.zshrc

/etc/ssh/sshd_config:

PasswordAuthentication no
PermitRootLogin no
AllowUsers <user>

~/.zshrc (for <user>)

See this for the list of built-in plugins available and enable what you like.

plugins=(... zsh-syntax-highlighting colorize)

Reference:

  1. https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu

  2. https://www.digitalocean.com/community/tutorials/ssh-essentials-working-with-ssh-servers-clients-and-keys