Need some help with remote desktop connections

I’m competely lost when it comes to doing this. I copied these commands from another thread:

ssh -t -L 5900:localhost:5900 oldcpu@ip-address-of-pc-2 ‘x11vnc -localhost -nolookup -nopw -display :0’

What do I put for “oldcpu@ip-address-of-pc-2”? Right now I’m in the same room with the pc I want to connect to, but I plan on doing it from 600 miles away. The pc I’m trying to connect to is behind a router and the ip address is 192.168.1.2.

I tried using Krfb and Krdc and sending myself an invite but I had no luck. I set port 5900 to port forwarding on the router but I don’t know if that’s right.

Can anyone help?

On Wed, 28 Oct 2009 23:06:02 +0000, pilotgi wrote:

> What do I put for “oldcpu@ip-address-of-pc-2”?

Replace “oldcpu” with your username on the remote system and 192.168.1.2
for “ip-address-of-pc-2”.

Jim


Jim Henderson
openSUSE Forums Moderator

Thanks for the quick answer. The result of the command was “port 22: Connection refused.” I configured port forwarding on port 22 in the router, but I got the same result on the second try.

On Wed, 28 Oct 2009 23:56:02 +0000, pilotgi wrote:

> Thanks for the quick answer. The result of the command was “port 22:
> Connection refused.” I configured port forwarding on port 22 in the
> router, but I got the same result on the second try.

I’d probably start by just trying to ssh to the box without the extra
commands - just “ssh user@192.168.1.2” (substitute the user name for
“user”) and see if you can get a connection.

You might also need to open port 22 in the target system’s firewall.

Jim


Jim Henderson
openSUSE Forums Moderator

I wasn’t sure if I was configuring the firewall right so I just turned it off and I still got the connection refused to port 22 message, with the shortened command as you suggested.

As far as configuring the firewall goes is it YaST2 > Firewall Configuration > Allowed services > Advanced?

On Thu, 29 Oct 2009 00:56:01 +0000, pilotgi wrote:

> I wasn’t sure if I was configuring the firewall right so I just turned
> it off and I still got the connection refused to port 22 message, with
> the shortened command as you suggested.
>
> As far as configuring the firewall goes is it YaST2 > Firewall
> Configuration > Allowed services > Advanced?

That would be the place to make the change, but disabling the firewall
also would have the same effect.

Let’s try a couple commands from the system you’re connecting from:

  1. ping 192.168.1.2

That will check basic connectivity.

  1. telnet 192.168.1.2 22

That will check to see if we can get a response on the default ssh port
(assuming here that you haven’t changed it).

What responses do you get to those two commands?

Jim

Jim Henderson
openSUSE Forums Moderator

Ping to 192.168.1.2 was successful. Result of telnet 192.168.1.2 22:

Trying 192.168.1.2…
telnet: connect to address 192.168.1.2: Connection refused

On Thu, 29 Oct 2009 01:16:03 +0000, pilotgi wrote:

> Ping to 192.168.1.2 was successful. Result of telnet 192.168.1.2 22:
>
> Trying 192.168.1.2…
> telnet: connect to address 192.168.1.2: Connection refused

Next step would be to check and see if sshd is running on the target
server - sounds like it probably isn’t.

In YaST on the target machine, select “System Services” and make sure
sshd is set to “enabled” (in simple mode; in expert mode, you’ll probably
want to enable runlevels 3 and 5).

Jim

Jim Henderson
openSUSE Forums Moderator

I enabled remote access through YaST > Network services and sshd in System Services, runlevel 3 and 5. Now I get this when I do ssh user@192.168.1.2:

The authenticity of host ‘192.168.1.2 (192.168.1.2)’ can’t be established.
RSA key fingerprint is 66:23:61:a9:b8:1d:7b:48:96:ff:e2:18:79:d5:31:ff.
Are you sure you want to continue connecting (yes/no)? Yes.
Host key verification failed.

On Thu, 29 Oct 2009 17:26:01 +0000, pilotgi wrote:

> I enabled remote access through YaST > Network services and sshd in
> System Services, runlevel 3 and 5. Now I get this when I do ssh
> user@192.168.1.2:
>
> The authenticity of host ‘192.168.1.2 (192.168.1.2)’ can’t be
> established.
> RSA key fingerprint is
> 66:23:61:a9:b8:1d:7b:48:96:ff:e2:18:79:d5:31:ff. Are you sure you want
> to continue connecting (yes/no)? Yes. Host key verification failed.

That’s a step in the right direction - the sshd daemon is now running and
is allowing an initial connection to be made.

But it’s odd that it’s failing the host key verification after you answer
“yes”. What version of the OS (and sshd) is on the target system?

I’m not able to duplicate the failure on my systems - I’m guessing that
on your target system, “Yes.” is not “yes” and that may be why it’s
failing. It’s a long shot, though.

Is there anything in the target system’s /var/log/messages file relating
to the connection attempt?

Jim


Jim Henderson
openSUSE Forums Moderator

All my previous attempts at connecting through ssh was when my laptop was using the same router as the target machine. Now I’m 600 miles away and all I’m getting is “Connection refused” again.

Is the correct method to use the ip address assigned by the router or the ip address at the location, i.e. the ip address assigned by the ISP that is outside the router?

I must me missing something simple here, since I’m not having any luck and remote administration is something a lot of people are doing.

On Sun, 01 Nov 2009 17:16:02 +0000, pilotgi wrote:

> All my previous attempts at connecting through ssh was when my laptop
> was using the same router as the target machine. Now I’m 600 miles away
> and all I’m getting is “Connection refused” again.
>
> Is the correct method to use the ip address assigned by the router or
> the ip address at the location, i.e. the ip address assigned by the ISP
> that is outside the router?
>
> I must me missing something simple here, since I’m not having any luck
> and remote administration is something a lot of people are doing.

The address you’re using (192.168.1.2) is part of a special address block
that is not routable on the Internet because it’s intended to be used on
a private network.

What you’ll need to do from outside your router is use port forwarding on
the router to redirect port 22 (which is the default - if you’ve changed
the default, which is generally recommended, you’ll need to redirect that
port) from your router to the machine in question.

Then what you do is connect to the address assigned to your router. The
router will forward the requests to the system designated in the router’s
configuration.

There are three address blocks that are for private networks:

10.0.0.0/8
172.16.0.0/12
192.168.0.0/16

(The number after the / is the number of bits in the netmask - see

http://en.wikipedia.org/wiki/IP_address#IPv4_private_addresses

for more information about this)

Jim

Jim Henderson
openSUSE Forums Moderator

Does this mean that I was wrong in using this address all along?

Would the correct address to use be the one from the isp, such as 99.23.42.220?

I tried ssh user@99.23.42.220 and got: Connection timed out.

Hi
You would have needed to setup your router to forward requests to the
internal machine;

laptop->external IP->{router forwards to internal ip}->192.xxx.xxx.xxx

If you have nmap installed you could run that against your external ip
and see if any ports are open.

You should look at get a shell account somewhere (rootshell.be) so you
can test this before leaving the comfort of your home :slight_smile:


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.29-0.1-default
up 20:30, 2 users, load average: 0.13, 0.22, 0.21
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

I installed nmap but the only info I got was that my isp was working. How do I get info about the ports?

How do I do this?

Thanks for your input.

Hi
If you dodn’t get a list of open ports, try something like nmap -PN
<remote ip address> see the man page for some examples.

http://www.rootshell.be/ click the register link at the bottom
or
http://www.red-pill.eu/freeunix.shtml for others.

Once you have an account to log into, then you can ssh from your
home machine to that shell account, then back to you home machine to
test it all works. Or if you have a cellphone that can run applications
find a ssh client you can use (I use midpssh on my blackberry) to test.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.29-0.1-default
up 22:10, 2 users, load average: 0.22, 0.33, 0.28
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

The result of nmap -PN myipaddress (assigned by my isp for today):

Not shown: 999 filtered ports

PORT…STATE…SERVICE
50001/tcp open unknown

I don’t know why it’s not showing port 22, since that’s the port I opened in the firewall on my router. I also allowed secure shell server.

I did have some success connecting with ssh on my own network between my two computers. Strangely, I can connect from my laptop to my desktop, but not the other way. After success with ssh, I tried using KRDC so I could see the gui on the remote machine, but I got a “Server couldn’t be found” error.

Does anyone know how I can use ssh to see and manipulate the gui on a remote machine?