LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   use ssh form web to 2 LAN-PC (https://www.linuxquestions.org/questions/linux-networking-3/use-ssh-form-web-to-2-lan-pc-731231/)

laode 06-07-2009 06:32 AM

use ssh form web to 2 LAN-PC
 
Hi,

I setup successfuly 1 dynDNS hostname for 1 PC in my LAN behind a DSL-router, installed inadyn client on that PC, setup port-forwarding in the router to this PC and so I can connect wiht ssh from outside of my LAN.

Now I tried to configure similar for another PC in LAN, but I can't make it working.

What I did:

1. define new dynDNS-hostname
2. install inadyn-client according to new host-name
3. tried 2 options in router:
1 setup port-forwarding (TCP=4222, UDP=22)
2 setup virtual server (public=4222, privat=22) setup client for ssh with port 4222

in case 3.1 router denies that, because port allready used for PC 1
in case 3.2 I get network timeout after several minutes on the client.

what amI doing wrong ?

Somehow I have the feeling, that my router (D-Link DIR-635) has different understanding of port-forwarding, than most the threads, telling to use different port than 22 for ssh.
I don't know exactly what the difference between port-forwarding and virtual server is.

anybody can tell me, how to do it well ?

thanks for any tip, laode

acid_kewpie 06-08-2009 03:04 PM

Well you should want port forwarding, and you should be able to use 22 for the internal and external ports. I'm not sure why you're referring to tcp and udp - ssh only uses tcp.

laode 06-08-2009 07:58 PM

port forward resp. port translation
 
Hi,

Thanks for answering. My answer to your question is basically quite easy:

first of all I am not well-experienced in network-stuff,
second, because my router D-Link DIR-635 provides just this fields (TCP,UDP, IP-Adress) in the menue 'port-forwarding'.
Meanwhile I think I understand a bit more and so I think this router-menue can not solve my problem, because it does just what it says: port-forwarding, while I need a port-translation for the 2nd PC using ssh as well, since it is not possible to forward 1 port to 2 machines.

I tried also menue 'vitual server', where I have fields for public port and private port, but it didn't work. May be this is basically the right menue and I did something wrong in it, so I have to learn more to understand router-messages.

I will do some more tests with 'virtual server' and post the result here.
A guiding text in that menue says, that this suitable for ftp-server or web-servers, which sound well matching to what I intend to do -> provide a ssh-server for my privat connects via web.

laode

rjlee 06-10-2009 02:52 PM

laode,

3.1:

You should be able to get this to work using virtual server; use the router menu to forward any unblocked port to port 22 on the linux server. Some routers have horrible interfaces, requiring a second step to enable a virtual server rule, or even need to reset just to enable your settings. You shouldn't have to change the ssh server at all in this case.


3.2:

You can also use port forwarding on the same port, although it's a bit more work. In this case, you need to choose an unblocked port and use that port number for SSH. In /etc/ssh/sshd_config you can specify the port lines that SSH listens to (only port 22 by default). You can add extra lines to accept connections on different ports. eg:
Code:

Port 22
Port 4222


Either way, one thing you can do is to run nmap (http://nmap.org) on your server from outside the network. This will tell you which ports you have open as visible on the outside world. If it doesn't show your ssh port, then either you have not opened it in the router, or your ISP has blocked it.

Hope that helps,

— Robert J Lee.

laode 06-10-2009 03:13 PM

forward or translateion of ports
 
Hi J.Lee,

Thanks for your comment. You help me in convincing my understanding of port-forwarding.

Meanwhile I tested also port forwarding with 4222 and changed ssd.conf to 4222 as well as clinet (putty), but could not get it run.

currently I can't test, because I tried to install earlier Ubuntu (8.10) to overcome some other compatibility problems with UB 9.04 and Oracle.

Unfortunately Grub is not able to start since :-((
but that's another story.

I will continue testing forwarding and virtual server as soon as my System is back alive.

Thanks for your comments on some router-side effects. My experience about D-Link DIR-635 is not bad so far, the menues are clear and logical and the side-help-text telling about the features background, which helps a lot in deed.

cheers Laode


All times are GMT -5. The time now is 03:56 AM.