LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Remote SSH (https://www.linuxquestions.org/questions/linux-newbie-8/remote-ssh-323308/)

Kurzweil 05-13-2005 10:40 PM

Remote SSH
 
I used to be able to use remote desktop and SSH to my home computer from work but once I changed my cable modem for the wireless router version I can't do that anymore. I lost all server abilites on my computer for anything. Games included. Is there anyway I can still do this or do I need to go back to the regular cable modem?

Matir 05-13-2005 11:01 PM

The router is probably performing NAT (network address translation) which blocks you from doing this. You'll need to use port forwarding or a DMZ to make this work.

Kurzweil 05-13-2005 11:05 PM

I checked the router settings and told it to forward port 22 to 192.168.0.12 which is what my desktop shows up as. Am I on the right track?

danielanson 05-13-2005 11:07 PM

most definitely

Kurzweil 05-13-2005 11:12 PM

It didn't work after that. Is there another step?

danielanson 05-13-2005 11:13 PM

remember to configure the ssh daemon to AllowRootLogin NO and perhaps add that only you can login( you can allow groups or users ). As an added blast of paranoia, I use non-standard ports( Normally a fixed number plus the last quadrant of an IP address as a port number ). If you have more than one network card, remember to only allow ssh on certain cards for security or else you leave the gate open. Good luck!

Matir 05-13-2005 11:14 PM

Umm, it should be working... are you trying to ssh to your external ip from within your lan?

danielanson 05-13-2005 11:16 PM

You must configure the ssh daemon to listen-on 192.168.0.12. Hopefully you are using staic IP's behind the router as it gets more difficuly with dhcp.

danielanson 05-13-2005 11:17 PM

static ip's can be configured from the router and also within the OS

Matir 05-13-2005 11:18 PM

AllowRootLogin no is a good security tip. :) Since only I use my machines, I assume that passwords and so forth are strong enough, so I feel good about that. But this is all discussion for another topic.

danielanson 05-13-2005 11:19 PM

also when configuring ssh, remember to kill -9 `cat /var/run/sshd.pid` or wherever the process pid is located and the restart by usr/sbin/sshd

Kurzweil 05-13-2005 11:20 PM

Quote:

Originally posted by Matir
Umm, it should be working... are you trying to ssh to your external ip from within your lan?
Yes. Its the only want I can test it right now. Will that cause it to not work?

Kurzweil 05-13-2005 11:21 PM

Please forgive me..

Where do I got to setup SSH?

danielanson 05-13-2005 11:27 PM

by ssh'ing to your ISP provided ip address, the packets should be passed to your internal box. But as well the internal box must be configured to listen.

danielanson 05-13-2005 11:28 PM

In OpenBSD it is /etc/ssh/sshd_config, I'm sure it something similar in fedora. Do a man sshd and it will probably tell you.

Kurzweil 05-13-2005 11:31 PM

Alright. Will I not be able to test this until I am off of my LAN? I'll have to be at work?

Matir 05-13-2005 11:34 PM

Unfortunately, by the nature of portforwarding, it doesn't work from internal->external->internal.

FYI, There is no need to perform kill -9 on SSHD. 'kill -HUP' will force SSHD to reread it's config file. Also, most distributions will allow you to do /etc/init.d/ssh restart (or /etc/init.d/sshd, depending on distro).

Kurzweil 05-13-2005 11:37 PM

Thanks for all the help you two. I'll do my best. Hopfully it will work tomorrow because I can't test it any other way.

Kurzweil 05-14-2005 12:03 AM

Ooh. I made progress. I had a freind help me test and it askes for the user name then password then it says connection closed by remote host once the password is entered correctly. Is that a simple setup error that could be fixed by you linux gods really fast?

danielanson 05-14-2005 12:10 AM

Sounds like a router config problem to me. It sounds as if the daemon is responding. Are you using iptables on the Linux box and if so they must be configured as well?

Kurzweil 05-14-2005 12:13 AM

This will probably make you want to give up on me but I don't know what you're talking about.. I just installed Fedorda again for the first time in a while 2 days ago..

Kurzweil 05-14-2005 12:23 AM

I think its just a permission problem. Logging in as root work. (I know you're going to kill me for allowing that) but it does work. Where do I allow ssh to others?

danielanson 05-14-2005 12:30 AM

do a >locate sshd_config or a >find / -name sshd_config -print and if there is no file ......

make sure and do a >man sshd and your problems will be revealed( this step is a must ).

As well, do a >man iptables.

I'm going out for a beer. If you havent figured this out in a few hours, I'll be back.

Best of Luck,

Daniel :)

Kurzweil 05-14-2005 12:41 AM

Yeah, I can't figure it out. I can only log in as root but nothing else. I was trying to set it up so a me and a friend could both be in but no luck I guess. :(


All times are GMT -5. The time now is 07:54 PM.