Skip to content

Instantly share code, notes, and snippets.

@guinslym
Last active December 12, 2022 01:38
Show Gist options
  • Save guinslym/35ee8ce9e94bb2e74871977b8746d63e to your computer and use it in GitHub Desktop.
Save guinslym/35ee8ce9e94bb2e74871977b8746d63e to your computer and use it in GitHub Desktop.
#create user
useradd -m -s /bin/bash -G sudo john
passwd john
#verify if user exist
cat /etc/passwd | grep john
groups john
#Upload SSH Key from local to remote server
#create ssh-key
cd ~/.ssh
ssh-keygen -f djangoappssh
ssh-copy-id -i djangoappssh john@ip_address
ssh john@172.105.6.68 -i djangoappssh
touch ~/.ssh/config
vim config
#Add content into config
➜ .ssh cat config
Host jo
HostName ip_address
User john
IdentityFile ~/.ssh/djangoappssh
#login to remote server
ssh jo
#change terminal
john@ip_address
#change login info
sudo vim /etc/ssh/sshd_config
#PermitRootLogin no
PublicKeyAuthentification yes
#PasswordAuthentification no
#restart SSH Daemon
sudo systemctl restart sshd
#copy external IP address from to Linode #ETHO (without /24)
#LINODE - DOMAIN AAAA revords
sudo apt update
sudo apt upgrade
sudo apt install nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment