selinux��
��װ semanage
#sudo yum -y install policycoreutils-python
ʹ����������鿴��ǰSElinux ������ssh�˿ڣ�
# sudo semanage port -l | grep ssh
����20000�˿ڵ� SELinux
# sudo semanage port -a -t ssh_port_t -p tcp 12345
Ȼ��ȷ��һ���Ƿ����ӽ�ȥ
# sudo semanage port -l | grep ssh
����ɹ������
ssh_port_t tcp 12345, 22
sshd_config
ssh�������ļ�λ��/etc/ssh/sshd_config
�Ƽ����ã�
ʹsshd���������ڷDZ��˿������÷������༭/etc/ssh/sshd_config�ļ�������һ������Ϊ(�ٶ����ü����˿���12345)��port 12345
�ڿͻ��ˣ���ssh <server addr> -p 12345��¼��������
ֻ����ssh v2������protocol 2
��ֹroot�û�ͨ��ssh��¼PermitRootLogin no
��ֹ�û�ʹ�ÿ������¼PermitEmptyPasswords no
���Ƶ�¼ʧ�ܺ�����Դ���MaxAuthTries 3
ֻ�������б���ָ�����û���¼AllowUsers user1 user2
���������ļ�
#sudo sshd -t
ȷ�������ļ���ȷ��
�رշ���ǽ��
# sudo service iptables stop
����sshd
#sudo service sshd restart
�鿴�Ƿ�ɹ������¶˿�
# sudo netstat -lnetp | grep sshd
��iptables����
#ssh
-A INPUT -m state --state NEW -m tcp -p tcp --dport 12345 -j ACCEPT
��������ǽ
# sudo service iptables start
ע�������Ϸ�����ʱ��һ��Ҫ���ֵ�ǰssh�ͻ��˵�½״̬��ssh������restartʱ�������������ǰ�ͻ����DZ��������ӵģ����ssh restartʱ�����ֹرյ�ǰ��½��ssh�ͻ��ˣ���ֻ��ȥ�����ˣ�
selinux ssh�˿��ģ�sshd_config �ļ����õĶ˿ںţ�����ǽ���õĶ˿ں�һ��Ҫ����ȷ�ϡ�
ʹ��һ�������뱾ͨ��SSH��ȫ��¼Linux��//m.ajphoenix.com/linux/12294.html
��ǿSSH��ȫ�Ե�7�����ɣ�//m.ajphoenix.com/linux/7106.html
Linux SSH��ȫ�Զ���½ʵ�֣�//m.ajphoenix.com/linux/4511.html