Linux – How to execute Windows commands remotely from Linux machine using rdesktop command

linuxwindows

Is it possible to run Windows commands using rdesktop tool in Linux? I tried with rdesktop -s option:

rdesktop -u user -p 10.0.0.2 -s "cmd.exe"

but I'm not able to open the cmd.exe using the above command, also I tried with the full path:

rdesktop -u user -p'password' 10.0.0.2 -s "C:\WINDOWS\system32\cmd.exe"

but there is no difference in the RDP session even if I use -s.

I'm trying to get a list of RDP sessions using qwinsta /server in Windows from Linux.

Best Answer

If you have access to the computer, install an ssh server on it. On Linux you can use for example Overlook-Fing to find the IP of the computer. Then you type ssh username@ipaddress into the Linux shell.

Example:

ssh Lenovo@192.168.0.100

Then type the user's password and you should have access to the computer's Windows Command Prompt. You could also use telnet but ssh is encrypted.

Related Question