Manage rdp connections + ssh tunnels from command line.
Prerequisites:
Step 1: Copy ssh key to jumphost:
ssh-copy-id jumper@000.000.000.000
Step 3: Add in ~/.ssh/config:
Host jumphost
HostName 000.000.000.000
User jumper
IdentityFile /home/jumper/.ssh/id_rsa
Step 4: Create ~/.rdprc:
function server01(){
ssh -f -L 3389:server01:3389 jumphost sleep 10
nohup xfreerdp /size:1280x720 /u:user -d:domain /p:'xxxxxxxxx' /v:localhost:3389 +clipboard > /dev/null 2>&1 &
}
function server02(){t
ssh -f -L 3390:server02:3389 jumphost sleep 10
nohup xfreerdp /size:1280x720 /u:user -d:domain /p:'xxxxxxxxxx' /v:localhost:3390 +clipboard > /dev/null 2>&1 &
}
Add as many functions as needed. Each time increase local port number. Source .rdprc in .bashrc:
. /home/user/.rdprc
Logoff/on to make ‘ssh-rdp’ fuctions available or source .bashrc (. .bashrc).
To rdp server01 type server01 on the command line and so on…