LinuxQuestions.org
Help answer threads with 0 replies.
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 01-07-2010, 03:05 PM   #1
apphex8
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Rep: Reputation: 0
Allow only one AD group to use ssh


We have a linux(SUSE 10) server that authenticates against AD(Windows 2003). Problem is anyone with an AD account can ssh in to the server. We don't want anyone to be able to login via ssh only the users in one particular group.

I have tried editing the sshd_config file and adding the group to AllowGroups but this doesn't work. I have searched google and have not had much luck in finding anything.

Please help.
 
Old 01-07-2010, 04:31 PM   #2
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
I use AllowUsers <my_username>, seem to work great, i thought AllowGroups shall work the same way.
did you restart sshd? try to start it in verbose mode and check the outputs when you connect: why would it allow to login.
 
Old 01-07-2010, 04:34 PM   #3
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
Quote:
Originally Posted by apphex8 View Post
We have a linux(SUSE 10) server that authenticates against AD(Windows 2003).
Thats cool, how did you do that?
 
Old 01-07-2010, 10:39 PM   #4
apphex8
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Web31337 View Post
I use AllowUsers <my_username>, seem to work great, i thought AllowGroups shall work the same way.
did you restart sshd? try to start it in verbose mode and check the outputs when you connect: why would it allow to login.
did you put your domain\\username or just your username? yes i restarted the sshd after each change i made to the sshd_config file.
 
Old 01-08-2010, 02:04 AM   #5
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
manual for AllowUsers says:
Quote:
This keyword can be followed by a list of user name patterns, separated by spaces.
Why would i possibly want a domain name(in a weird form) there?
In this context i only have AllowUsers <my_username> and it only allows my account to login, all others get permission denied, as expected.
Please, pastebin your sshd_config and try running sshd in verbose mode and then try connecting it and copy that outputs also.
 
Old 01-08-2010, 08:03 AM   #6
apphex8
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Web31337 View Post
manual for AllowUsers says:

Why would i possibly want a domain name(in a weird form) there?
Because i tried everything else.
Quote:
In this context i only have AllowUsers <my_username> and it only allows my account to login, all others get permission denied, as expected.
Please, pastebin your sshd_config and try running sshd in verbose mode and then try connecting it and copy that outputs also.
Below is a snippet of my sshd_config

Code:
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
UsePAM yes

AllowUsers da_xxxxxxxxx

#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
da_xxxxxxxx is my domain username. i also tried domain\\da_xxxxxx , domain\da_xxxxxxx, domain+da_xxxxxxxx
 
Old 01-08-2010, 04:12 PM   #7
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
and that still allows other users to log in?
you didn't post your entire config, do you have some other rules there(allowgroup,denygroup,denyusers)?
did you try running sshd in verbose(-v) mode and see why is that happening?
 
Old 01-09-2010, 11:04 AM   #8
apphex8
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Web31337 View Post
and that still allows other users to log in?
you didn't post your entire config, do you have some other rules there(allowgroup,denygroup,denyusers)?
did you try running sshd in verbose(-v) mode and see why is that happening?
No it doesn't allow anyone in.

I don't have any other deny or allow statements

If I look at var/log/messages it just says illegal user.
 
Old 01-09-2010, 05:43 PM   #9
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
weird.
well, this is my config, it only allows my username in: http://codepad.org/Mg9kGXsp
hope this helps.
here, when i try to log in as 'nonadm', it fails and writes this kind of stuff into /var/log/auth.log (deb):
Code:
Jan 10 04:31:36 srvr sshd[14355]: User nonadm from 94.41.*.* not allowed because not listed in AllowUsers
Jan 10 04:31:36 srvr sshd[14355]: Failed none for invalid user nonadm from 94.41.*.* port 14578 ssh2
 
  


Reply

Tags
ssh



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
SSH - cannot find name for group ID 1010 tannor Linux - Server 4 08-18-2009 08:45 AM
SSH access problems: Can only allow users SSH access by adding to root group dhupke Slackware 10 12-21-2008 09:48 AM
new user and group ssh Longinus Linux - Newbie 3 07-11-2004 02:21 AM
Can't SSH to server unless in root group PC Rob Linux - Software 10 03-24-2004 01:21 PM
Can't SSH unless in root group PC Rob Mandriva 2 03-23-2004 03:49 PM

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

All times are GMT -5. The time now is 08:12 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