Main Page | Report this Page
Linux Forum Index  »  Linux Security  »  changing sshd port number...
Page 1 of 1    

changing sshd port number...

Author Message
p_a...
Posted: Sat Aug 15, 2009 6:41 am
Guest
OS: Fedora 10
I'm trying to change the sshd port number but the instructions I used
didn't work:
1. Temporarily disabled iptables through the GUI.
2. Changed the variable Port from sshd_config to something other than
the usual.
3. Gave the command "service sshd restart".
4. Was then unable to remotely connect with ssh.
--
Then, I rebooted, restored the Port variable and enabled the firewall.

Is there some other instruction? Is something else different? This
procedure worked
on RHEL 4. Would appreciate any suggestions.

thanks,
pete
 
Unruh...
Posted: Sat Aug 15, 2009 11:44 am
Guest
p_a <phpete48 at (no spam) gmail.com> writes:

Quote:
OS: Fedora 10
I'm trying to change the sshd port number but the instructions I used
didn't work:
1. Temporarily disabled iptables through the GUI.
2. Changed the variable Port from sshd_config to something other than
the usual.
3. Gave the command "service sshd restart".
4. Was then unable to remotely connect with ssh.

How did you try to remotely connect with ssh?

And are you sure that your iptables really is disabled and that your
router does not block the port.
And what did you change Port to-- why not show us the exact line that
you have in your config.

Quote:
--
Then, I rebooted, restored the Port variable and enabled the firewall.

Is there some other instruction? Is something else different? This
procedure worked
on RHEL 4. Would appreciate any suggestions.

thanks,
pete
 
Friedrich...
Posted: Sun Aug 16, 2009 1:21 am
Guest
p_a:
Quote:
OS: Fedora 10
I'm trying to change the sshd port number but the instructions I used
didn't work:
1. Temporarily disabled iptables through the GUI.
2. Changed the variable Port from sshd_config to something other than
the usual.
3. Gave the command "service sshd restart".
4. Was then unable to remotely connect with ssh.
--
Then, I rebooted, restored the Port variable and enabled the firewall.

Is there some other instruction? Is something else different? This
procedure worked
on RHEL 4. Would appreciate any suggestions.

thanks,
pete

Hi pete,

Quote:
1. Temporarily disabled iptables through the GUI.
Which GUI are you talking about? Afaik there is no 'THE GUI' for iptables.


$VARIABLE is the thing you have set

In /etc/ssh/sshd
#Port 22
Port $NEWPORT

run /etc/init.d/sshd_config restart
You will get a message if something is wrong.

First of all you should check if you can connect from the localhost.
Disable your firewall and try to connect to localhost

ssh $USER at (no spam) localhost -p $NEWPORT

if that is not working you can check if the service is running through
as root
netstat -tulpe
then you should get something like this:
tcp 0 0 [::]:ssh [::]:* LISTEN root 21873 23179/sshd


If you have set up iptables:

iptables --insert -I INPUT -p tcp -d 127.0.0.1 --destination-port
$NEWPORT -j ACCEPT

and delete the old rule
iptables --delete -D INPUT $RULENUMBER

You should set up a script that sets your iptables correctly as the
settings are only temporary (after restarting your system they will be
gone).

Regards Friedrich
 
p_a...
Posted: Fri Aug 21, 2009 4:37 am
Guest
I was able to change the port and ssh to localhost using the new port
number.
I had problems though with iptables. Running iptables -L lists no
rules. But
running the FC-10 Firewall Configuration Tool has ssh checked. Is
there a
procedure to change the firewall's sshd port using this Tool? If so,
could
someone send the detailed instructions or list a website where they
already are.
I made a few attempts at using the tool but none of them allowed the
service to be changed.

thx.,
pete.
 
C. (http://symcbean.blogspot.com/)...
Posted: Tue Aug 25, 2009 2:24 am
Guest
On Aug 21, 3:37 pm, p_a <phpet... at (no spam) gmail.com> wrote:
Quote:
I  was able to change the port and ssh to localhost using the new port
number.
I had problems though with iptables. Running iptables -L lists no
rules.  But
running the FC-10 Firewall Configuration Tool has ssh checked.  Is
there a
procedure to change the firewall's sshd port using this Tool?  If so,
could
someone send the detailed instructions or list a website where they
already are.
I made a few attempts at using the tool but none of them allowed the
service to be changed.

thx.,
pete.

You'll probably need to tell the firewall explicity what port the sshd
is now running on (it might pick up the port number from /etc/services
but I wouldn't count on it).

Make sure that sshd has started on the new port (netstat -nap)

C.
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Sun Nov 22, 2009 9:40 pm