Open SSH Server Install on Ubuntu
sudo apt install openssh-server

sudo systemctl status ssh
sudo systemctl start ssh
sudo systemctl stop ssh
sudo systemctl restart ssh

Create the RSA/ed25519 key pair on your local desktop/laptop
ssh-keygen -m PEM -t rsa -b 4096 -C “Dan-RSA-V1”
C:\Users\User.ssh\id_rsa Private File
C:\Users\User.ssh\ Public File
Icacls “User-D-SSH.pem” /Inheritance:r
Icacls “User-D-SSH.pem” /Grant:r win-username:”(R)”

Add Public key to Server
You add the contents of your file to the end of the authorized_keys file.

mkdir -p ~/.ssh
chmod 700 ~/.ssh Secure Folder
ls -a | grep .ssh
ls -d $PWD/* find .ssh
cd ~/.ssh
nano ~/.ssh/authorized_keys
Add the contents of your file to the end of the authorized_keys

Enable Password Authentication and SSH
sudo nano /etc/ssh/sshd_config Add the following to sshd_config ————
PubkeyAuthentication yes
PasswordAuthentication yes

Login with this command
ssh azureuser@

SSH over the HTTPS
ssh -T -p 443

Validate RSA SSH public key file (
ssh-keygen -l -f .ssh/

Copy files to server
To copy file from Local Location to Remote Location (Upload)
scp c:\temp\cacak.jpg ubuntu@hostname:/tmp/beograd.jpg

To copy all folder from Remote Location to Local Location (Download)
scp -r ubuntu@hostname:/tmp c:/temp2

To copy all Folders from Local Location to Remote Location (Upload)
scp -r c:/temp3 ubuntu@hostname:/tmp

Config File

Host hostanme
HostName hostname
Port 22
User user

SSH Tunnel Forward to Secondary Remote host
ssh azureuser@ -Nf -p 22 -L -v
Remote RDP Host =
Remote RDP port 3389
Local Windows workstation IP=
Local Windows workstation Port=4001
RDP Connection=

watch ‘netstat -abn | grep 4001 Run on SSH

SSH Tunnel Forward to port SSH Host (port forward)
ssh azureuser@ -L 4001:
RDP Connection

-N: Only forward ports and do not execute commands.
-f: Put SSH in the background after the connection is established