Find the answer to your Linux question:
Results 1 to 7 of 7
I was wondering if anyone could give me some advice on ssh/scp stuff on a computer I have at home hooked up to a linksys router. For example when I'm ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer spencerf's Avatar
    Join Date
    Jan 2005
    Location
    Syracuse, NY
    Posts
    1,144

    ssh/scp on computer hooked up to router


    I was wondering if anyone could give me some advice on ssh/scp stuff on a computer I have at home hooked up to a linksys router. For example when I'm home and I have my desktop hooked up to router through ethernet cable and my laptop running wireless I can transfer stuff easy through the routers ip of 192.blah blah blah. But when I'm away with my laptop I can't connect to desktop. I tried finding out ip of desktop by going to "whatismyip.com" and if gave me an ip address. Then I when I was away I tried using ssh.

    first I started ssh on my desktop. /etc/init.d/sshd start
    started it on my laptop when I was there
    then I: ssh 242.192.132.13 -l bob

    that isn't the exact ip but you get the point. And the cursor would just blink for a while and then no connect. So is my problem a wrong ip address or trying to run through router or maybe my commands are wrong its been a while since I used ssh. I have read the manual for ssh and scp and these have not helped so far and to be honest are quite dense I really just wanted to access my computer for an experiment for future uses.

    Thanks for all your help.
    All right, brain. You don't like me and I don't like you, but let's just do this and I can get back to killing you with beer. All New Users Read This!!! If you have a grub problem please look at GRUB MANUAL

  2. #2
    Banned
    Join Date
    Jul 2004
    Posts
    947
    if you have got the correct ip you need to port forward from the router

    port forward all requests to port number 22 to your desktops, internal ip

    may be under virtial servers on the linksys

  3. #3
    Linux Engineer spencerf's Avatar
    Join Date
    Jan 2005
    Location
    Syracuse, NY
    Posts
    1,144
    alright I'll try that. I thought that it would already be enabled if I could use ssh within my localnetwork itself but maybe not. I'll report back if this works. Gotta go find another place to get internet to try it out.
    All right, brain. You don't like me and I don't like you, but let's just do this and I can get back to killing you with beer. All New Users Read This!!! If you have a grub problem please look at GRUB MANUAL

  4. #4
    Just Joined!
    Join Date
    Jun 2005
    Location
    Canada, Halifax
    Posts
    86
    You can test your router's firewall configuration by connecting to your router's WAN IP from within the LAN. For example:

    Router:
    WAN IP: 21.220.110.8
    LAN IP: 192.168.0.1

    PC:
    eth0 IP: 192.168.0.100

    Router firewall rule: forward all WAN TCP connections port 22 to the "private" LAN IP 192.168.0.100 port 22.

    From the PC test it out with:
    Code:
    $ ssh user_name@21.220.110.8

  5. #5
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by davebardsley
    You can test your router's firewall configuration by connecting to your router's WAN IP from within the LAN. For example:

    Router:
    WAN IP: 21.220.110.8
    LAN IP: 192.168.0.1

    PC:
    eth0 IP: 192.168.0.100

    Router firewall rule: forward all WAN TCP connections port 22 to the "private" LAN IP 192.168.0.100 port 22.

    From the PC test it out with:
    Code:
    $ ssh user_name@21.220.110.8
    Wont necesdarily work with a router.... accessing my external IP with my D-Link router failed COMPLETELY, and accessing the WAN ip with my linux router doesn't re-forward requests back to my PC internally
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  6. #6
    Just Joined!
    Join Date
    Jun 2005
    Location
    Canada, Halifax
    Posts
    86
    sdousley
    Wont necesdarily work with a router.... accessing my external IP with my D-Link router failed COMPLETELY, and accessing the WAN ip with my linux router doesn't re-forward requests back to my PC internally
    My D-Link DI-604 "out-of-the-box" (or after a reset) has only the following firewall rules enabled: WAN ping, default allow, and default deny. With the addition of a single firewall rule to forward port 22 to the specified machine
    Code:
    WAN,* LAN,192.168.0.100 TCP,22
    one can SSH from the specified private IP address out to the router's WAN IP and have said connection forwarded back to the private machine. It works for me, and it will work for you unless you have higher priority firewall rules implemented. Try it and see.

    Judging by the nature of this thread, and the implied experience of the originator I suspect that s/he will only have the standard firewall rules enabled, and I also assume that aside from insignificant syntax variations, his router and my DI-604 to behave similarly: either or both of my assumptions could be in error; I believe my suggestion will work.

    BTW spencerf: Check out http://www.portforward.com. I also strongly suggest that you disable your router's ping from WAN port if you haven't' already. This will make your IP slightly more stealthy despite port scanning tools that don't rely on ping responses. Just one more defense in the overall security strategy.

  7. #7
    Linux Engineer spencerf's Avatar
    Join Date
    Jan 2005
    Location
    Syracuse, NY
    Posts
    1,144
    ok thanks for all the advice everyone. School has ended for this semested so I'm not on an outside network right now but I'll try when I get back or go to a coffee shop or something. Thanks again. Will update when I have more info.
    All right, brain. You don't like me and I don't like you, but let's just do this and I can get back to killing you with beer. All New Users Read This!!! If you have a grub problem please look at GRUB MANUAL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •