Connecting to a remote computer via the Internet

Discuss Programming / Linux questions.

Moderators: scallenger, Sky, TresCom Support Team

Post Reply
User avatar
Dapper Dan
-=TresCom Elder=-
-=TresCom Elder=-
Posts: 2010
Joined: Tue Nov 12, 2002 7:43 am
Location: South Carolina
Contact:

Connecting to a remote computer via the Internet

Post by Dapper Dan »

Hi guys. I've never done this before, even with Windows. I'm trying to figure out how to access my work computer from my home computer via the internet. The info I can find on the net is, (for me) confusing at best! Anyway, please have a look and see if I'm on the right track here.

I think the way to do this is using Openssh, with the software from Openssh client on my home computer and Openssh Server software on the computer at work which I've already done. From my home computer I go into shell and type:

ssh username@MyworkISP.net

At this point, it asks for a password. when I type it in, the ISP throws up a welcome and a bunch of their rules and regulations. This is how far I've gotten. From here, how do I then access my work computer and it's files? Am I on the right track here, or am I way off base? Any help would be greatly appreciated.
Troodon

Post by Troodon »

ssh, a more secure replacement for telnet, is what you would use in console mode. Your work computer runs xdm (X display manager) so you can also access it in graphics mode if you run an X-server on your home computer. You need to have certain ports open in your firewall(s).

I use ssh like this: on my "home" machine I open a terminal window and type: ssh -l <username> <dest machine>. Once you're in you can run programs in console mode (e.g, elm for email, emacs for text editing, etc.).

To log in in graphics mode your work computer must be running X-Window. Your "home" computer must also run an X-server, that is, a program that can display unix/linux graphics. If your home machine is also on Linux than you already have one; if you're on Windows then you'll need the MicroImages X-Server (used to be available free of charge).

Let me know what your configuration is.
User avatar
Dapper Dan
-=TresCom Elder=-
-=TresCom Elder=-
Posts: 2010
Joined: Tue Nov 12, 2002 7:43 am
Location: South Carolina
Contact:

Post by Dapper Dan »

Thanks Troodon! Both machines are running Mandrake 9.0 with IceWM. Both have Openssh server and client software installed. So do I still access the work computer using ssh and then switch to graphics somehow? Or do I access the computer in graphics mode by other means? I would prefer to use X so I can see what I'm doing! :wink:
Thanks!
Troodon

Post by Troodon »

- Open a terminal window on your workstation (home computer) and ssh to your server (work computer): ssh -<username on server> <server IP>. Enter the password.

- Try one of these (don't know what sehell you are under and they are shell-depenedent):

>setenv DISPLAY <workstation IP>:0.0
>DISPLAY=<workstation IP>:0.0; export DISPLAY

They tell your server's xdm to display your X-Window programs on the workstation screen.

- Run: xterm &

The ampersand is to run the xterm program in the foreground. If you don't have xterm try any other terminal emulation program you might have (e.g., konsole).

What should happen now is, on your workstation display you should see a popup window running the xterm program. From there you can launch any X-Window program, as if you were connected to a terminal of your server. For example, try kword &, or evolution &.

Should the above not work check that you have ports 22 and 6000-6063 open in your server's firewall. You may also need to run

xhost <your workstation IP>

on your server to allow your workstation to run programs.

In principle, it is possible to create config files on your server that would simplify the connection procedure described above.
User avatar
Dapper Dan
-=TresCom Elder=-
-=TresCom Elder=-
Posts: 2010
Joined: Tue Nov 12, 2002 7:43 am
Location: South Carolina
Contact:

Post by Dapper Dan »

Troodon, thanks for the help but I'm still not figuring this out. I will persist though.
Have you seen or used this?

http://www.pingx.net/secpanel/

I havn't got it working for me yet, but I like the idea of having a gui for ssh.
Troodon

Post by Troodon »

A GUI ssh won't allow you to display on your home computer GUI programs running on your work computer (server). The only way to do it is by redirecting output to your X-server (home workstation), the way I described it. But there may be restrictions from your ISP, or your work/home firewalls.

If you want, I can try running some tests for you from my place. You would need to open a temporary account for me on your server so that I can ssh to it.
User avatar
Dapper Dan
-=TresCom Elder=-
-=TresCom Elder=-
Posts: 2010
Joined: Tue Nov 12, 2002 7:43 am
Location: South Carolina
Contact:

Post by Dapper Dan »

Thanks, if that wouldn't be too much trouble. So I create a user directory, username and password for you on my server, give you my ISP's address and my server IP?
Troodon
Dinosaur egg
Dinosaur egg
Posts: 3
Joined: Fri Oct 30, 2015 7:45 pm

Post by Troodon »

Just popup a console window on your server, login as root (type "su" and then enter your root password). As root enter "useradd troodon" to create user troodon, then, at the prompt again, enter "passwd troodon" and choose a password for me. The system will automatically create a directory for the new user.

When done PM me the password and your server IP. That should be enough for me to ssh to your server and run those commands. Let me know, we can give it a try next week. :)
User avatar
Dapper Dan
-=TresCom Elder=-
-=TresCom Elder=-
Posts: 2010
Joined: Tue Nov 12, 2002 7:43 am
Location: South Carolina
Contact:

Post by Dapper Dan »

I should be able to set it up this weekend. I'll get the info to you shortly. Thanks.
Post Reply