LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-01-2001, 02:08 PM   #1
360
Member
 
Registered: Jun 2001
Distribution: FC4
Posts: 136

Rep: Reputation: 15
Question What is the best way to restrict ssh access for RH7


RH7.1
What is the best and easiest way to restrict ssh access to my box to just a handful of ip addresses?

With RH6.2 I just edited the hosts.allow and deny files and it worked but it doesn't work with 7.1.

I am very new at this. Please be very explicit with your answers.

Thanks-a-million!

360
 
Old 12-01-2001, 06:28 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Well, the older versions SSH-1.2x allowed for the practical "AllowHosts" directive in /etc/ssh/sshd_config, but the newer OpenSSH in 7.1 don't anymore. Spose they compiled it with TCP Wrappers (libwrap) so you should be able to use /etc/hosts.(deny,allow).
Now if you suspect it isnt set up with wrappers just compile your own --with-tcp-wrappers, IIRC.

You can also add allowed IP's to iptables/ipchains for that extra edge :-].
What I do is add a file with a single IP per line, then add a bi-directional rule in the script, like:
for host in $(/bin/cat /etc/hosts.ssh); do <rule, args> $host; done
Keeps the script clean, and all allowed IP's easily accessable.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
restrict/allow ssh users mike30188 Linux - Security 2 06-20-2005 08:37 PM
Restrict X server access using /etc/security/access.conf anand_kt Linux - General 0 04-22-2005 08:40 AM
Restrict ssh/sftp with chroot? Chowroc Linux - Networking 4 01-25-2005 10:48 AM
How do I restrict ssh access to certain ip addresses? 360 Linux - Networking 5 04-05-2002 08:04 AM
Difference in SSH between RH7.0 and RH7.2 rogerb56 Linux - Networking 1 02-08-2002 01:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration