In this post, i will show on how to allow and deny access for Remote SSH to CentOS server. This post will configure SSH access as follows:
Please note that all systems in that domain are in the 192.168.1.0/255.255.255.0
- Only howtolinux247 and root has remote SSH access to the machine within howtolinux247.local
1. Modify ssh_config as below :
[root@centos64 ~]# vi /etc/ssh/sshd_config AllowUsers howtolinux247 root2. Make sshd auto start on boot and restart sshd service :
[root@centos64 ~]# chkconfig sshd on [root@centos64 ~]# /etc/init.d/sshd restart3. Open iptables configuration as below :
[root@centos64 ~]# vi /etc/sysconfig/iptables4. Append this line on your iptables setting :
-A INPUT -s 192.168.1.0/24 -p tcp --dport 22 -j REJECT5. Restart the iptables :
[root@centos64 ~]# /etc/init.d/iptables restart
0 comments:
Post a Comment