Manage rdp connections + ssh tunnels from command line.


Create file .rdprc in home directory:

function server01(){
        sshpass -p 'xxxxxxxxxx' ssh -f -L 3389:server01:3389 sleep 10
        nohup xfreerdp /size:1280x720 /u:user -d:domain /p:'xxxxxxxxx' /v:localhost:3389 +clipboard > /dev/null 2>&1 &

function server02(){t
        sshpass -p 'xxxxxxxxxx' ssh -f -L 3390:server02:3389 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…