Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
remote login to only certain boxes behind firewall
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
matc
n00b
n00b


Joined: 04 Aug 2005
Posts: 29

PostPosted: Fri Dec 22, 2006 8:36 am    Post subject: remote login to only certain boxes behind firewall Reply with quote

I have a Gentoo Linux box and a Windows box at home, connected to my DSL line and to each other with a firewall/router (Netgear FR114P). My Internet IP Address is provided dynamically by my ISP. I can use SSH and Putty to log on to my Linux box from the Windows machine. I would like to be able to do this remotely from other Windows computers (e.g. at friends' and relatives' homes or in hotels). I would like to set this up in such a way that only my Linux box, but not the Windows one, is accessible from the outside. (I suppose this would be easier if only Linux boxes were involved, but that's not the reality for me!)

I've read man pages, searched the forums and Googled for help on this topic and have found a lot of info that will likely prove useful, but am not really seeing the big picture of how to do this. I figure that at the least this could involve changes to the setup of my SSH, firewall and possibly my DSL modem, and maybe some special configuration of Putty (or similar) on whatever remote Windows machine I'm using at the moment.

Can anybody please recommend a source or sources of instructions on how I can achieve my desired setup?
Back to top
View user's profile Send private message
bin-doph
Guru
Guru


Joined: 23 May 2003
Posts: 302

PostPosted: Fri Dec 22, 2006 8:53 am    Post subject: Reply with quote

the only thing to do is setup your netgear-thingy. it should forward all traffic via port 22 to your linux-box, thats basically it. you should also be aware of the fact that if you get ip-adresses from your provider dynamically you wont know it, if your "at friends" or whereever. therefore you should check dyndns.org or something like that (I know routers which also provide a functionality for this, maybe yours can do that too -> rtfm). also you should consider that the internet is bad and if your able to connect to your box from all over the world, everybody else can do. If your using passwordauthentification, drop that and create a private key + configure sshd to PasswordAuthentification no

hth
_________________
perl -e '$_=q;4a75737420616e6f74686572205065726c204861636b65720as;;for(s;s;s;s;s;s;s;s;s;s;s;s){s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'
Back to top
View user's profile Send private message
matc
n00b
n00b


Joined: 04 Aug 2005
Posts: 29

PostPosted: Fri Dec 22, 2006 10:40 am    Post subject: Reply with quote

Thank you! That helps me get moving in the right direction.

I appreciate your cautions regarding security and will proceed very carefully.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55136
Location: 56N 3W

PostPosted: Fri Dec 22, 2006 10:47 am    Post subject: Reply with quote

matc,

Be sure to turn off root logins in /etc/ssh/sshd_config.
There are lots of user/password guessing bots on the big bad internet, so don't give them a valid user name.
If you need remote root access, add your user to the wheel group, so you can su to root.

Better, turn off password logins altogether and permit only key based authentication.
You will need to carry your half of the key pair with you to gain remote access
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
matc
n00b
n00b


Joined: 04 Aug 2005
Posts: 29

PostPosted: Fri Dec 22, 2006 11:06 am    Post subject: Reply with quote

NeddySeagoon wrote:
Be sure to turn off root logins in /etc/ssh/sshd_config.


Thanks for mentioning that, though I had already done it.

Quote:
There are lots of user/password guessing bots on the big bad internet, so don't give them a valid user name.


I'm not sure I understand. Do you mean I shouldn't have user accounts like "test" or "guest" with simple passwords? (I don't.) My intention is to only have one user, myself, allowed to log in, and I will make sure my password is long and complicated.

I'll likely wind up going the key-based authentication route anyway, and thanks to both of you for suggesting it.
Back to top
View user's profile Send private message
bubbl07
Apprentice
Apprentice


Joined: 06 Feb 2005
Posts: 237
Location: New York City

PostPosted: Fri Dec 22, 2006 3:11 pm    Post subject: Reply with quote

matc wrote:
NeddySeagoon wrote:
There are lots of user/password guessing bots on the big bad internet, so don't give them a valid user name.


I'm not sure I understand. Do you mean I shouldn't have user accounts like "test" or "guest" with simple passwords? (I don't.) My intention is to only have one user, myself, allowed to log in, and I will make sure my password is long and complicated.

I think he means that in order to log in, one needs a valid username and password. If you allow the superuser "root" to log in, then a bot already has one of the two pieces of information it would need -- at which point it can just start guessing random passwords for the root user instead of trying every user/password combination.
Back to top
View user's profile Send private message
Akhouk
Guru
Guru


Joined: 23 May 2003
Posts: 476
Location: The Two Niles, Africa

PostPosted: Sat Dec 23, 2006 12:03 pm    Post subject: Reply with quote

You can also use iptables to detect and block ssh brute force attacks.
_________________
AMD 64 3500+, 2Gb RAM DDR400, 2 x 180Gb SATA, 256Mb Nvidia
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum