DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-10-30 21:20:32

andyss
Member
Registered: 2008-10-30
Posts: 9

Change SSH port

Does anyone know how to change the default port of SSHD to another one, say 80 or 443?  I have tried enabling the setting in sshd_config but it doesn't seem to work for me.  Any ideas?

Last edited by andyss (2008-10-30 21:21:08)

Offline

 

#2 2008-10-30 22:17:07

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Change SSH port

OpenSSH_5.1p1, OpenSSL 0.9.8h 28 May 2008
usage: sshd [-46DdeiqTt] [-b bits] [-C connection_spec] [-f config_file]
            [-g login_grace_time] [-h host_key_file] [-k key_gen_time]
            [-o option] [-p port] [-u len]

You can add a '-p 443' to the commandline

Offline

 

#3 2008-10-30 22:24:42

andyss
Member
Registered: 2008-10-30
Posts: 9

Re: Change SSH port

Thanks for the reply.  How would you add this to ffp0.5 so that when it autostarts it will add the -p function?

Last edited by andyss (2008-10-30 22:25:02)

Offline

 

#4 2008-10-30 22:42:26

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Change SSH port

in /ffp/start/sshd.sh change the line
sshd_flags=
in
sshd_flags="-p 443"

Offline

 

#5 2008-10-31 15:17:43

andyss
Member
Registered: 2008-10-30
Posts: 9

Re: Change SSH port

Okay I've tried both ways:

- from the command line by stopping sshd and then starting it back up with the -p 443 argument
- by adding sshd_flags="-p 443" to /ffp/start/sshd.sh

When I try to connect locally through Putty (192.168.1.100:443) I get "Server unexpectedly closed network connection".

Any ideas Mijzelf or anybody else?

Offline

 

#6 2008-10-31 16:26:01

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Change SSH port

With 'netstat -lp | grep sshd' (run as root) you can see at which port sshd is actually listening.

Offline

 

#7 2008-10-31 17:19:41

puterboy
Member
Registered: 2008-09-18
Posts: 306

Re: Change SSH port

and just to be pedantic, you could also change the port via: /ffp/ssh/sshd_config
By uncommenting and changing:
#Port 22
Then the new port will become the 'default' port without need for flags to override it.

Offline

 

#8 2008-10-31 17:22:55

andyss
Member
Registered: 2008-10-30
Posts: 9

Re: Change SSH port

Tried that and get the same error message as above.  Will try to see what port sshd is listening on tonight when I get home.  Thanks dudes.

puterboy wrote:

and just to be pedantic, you could also change the port via: /ffp/ssh/sshd_config
By uncommenting and changing:
#Port 22
Then the new port will become the 'default' port without need for flags to override it.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB