LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-27-2002, 08:41 PM   #1
stevealarsen
LQ Newbie
 
Registered: Aug 2002
Posts: 4

Rep: Reputation: 0
Limiting SSH access


How do I limit SSH login access when by default all valid users can login thru SSH? Thanks. Steve.
 
Old 09-28-2002, 07:24 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,561
Blog Entries: 54

Rep: Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927
Hosts: if you're using an sshd that has been compiled with libwrap support (TCP wrappers) you can add addressess or ranges to allow/deny in /etc/hosts.{deny,allow}. Unfortunately the new sshd conf's don't allow specifying ranges in the config file itself anymore.
You can also add ranges/hosts to your firewall script to allow/deny access from/to.
Users: in sshd_config you can add directives format {Allow,Deny}{Groups,Users}.
If you've got a PAM enabled distro you can also add the next line in /etc/pam.d/sshd under the last "auth" statement:
"auth required /lib/security/pam_listfile.so item=user sense=allow file=/etc/pam.allow.sshd onerr=fail"
edit the file /etc/pam.allow.sshd and add all user you want to grant ssh access to.

On a side note, please try searching the forum first, try to make clear what you've tried to do to make it work, or if it's about errors, please always post them.

HTH
 
Old 09-28-2002, 09:18 PM   #3
stevealarsen
LQ Newbie
 
Registered: Aug 2002
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for your help. Placing the following line in /etc/ssh/sshd_config allows ssh login only for the user larsen.

AllowUsers larsen
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 03:09 PM
Limiting SSH connectivity kaplan71 Linux - Networking 2 06-14-2005 09:35 AM
limiting ssh connection blackzone Linux - Networking 7 07-21-2004 07:22 AM
limiting ssh sessions for a given user breenbaron Linux - Security 2 03-16-2004 11:20 AM
limiting users who can gain ftp or ssh access bluefmc427 Linux - Security 1 07-03-2003 05:17 AM


All times are GMT -5. The time now is 06:30 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration