First, the root permission vi/etc/ssh/sshd_config modify the SSH configuration
Port 8833 * Note that changes will not take effect after the change, modify the Iptables firewall port number has been otherwise cause the port number is blocked and cannot telnet *
Protocol 2
Serverkeybits 1024
Syslogfacility Authpriv
LogLevel INFO
Strictmodes Yes
Maxauthtries 3
#MaxSessions 10
Rsaauthentication No
Pubkeyauthentication Yes
Authorizedkeysfile. Ssh/authorized_keys
Permitemptypasswords No
Challengeresponseauthentication No
Gssapiauthentication No
Gssapicleanupcredentials Yes
#-!remmber Config!-------------------------
#no Safe-------* Before establishing a new user, enable no safe to set up a new user, then close no safe to enable the following safe items *
#PasswordAuthentication Yes
#UsePAM Yes
#--------------
#safe----------
Passwordauthentication No
Usepam No
Permitrootlogin No
#--------------
#------------------------------------------
Acceptenv LANG lc_ctype lc_numeric lc_time lc_collate lc_monetary lc_messages
Acceptenv lc_paper lc_name lc_address lc_telephone lc_measurement
Acceptenv lc_identification Lc_all LANGUAGE
Acceptenv xmodifiers
x11forwarding Yes
PRINTMOTD Yes
Printlastlog No
KeepAlive Yes
Useprivilegeseparation Yes
#PermitUserEnvironment No
Compression Yes
Usedns No
#PidFile/var/run/sshd.pid
Maxstartups 5
#ChrootDirectory None
#Banner None
# Override default of No subsystems
#Subsystem Sftp/usr/libexec/openssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User Anoncvs
# x11forwarding No
# allowtcpforwarding No
# forcecommand CVS Server
: Wq Save Exit
Second, modify the firewall iptables port
Vi/etc/sysconfig/iptales
#-a input-m State--state new-m tcp-p TCP--dport 22-j ACCEPT * Unregister original 22 Port *
-A input-m state--state new-m tcp-p TCP--dport 8833-j ACCEPT * New and enable 8833 ports enabled *
#复制原22端口行再粘贴到下一行方法 Press the ECS key into command mode to move the cursor to the line that needs to be copied "Nyy" key to copy the current line and press "P" key to paste #
: Wq Save Exit
Third, restart the SSH and iptables services
/etc/init.d/sshd_config restart
/etc/init.d/iptables restart
Linux post-installation sshd configuration and firewall port configuration