Remote accsessing Windows from Linux.

Today I'm going to show you how to access a Windows machine from Linux (in my case Ubuntu), as much as I like doing things from my Linux box there is times where I have to access one of my Windows boxes, and if that's the case for you as well this may just help a bit.

Let's start. First, there are some things you need to do on the Windows side of things (I'm doing this on a Win7 machine)

1- click start

2- right click on Computer, on the sub-menu click on Properties.

3- on the right side of the window (Control Panel > All Control Panel Items >        System) click on Remote settings.

4- The next window is going to be System Properties, check Allow connections from computers running any version of Remote Desktop

5- Click on Apply.
6- Click on Ok that will close that window.

Now for the next part of this go back to your Linux box, we are going to use rdekstop to connect to Windows, if you don't have this installed on your machine you can install it from the terminal (I find using the terminal is faster when it comes to installing pretty much anything). If you feel adventurous you can install it from the source wich you can download from http://www.rdesktop.org/.

1- Hit Ctrl+Alt+t
2- sudo apt-get install rdesktop -y ( it will ask you to type your password)

Once rdesktop is installed, we are good to go. The next step is to find out the Win7 IP address we are going to connect to, I'm going to show a couple way to find this out, in the Win7 box, click on Start and type cmd.exe, then in the new window type ifconfig it should show something like this.

 The other way you can find out the IP of the Win7 Machine we are connected to is if you use the Nmap command, again from your Linux box open the Terminal and type nmap -v -AF 192.168.0.9/24 this command will show you every device in your network, your Win Machine should be listed there.

Finally to connect to Windows from Linux, open a terminal Ctrl+Alt+T and type rdesktop 192.168.0.9 this will open a mid-size window.



But this is not the end if you want to log in with your username and password as well as in a full-screen mode type this instead  rdesktop -u USERNAME -P PASSWORD -f 192.168.0.9  and you will be logged to your desktop in a full screen, taking it a bit further if you want to also get the sound from windows from the terminal type rdesktop -r sound -sound -u USERNAME -P PASSWORD -f 192.168.0.9  and you will be able to use the sound card from you Windows machine.

As a last thought the last way I show how to automatically log in with your username and password may not be so secure since your password will be recorded in the bash history log to avoid this type rdesktop -r sound -sound -u USERNAME -P - -f 192.168.0.9  this way you will be asked to type you password but it will not be shown in the terminal just as a precaution.

Like always hope this help you in your google hunt for knowledge.


Sam Ramirez
Data Recovery Engineer
4ndr0bu@gmail.com

Comments

Popular Posts