Page 1 of 1

How To: Login to your linux box remotely.

Posted: Thu May 07, 2009 9:16 am
by emorrp1
Rationale:
I can no longer be bothered to lug my laptop around with me anymore, and I've also recently moved all my data to an external HDD, so to work properly, I would have to carry that round with me too. I do not (yet) have a spare box that I can just turn into a full-blown server to solve my document access issues. I want to be able to access my computer from anywhere, also I don't need a gui, so this will give you access to your machine as if you had opened a terminal.

However for those who want guis, simply add the "-X" option to each ssh command, forwarding the graphical server and allowing you to launch guis from the command-line, e.g. "mintupload ~/.profile". The disadvantage of this is it's platform dependent, you need to have an X server running on your guest machine, with means either linux, or mac with the server running.

1) install the openssh-server package (you might have to reboot afterwards). AK Dave recommends securing it, but I haven't got around to following his advice yet: http://forums.linuxmint.com/viewtopic.p ... sh#p148429
2) if you're lucky enough to have a static IP, you're done: find your IP by right-clicking on the network-manager, selecting connection info. You can now login to your machine using the following command from any remote linux box (look at Putty for windows):

Code: Select all

ssh username@ip.add.re.ss
if like me, not only do you not have a static IP address, but you're also behind a stupid campus firewall that doesn't even allow you to ping your IP address, then it's more complicated:
3) get an account hosted somewhere that you can ssh into. In my case I'm using my department's servers, where we get a free account.
4) setup a "reverse ssh tunnel" from your machine to the server (PORT should be a high numbered, four figures, port on the server, e.g. 1234):

Code: Select all

ssh -NR PORT:localhost:22 server_username@remote-server.com
5) while that program is running, you can first logon to the server:

Code: Select all

ssh server_username@remote-server.com
6) then from there you can logon to your machine:

Code: Select all

ssh -p PORT username@localhost
viola, you can now login from anywhere in world (well, at least anywhere you can get to the server)

EDIT: just noticed this howto for securing the ssh server: http://forums.linuxmint.com/viewtopic.php?f=42&t=19183

Re: How To: Login to your linux box remotely.

Posted: Tue May 12, 2009 7:16 pm
by grimdestripador
I thought I'd get an explanation of how to pass a X11 session through SSH.

Re: How To: Login to your linux box remotely.

Posted: Wed May 13, 2009 4:53 am
by emorrp1
there you go grimdestripador, it's as simple as adding the -X option.

Re: How To: Login to your linux box remotely.

Posted: Tue May 19, 2009 10:09 pm
by grimdestripador
of all things, I have yet to do this sucessfully.

Re: How To: Login to your linux box remotely.

Posted: Fri May 22, 2009 6:34 am
by emorrp1
hmm, you may be right, I just tried the X forwarding now and it didn't work, anyone have any ideas?

Re: How To: Login to your linux box remotely.

Posted: Mon Mar 29, 2010 4:25 pm
by bolle
Can i do this on an ipod touch jailbroken with a terminal app on it?
Thanks

Re: How To: Login to your linux box remotely.

Posted: Mon Mar 29, 2010 6:56 pm
by emorrp1
Most of the hard part is on the host system end, you should be able to connect to it using any device that can run an ssh client program (you probably need to install openssh according to many google results)

Re: How To: Login to your linux box remotely.

Posted: Mon May 31, 2010 3:58 am
by jessewilliams
Brilliant! Thanks for the heads up mate! It never crossed my mind that this was a piece of cake to be do! Followed your steps with no sweat and got it done immediately. Thank for the info! More Power!

Re: How To: Login to your linux box remotely.

Posted: Mon May 31, 2010 9:57 am
by emorrp1
Glad I could help, JesseWilliams, though I should probably update this how-to with what I now know about dyndns.org - an amazing site that effectively gives you a free domain tied to your non-fixed IP, allowing you to be done after step 2! It also gets around the issue of having to know in advance you're going to need access.

Re: How To: Login to your linux box remotely.

Posted: Mon May 31, 2010 10:20 am
by ibm450
Team viewer, easy to use, has linux version also, free and works fast

Re: How To: Login to your linux box remotely.

Posted: Mon May 31, 2010 3:02 pm
by DrHu
No machine NX is also worth a look
http://linuxgazette.net/135/knaggs.html

Re: How To: Login to your linux box remotely.

Posted: Sat Jul 24, 2010 9:08 am
by designwebs
I like to use teamviewer myself.

Re: How To: Login to your linux box remotely.

Posted: Sat Jul 24, 2010 10:04 am
by paulc
ssh is the best & easiest way, and safest.
$ ssh username@IP_ADDRESS
I would for sure block telnet & ftp as insecure. scp, putty, winscp, ssh, the best & safest way to get back & forth.

Re: How To: Login to your linux box remotely.

Posted: Mon Jan 03, 2011 5:39 am
by Pierre
Team viewer, easy to use, has linux version also, free and works fast
+1.

Re: How To: Login to your linux box remotely.

Posted: Fri Nov 18, 2011 4:07 am
by wagonlips
I find that if I reboot my machine remotely I am effectively locked out. None of the services, such as ssh, start up until I physically login. How can I rectify this?

Linux Mint 11 Katya (GNU/Linux 2.6.38-8-generic x86_64)

Re: How To: Login to your linux box remotely.

Posted: Thu Dec 01, 2011 5:33 pm
by electroaudio
emorrp1 wrote: However for those who want guis, simply add the "-X" option to each ssh command, forwarding the graphical server and allowing you to launch guis from the command-line, e.g. "mintupload ~/.profile". The disadvantage of this is it's platform dependent, you need to have an X server running on your guest machine, with means either linux, or mac with the server running.

There is a x-win server for windows too called x-ming http://sourceforge.net/projects/xming/
Xming works just as well as a normal xserver for both for the terminal and for graphical programs, but...