Breaking News
Loading...
Wednesday, July 24, 2013

How to Allow and Deny Access for Remote SSH to CentOS 6.4

3:40 PM

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 root
2. Make sshd auto start on boot and restart sshd service :
[root@centos64 ~]# chkconfig sshd on
[root@centos64 ~]# /etc/init.d/sshd restart
3. Open iptables configuration as below :
[root@centos64 ~]# vi /etc/sysconfig/iptables
4. Append this line on your iptables setting :
-A INPUT -s 192.168.1.0/24 -p tcp --dport 22 -j REJECT
5. Restart the iptables :
[root@centos64 ~]# /etc/init.d/iptables restart

0 comments:

Post a Comment

 
Toggle Footer