Page 1 of 1

Changing port 22 still not working after editing sshd

PostPosted: Fri Oct 09, 2015 5:08 pm
by chicagoinbound
Hi everyone,

I tried changing the port no. to 3133 on the sshd and restarted sshd. Also added on the iptables (restarted the server-added iptable) however I still can't access that port and only port 22.

]# netstat -nltp | grep sshd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LIST EN 4344/sshd
tcp 0 0 :::22 :::* LIST


Firewall

-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 3133 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT


# iptables -L
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:prism-deploy <--3133 edited in sshd
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh <---original port 22


Any thoughts on this? Thanks!

Goutodial 2.1
single server
quadcore 4 gig mem
VERSION: 2.4-309a
BUILD: 110430-1642

Re: Changing port 22 still not working after editing sshd

PostPosted: Fri Oct 16, 2015 2:46 pm
by louis_sgc
Please post your sshd_config file here so we can see the configuration.

Re: Changing port 22 still not working after editing sshd

PostPosted: Sat Oct 17, 2015 8:49 am
by chicagoinbound
Here it is.

# $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.

#Port 3113
#Protocol 2,1
Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

Re: Changing port 22 still not working after editing sshd

PostPosted: Sun Nov 01, 2015 3:51 am
by gardo
Looks like you forgot to uncomment the port number entry.

Code: Select all
#Port 3113


Should be:

Code: Select all
Port 3113


Restart SSHD after making the changes.