[iyunv@localhost ~]# cp /usr/lib/firewalld/services/ssh.xml /etc/firewalld/services/
[iyunv@localhost ~]# vi /etc/firewalld/services/ssh.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>SSH</short>
<description>Secure Shell (SSH) is a protocol for logging into and executing commands on remote machines. It provides secure encrypted communications. If you plan on accessing your machine remotely via SSH over a firewalled interface, enable this option. You need the openssh-server package installed for this option to be useful.</description>
<port protocol="tcp" port="23456"/>
</service>
[iyunv@localhost ~]# firewall-cmd --complete-reload (中断连接加载)
[iyunv@localhost ~]# vi /etc/ssh/sshd_config
# $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm 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:/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 override the
# default value.
# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
Port 23456
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
[iyunv@localhost ~]# systemctl restart sshd
[iyunv@localhost ~]# systemctl status sshd
sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)
Active: active (running) since Mon 2015-08-31 17:47:22 CST; 25s ago
Main PID: 12302 (sshd)
CGroup: /system.slice/sshd.service
?..12302 /usr/sbin/sshd -D
Aug 31 17:47:22 localhost.localdomain systemd[1]: Started OpenSSH server daemon.
Aug 31 17:47:22 localhost.localdomain sshd[12302]: Server listening on 0.0.0.0 port 23456.
Aug 31 17:47:22 localhost.localdomain sshd[12302]: Server listening on :: port 23456.
Aug 31 17:47:23 localhost.localdomain python[12304]: SELinux is preventing /usr/sbin/sshd from name_bind access on the tcp_socket port 23456.
***** Plugin bind_ports (92.2 confidence) suggests ************************...
Hint: Some lines were ellipsized, use -l to show in full.
[iyunv@localhost ~]#