Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] SSH configuration
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
MaximeG
l33t
l33t


Joined: 15 Apr 2008
Posts: 722
Location: Belgium

PostPosted: Tue May 06, 2008 10:45 am    Post subject: [SOLVED] SSH configuration Reply with quote

Hello everybody,

I've launched a SSH daemon on my gentoo box to be able to access it remotely.

Well, it works fine when I try to connect from another machine that sits in my subnet/local network. But when I'm outside of it (ie. anywhere else on the internet) I got the message : "ssh : connection to username@hostname port : 22 refused".

Of course, the hostname is the ip address (and not its local one ;) ) of my routeur/gateway with a NAT service up and running.

Then I've tried to configure my routeur/gateway with adding a port translation rule but it didn't help.

So, either I can't configure my routeur properly (I'm not a networking expert I'm afraid) or my internet provider simply doesn't allow connection to port 22 at all.

The rule I've created is a translation port : "port in : 22 ; port out : 22 ; translation port : 22". Is it the correct way to proceed ?

Thanks for your help !
Maxime
_________________
Future is wide open.


Last edited by MaximeG on Fri Jun 06, 2008 1:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
dentharg
Guru
Guru


Joined: 10 Aug 2004
Posts: 438
Location: /poland/wroclaw

PostPosted: Tue May 06, 2008 11:20 am    Post subject: Reply with quote

The line ""port in : 22 ; port out : 22 ; translation port : 22"

says: "take what comes in on the router on port 22 and push it to port 22 on the router via port 22"?

I can't see where you redirect the transmission to another (namely local) IP.
And it is also better to select non-standard port for ssh translation at the router.
_________________
Core2Duo e6300 | Asus P5B-V | 3 GB RAM | kernel 2.6.24 | KDE 3.5.9 + 4.0.0
Back to top
View user's profile Send private message
MaximeG
l33t
l33t


Joined: 15 Apr 2008
Posts: 722
Location: Belgium

PostPosted: Tue May 06, 2008 12:15 pm    Post subject: Reply with quote

Hi,

The rule is related to my static ip 192.168.1.123 address. Therefore the line means (well, I think so :p ) :
What arrives at port 22 on the gateway goes to port 22 on the machine with the local ip address 192.168.1.123.

Well, I think it is the way I've done for my web server last time.



Ok for changing from standart port, but how ?

Thanks a lot,
Maxime
_________________
Future is wide open.
Back to top
View user's profile Send private message
dentharg
Guru
Guru


Joined: 10 Aug 2004
Posts: 438
Location: /poland/wroclaw

PostPosted: Tue May 06, 2008 12:33 pm    Post subject: Reply with quote

Then this should work.

I would also wonder why "translation port", when it's just simple "take from here, put there directly".

As for port number change, just setup sshd to listen on different port than 22 and redirect the same port from gateway.

Have you got any logs from gateway for this ssh traffic?
_________________
Core2Duo e6300 | Asus P5B-V | 3 GB RAM | kernel 2.6.24 | KDE 3.5.9 + 4.0.0
Back to top
View user's profile Send private message
MaximeG
l33t
l33t


Joined: 15 Apr 2008
Posts: 722
Location: Belgium

PostPosted: Tue May 06, 2008 12:57 pm    Post subject: Reply with quote

Hi,

- For the translation port I don't know either what it is used for.

- Mm, brownie point here. I've completely forgotten about my routeur log. I'll check them as soon as possible.

- Yes, I'll try to change ports and see whether it's doing better or not.

Thanks for your answers, I'll keep this thread updated with the results,

Maxime
_________________
Future is wide open.
Back to top
View user's profile Send private message
MaximeG
l33t
l33t


Joined: 15 Apr 2008
Posts: 722
Location: Belgium

PostPosted: Tue May 06, 2008 5:48 pm    Post subject: Reply with quote

Hi,

Well, nothing in the gateway log :(

I've changed ports, but it has not helped.

Maxime
_________________
Future is wide open.
Back to top
View user's profile Send private message
dentharg
Guru
Guru


Joined: 10 Aug 2004
Posts: 438
Location: /poland/wroclaw

PostPosted: Tue May 06, 2008 5:55 pm    Post subject: Reply with quote

Changing ports just helps in security a bit, nothing more.

How did you exactly configure your gw?
What model, what software it is?
_________________
Core2Duo e6300 | Asus P5B-V | 3 GB RAM | kernel 2.6.24 | KDE 3.5.9 + 4.0.0
Back to top
View user's profile Send private message
MaximeG
l33t
l33t


Joined: 15 Apr 2008
Posts: 722
Location: Belgium

PostPosted: Tue May 06, 2008 6:25 pm    Post subject: Reply with quote

My gateway is

Dlink
DSL-G604T

And its default embedded software.

Maxime

PS : Yeah, I know for the port change : I was only wondering whether my internet provider would have blocked port 22 for any reason.
_________________
Future is wide open.
Back to top
View user's profile Send private message
dentharg
Guru
Guru


Joined: 10 Aug 2004
Posts: 438
Location: /poland/wroclaw

PostPosted: Tue May 06, 2008 6:54 pm    Post subject: Reply with quote

Are you directly connected to Internet (ie. DSL) or you connect via something like pppoe to another gw?
Do you connect from outside via provider's IP or do you have your own (even if it's dynamic)?
_________________
Core2Duo e6300 | Asus P5B-V | 3 GB RAM | kernel 2.6.24 | KDE 3.5.9 + 4.0.0
Back to top
View user's profile Send private message
MaximeG
l33t
l33t


Joined: 15 Apr 2008
Posts: 722
Location: Belgium

PostPosted: Tue May 06, 2008 8:03 pm    Post subject: Reply with quote

Well, my gateway connect to the web through a pppoe connection (aDSL connection though ? ) to another gateway.

I'm trying to connect from outside with the same kind of connection (well, through a gateway but I don't have the details, since it's my job place's network ;) )

Maxime
_________________
Future is wide open.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue May 06, 2008 8:39 pm    Post subject: Reply with quote

MaximeG,

Its quite likely that your employer or ISP or both block port 22.
A good port to use is port 443 as thats normally https:// and firewalls expect to see encrypted traffic there.
This does mean that you cannot run a https:// server at home.
_________________
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
OmSai
l33t
l33t


Joined: 30 Sep 2007
Posts: 603
Location: Manchester, CT, USA

PostPosted: Wed May 07, 2008 12:48 am    Post subject: Reply with quote

NeddySeagoon wrote:
Its quite likely that your employer or ISP or both block port 22.
A good port to use is port 443 as thats normally https:// and firewalls expect to see encrypted traffic there.
This does mean that you cannot run a https:// server at home.
Oh God, yes!!

I've been looking for a way to emerge --sync to complete my Gentoo install at work, but haven't been able to find a usable port.
ssh + tunnel = rsync

Thanks, Neddy!
_________________
Gentoo is the stick-shift of Linux.
You work it manually, it has somewhat better performance, but it's really for the fun of it.
Back to top
View user's profile Send private message
MaximeG
l33t
l33t


Joined: 15 Apr 2008
Posts: 722
Location: Belgium

PostPosted: Fri Jun 06, 2008 1:33 pm    Post subject: Reply with quote

Well,

Thanks for your answers, but my old routeur seemed to be bad configured somehow (strange because it used to work).

Indeed, I've tried to create a route to my server with a new router device and it has worked without any problem this time.

Regards,
Maxime
_________________
Future is wide open.
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