Server Setup
Client Side Setup
Create a SSH key for remote connection
ssh-keygen -t rsa -b 4096 -C "projectname@your.domain.name" -f $HOME/.ssh/projectname/id_rsa
Automate SSH Authentication In Terminal
Run below command to check list of private keys currently loaded into the SSH agent
ssh-add -l
Run below command to add newly created private key to the SSH agent
ssh-add $HOME/.ssh/projectname/id_rsa
Server Side Setup
Add public key to remote for secure SSH connection
This defers depending on the service provider you choose.
Firewall Setup
Free a port from firewall rules
sudo ufw allow 4000/tcp
Block a port using firewall rules
sudo ufw delete allow 4000/tcp
Check the firewall rules status
sudo ufw status
Client Server Interaction
Connect to remote
ssh root@10.11.50.140
ssh username@10.11.50.140
Copying files from client to remote
rsync -rP --delete ./my_directory root@10.11.50.140:/root