LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-04-2002, 05:31 PM   #1
360
Member
 
Registered: Jun 2001
Distribution: FC4
Posts: 136

Rep: Reputation: 15
Question How do I restrict ssh access to certain ip addresses?


Running RH7.1

I need to restrict ssh access to certain ip address for security.

I was able to do this with hosts.deny and host.allow files but xinetd is different.

What is the easiest way?

Please be very explicit.

Thanks

Last edited by 360; 04-04-2002 at 07:37 PM.
 
Old 04-04-2002, 06:03 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you can use the AllowUsers line to only allow connectiosn from user@host check the sshd man page for details on it
 
Old 04-04-2002, 07:36 PM   #3
360
Member
 
Registered: Jun 2001
Distribution: FC4
Posts: 136

Original Poster
Rep: Reputation: 15
Check man ssh.
Did not find an pattern matching AllowUser.

I need this to be ip addresses based.

Thanks
 
Old 04-05-2002, 01:55 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
I've got xinetd running and I still use the hosts.allow and hosts.deny files. I think I compiled xinetd with tcp_wrappers support though. I'm not sure if your distribution also compiled it like that.
Well the way to do it in with xinetd is to add a line like this for the service you want to restrict:

only_from = 192.168.77.88

or if you want everything except a some specific hosts then you would add a line like:

no_access = 192.168.77.55 192.168.77.66

Try running 'man xinetd.conf' for some more information.
 
Old 04-05-2002, 05:27 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally posted by 360
Check man ssh.
Did not find an pattern matching AllowUser.

I need this to be ip addresses based.

Thanks
i said sshd not ssh

Quote:
AllowUsers
This keyword can be followed by a list of user name patterns,
separated by spaces. If specified, login is allowed only for
users names that match one of the patterns. `*' and `'? can be
used as wildcards in the patterns. Only user names are valid; a
numerical user ID is not recognized. By default, login is
allowed for all users. If the pattern takes the form USER@HOST
then USER and HOST are separately checked, restricting logins to
particular users from particular hosts.
 
Old 04-05-2002, 08:04 AM   #6
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,600

Rep: Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083
If you are using OpenSSH you can add --with-tcp-wrappers to your configure line. You can then use hosts.deny and hosts.allow.

--jeremy
 
  


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
How to restrict the ssh operation for one user fidelis Linux - Security 2 09-13-2004 02:37 AM
Restrict users logging in by SSH tolindsey Linux - Security 4 08-12-2004 04:17 PM
What is the best way to restrict ssh access for RH7 360 Linux - Security 1 12-01-2001 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:50 PM.

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