PDA

View Full Version : How to access Ubuntu laptop remotely?



john_s
09-21-2011, 05:31 PM
While learning a bit of Ubuntu flavour I came across a need to access it from a distant location i.e. remotely.
That particular laptop uses a static IP address, and I'd like to remotely replace a file in one of the Ubuntu's directories.

What would you recommend - is there a simple way to do it ?

Thanks,
John

Loopy Byteloose
09-21-2011, 05:50 PM
I believe you would want to use 'ssh', the secure shell feature. It would be able to set up a remote 'terminal mode' session with your Ubuntu computer.

If you want to replace a file in your /home directory, no additional security manipulation would be needed. But if you wanted to do more low level administrative work, you would have to login via the 'sudo' command.

Martin_H
09-21-2011, 05:55 PM
To use SSH you'll have to enable sshd in the Ubuntu admin console. You can also create remote X windows sessions and have a full GUI on another machine, but that's more work just to move a file.

Mike G
09-21-2011, 06:02 PM
Most importantly, you need to forward port traffic to the Ubuntu PC. Is the PC on a home network?

RDL2004
09-21-2011, 06:10 PM
If this Linux laptop happens to need to be accessed from a Windows machine, you can use PuTTY.

http://www.chiark.greenend.org.uk/~sgtatham/putty/

john_s
09-21-2011, 06:52 PM
Is the PC on a home network?

No, its approx an hour drive distance away.

john_s
09-21-2011, 06:56 PM
If this Linux laptop happens to need to be accessed from a Windows machine, you can use PuTTY.

Yes, that will be the case (mostly jpg and txt files).

Mike G
09-21-2011, 07:15 PM
John, is the pc connected to the internet? If so, how? What is your IP?

john_s
09-21-2011, 09:02 PM
Mike G, that laptop is connected to an IP via wireless link. It has a static IP address and I can access it from my pc remotely, but only to read some sensors data using another custom built application that runs under Ubuntu. What I need is to get into the Ubuntu directories itself so I can deposit my own jpg or txt files.

WBA Consulting
09-21-2011, 09:08 PM
I recently found out about Teamviewer (http://www.teamviewer.com), which may work. It's essentially a super easy to use remote desktop software package...... and free. It probably doesn't support direct file transfer, but I have uploaded files to an FTP site and then downloaded them remotely to do file transfers remotely.

Mike G
09-21-2011, 09:58 PM
John, if you already have a dedicated connection why not fire up FTP service on the laptop.

EDIT: I just installed vsftpd and within 2 minutes I'm FTPing between my Win box to my Linux box using the FileZilla FTP Cient.
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch15_:_Linux_FTP_Server_Setup

icepuck
09-21-2011, 11:43 PM
This is what I use to get to my Linux box from windows.
http://www.nomachine.com/products.php
-dan

Kevin Wood
09-22-2011, 03:18 AM
You should probably use secure copy (SCP) for this. Anything that's not encrypted (including the wireless connection...) will probably be compromised at some point.

SRLM
09-22-2011, 04:56 AM
From one Ubuntu box to another, you can remotely connect via Nautilus (the default Ubuntu file browser) by pressing ctrl+L, then typing in "sftp://ip_address". This is handy because it creates a remote mount point and it appears as just another folder on your computer. Also handy is F3, split pane view.

SSH is good for running commands remotely via command line, and SFTP is good for moving files between two computers. It's pretty simple.

As a side note, if the computer that you want to access is behind a firewall, then from that computer you can reverse SSH into a public server, and then you'll be able to SSH into the restricted machine from another computer via the public server. It's handy when you have no control over the routers.

john_s
09-22-2011, 04:56 AM
You should probably use secure copy (SCP) for this. Anything that's not encrypted (including the wireless connection...) will probably be compromised at some point.

I guess it's encrypted wireless as it was the ISP guy who did the original wireless Access Point installation. I provided them with laptop's MAC address and they used some kind of out-of-the-box contraption with antenna to establish internet link to their ISP tower located miles away yet clearly visible above the horizon. I just hooked up that Linux laptop using a cable from its ethernet port to their POE little box and it works.

Tor
09-22-2011, 09:38 AM
I guess it's encrypted wireless as it was the ISP guy who did the original wireless Access Point installation. I provided them with laptop's MAC address and they used some kind of out-of-the-box contraption with antenna to establish internet link to their ISP tower located miles away yet clearly visible above the horizon. They may be using that link for other customers as well, and if so the encryption won't help.. everyone on the same network can potentially monitor all the IP traffic. It's like when you're in a cafeteria with wi-fi access where you still have to get their WPA key to connect: Traffic is encrypted, but only to those without the key.. for those on the network all the data packages are plainly visible and can be read.

You really need the end-to-end encryption provided by SSL (e.g. via some kind of VPN) or SSH. The built-in support for mounting remote filesystems via ssh in Nautilus, as suggested by SRLM, is easy and secure.

Alternatively, instead of FTP it would be much better to use SFTP. SFTP emulates the FTP user experience (but not the protocol) over SSH.

-Tor

Loopy Byteloose
09-22-2011, 09:50 AM
Yes, maybe another or additional option is a better choice - setting up a VPN (Virtual Private Network) relationship.

This would be encrypted, like ssh - but you would be viewed as a member of the network at the other end.

I must admit I am having a bit of a problem with terminology though as Wikipedia includes SSH as one of many VPN choices.

http://en.wikipedia.org/wiki/Virtual_private_network

The main idea is that you tunnel through the web to your target computer with a secure, encrypted link and are able to use the file system. Some are GUI related, but that just makes them more complex.

john_s
09-22-2011, 06:11 PM
Tor / Loopy,

Great - so I need to travel to that remote site where that laptop is located, and do some manual install of some kind of 'VPN client' on that machine, correct?

mindrobots
09-22-2011, 07:07 PM
Unless something was left running on the remote machine and there are holes in the router to get through to it, a trip to the remote location will be needed. Since all this started with you asking "how do I...", I assume none of this is in place. I would try some of the suggested solutions locally with an identical setup so you can evaluate and practice. Once you get to the remote location, you really don't want any surprises and have to reinvent your planned solution or realize you forgot a piece of SW, cable, note, phone number, etc.

john_s
09-22-2011, 08:04 PM
... I would try some of the suggested solutions locally with an identical setup so you can evaluate and practice. ....

Sounds like a plan - fortunately I have another Ubuntu laptop next to me locally to experiment with before my trip to that remote one. Thanks, John

Loopy Byteloose
09-23-2011, 02:42 PM
SSH client goes on your computer, SSHD goes on the other one (That is a daemond, which Ubuntu already has, just needs to be activated).

You can use PUTTY, which now includes SSH as a feature and that will install on a Windows, an Apple, or a Linux machine. Visit the site and download which you want.

All these programs create a secure tunnel to the other computer. The old way, was TELNET - but anyone could see your passwords and what you were doing.

If you feel that you need an FTP application, Ubuntu has one that tunnels as well. It is NOT called SFTP. Why not try the Ubuntu Forum for detailed support? I specifically avoided the GUI type remote interface as it is more complex to install. If SSH does everything you need, there really is no need to make this more complex. After all, if you understand the security, it is likely to be more secure.

If you want, you can have the Ubuntu machine turn on and off the SSHD at certain times or on certain days of the week. Linux is flexible and likely to be more secure than alternatives, just because you understand the risks.

Loopy Byteloose
09-23-2011, 05:29 PM
OpenSSH website explains it all.

http://www.openssh.com/

john_s
09-23-2011, 07:42 PM
Sounds like another weekend project - back to my reading desk :)

Loopy Byteloose
09-24-2011, 06:53 AM
It really is not that complicated. Once the SSHD is set up, you can either use regular SSH or Putty-SSH to contact it. If you want to have other features, OpenSSH offers them - but I am not sure about where the repositories are for download.

I'd just try SSH or Putty-SSH and see if you can do what you want with it. You can get that up and running in 15 minutes, easily

SSHD provides an open port for SSH, but it sends back a verification to your computer before opening the port to further exchanges. Then all data is encrypted, so it cannot be snooped - including logins. It would take quite a bit to hack into because it isn't merely opening a port to your remote computer, there is some sort of handshaking involved.