SSH customization
Change server hostname
sudo hostnamectl set-hostname your-new-name
sudo nano /etc/hosts
Disable ssh login spam
Rename unnesessary files with @ at filename start at /etc/update-motd.d
cd /etc/update-motd.d && for file in *; do mv "$file" "@$file"; done # Rename all files
mv @00-header 00-header
Colored root bash
Edit /root/.bashrc and replace similar liens to this (append -256 color)
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
Customize ssh login text
Message by SSH /etc/update-motd.d: use neofetch:
apt install neofetch -y
# Alternative
wget http://cz.archive.ubuntu.com/ubuntu/pool/universe/n/neofetch/neofetch_7.1.0-4ubuntu1_all.deb
sudo dpkg -i neofetch_7.1.0-4ubuntu1_all.deb
Add this line to /etc/update-motd.d/00-header
neofetch --config /etc/update-motd.d/config.conf --source /etc/update-motd.d/ascii_art.txt
Config example:
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
info title
info "OS" distro
info "Kernel" kernel
info "Packages" packages
info "Shell" shell
#info "Resolution" resolution
info "DE" de
info "WM" wm
info "WM Theme" wm_theme
info "Theme" theme
info "Icons" icons
info "Terminal" term
info "Terminal Font" term_font
info underline
info "Host" model
info "CPU" cpu
info "GPU" gpu
info underline
info "Uptime" uptime
info "Local IP" local_ip
info "Public IP" public_ip
info "Users" users
info underline
info "Memory" memory
#info "GPU Driver" gpu_driver # Linux/macOS only
info "CPU Usage" cpu_usage
info "Disk" disk
info "Battery" battery
#info "Font" font
#info "Song" song
# [[ "$player" ]] && prin "Music Player" "$player"
#info "Locale" locale # This only works on glibc systems.
#info cols
}
No Comments