Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a host with RHEL3U4, which come with OpenSSH_3.6.1p2. I would like to disable all root ssh except from one host. This is like an "admin" host where we run some ssh scripts to other hosts. Because of the application requirement, we can't upgrade the OS version nor upgrade/recompile OpenSSH. I've read up on TCP Wrapper but not sure that's included in the OpenSSH we have. Is that possible to do with that version of OpenSSH?
I suppose you have a not tweaked installation, regarding to /etc/hosts.allow and /etc/hosts.deny.
In this case, you can edit the /etc/hosts.deny to add:
Code:
sshd: ALL EXCEPT 192.168.160.32, 192.168.160.251
The above line will accept ssh conections only from that two hosts.
Post edit: I am not sure your version of openssh has support for tcpwrappers. Anyway, the file /etc/hosts.deny is from the package netcfg in Fedora 7.
Sorry to not read carefully your post in the first time.
I've read up on TCP Wrapper but not sure that's included in the OpenSSH we have.
You can use the ldd command to see if your SSH daemon binary is compiled with support for TCP Wrappers. For example, you can see that the SSH daemon on my Ubuntu box does have the support:
Hey toiday ! My previous post was incorrect about the tcpwrapper package name.
It is not netcfg. In Fedora 7 it is tcp_wrappers-libs.
netcfg is the package name on openSuSE.
If you don't want to fool with PAM you could also use the AllowUsers directive in sshd_config to do this:
e.g.:
AllowUsers root@adminhost bob frank joe
In this case root can only login from adminhost, but bob, frank, and joe can login from anywhere. The bad news is that any user who you want to be able to login via ssh has to be explicitly added to the AllowUsers string, so if you have a lot of users or are adding new users constantly the PAM procedure is probably the better way to go.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.