Piglet 写道: |
|
狗一下就有结果了吧,sshd_conf
|
open the /etc/ssh/sshd_conf file by typing: vi /etc/ssh/sshd_config
发帖的时候已经改了这个,只有一半用, 如果 SELINUX 被核心禁止,
semanage port -a -t ssh_port_t -p tcp 9999
还是会出错。
ValueError: SELinux policy is not managed or store cannot be accessed.
当然, yum -y install policycoreutils-python 已经执行安装了。
也许还有一个列表需要改, 也就是 SELINUX 用来对照 SSHD 原始端口的表
cat /etc/services |grep ssh
ssh 22/tcp # The Secure Shell (SSH) Protocol
ssh 22/udp # The Secure Shell (SSH) Protocol
x11-ssh-offset 6010/tcp # SSH X11 forwarding offset
ssh 22/sctp # SSH
sshell 614/tcp # SSLshell
sshell 614/udp # SSLshell
netconf-ssh 830/tcp # NETCONF over SSH
netconf-ssh 830/udp # NETCONF over SSH
sdo-ssh 3897/tcp # Simple Distributed Objects over SSH
sdo-ssh 3897/udp # Simple Distributed Objects over SSH
snmpssh 5161/tcp # SNMP over SSH Transport Model
snmpssh-trap 5162/tcp # SNMP Notification over SSH Transport Model
tl1-ssh 6252/tcp # TL1 over SSH
tl1-ssh 6252/udp # TL1 over SSH
ssh-mgmt 17235/tcp # SSH Tectia Manager
ssh-mgmt 17235/udp # SSH Tectia Manager
semanage port -l | grep ssh
The output should now look like this:
ssh_port_t tcp 9999,22
怎样从根本改变 SSH 的端口使得
semanage port -l | grep ssh
只显示
ssh_port_t tcp 9999
呢?
也就是系统默认 SSH 是 9999 而不是 22,
也许应该想办法更新核心?