Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-12-2012, 09:41 AM
|
#1
|
|
Member
Registered: Jun 2007
Posts: 49
Rep:
|
su not giving proper message for restricted LDAP groups
Hello,
I have configured PAM authentication on linux box to restrict particular group only to login.
I have enabled pam and ldap through authconfig and modified access.conf like below,
Code:
[root@test root]# tail -1 /etc/security/access.conf
- : ALL EXCEPT root test-auth : ALL
Also modified sudoers file, to get su for this group
Code:
[root@test ~]# tail -1 /etc/sudoers
%test-auth ALL=/bin/su
Now, only this ldap group members can login to system.
However when from any of this authorised user, I tried for su, it asks for password and then though I enter correct passwoord it gives message like Incorrect password and login failed.
/var/log/secure shows that user is not having permission to get the access, but then it should print message like Access denied.The way it prints for console login.
My functionality is working but its no giveing proper messages.Could anyone please help on this.
My /etc/pam.d/su file,
Code:
[root@test root]# cat /etc/pam.d/su
#%PAM-1.0
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required pam_wheel.so use_uid
auth include system-auth
account sufficient pam_succeed_if.so uid = 0 use_uid quiet
account include system-auth
password include system-auth
session include system-auth
session optional pam_xauth.so
Last edited by skimeer; 10-12-2012 at 02:06 PM.
|
|
|
|
10-13-2012, 02:43 AM
|
#2
|
|
Member
Registered: Apr 2012
Posts: 131
Rep: 
|
Dear I am new to LDAP can please let me know easy way to configure LDAP
|
|
|
|
10-13-2012, 01:41 PM
|
#3
|
|
Member
Registered: Jun 2007
Posts: 49
Original Poster
Rep:
|
|
|
|
|
10-15-2012, 05:36 AM
|
#4
|
|
Member
Registered: Jun 2007
Posts: 49
Original Poster
Rep:
|
Does anyone has solution for my actual question
|
|
|
|
10-15-2012, 07:45 PM
|
#5
|
|
LQ Newbie
Registered: Aug 2007
Posts: 11
Rep:
|
Hey Skimeer,
Several different pieces are in play here. Being that you can at least login using an LDAP account, I'd venture a guess that the LDAP server is at least configured correctly. We'll also need to see your system-auth file to see what it's doing. Then it may be off to other places as well.
One thing you might want to do is restart the LDAP server from the command line in debug mode and watch what happens when you run the su command. that will probably provide the most information. You might start with -1 (produces a LOT of output) and back off from there. Sometimes 256 is a good value as well, as it only displays operations and not much else.
Hope this helps,
-Matt
Matthew Hardin
Symas - The LDAP Guys
http://www.symas.com
|
|
|
|
10-15-2012, 10:25 PM
|
#6
|
|
Member
Registered: Jun 2007
Posts: 49
Original Poster
Rep:
|
Hey Matt,
I will test with restarting LDAP service. Meanwhile this is my system-auth
Code:
[root@test ~]# cat /etc/pam.d/system-auth
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth sufficient pam_ldap.so use_first_pass
auth required pam_deny.so
account required pam_unix.so broken_shadow
account sufficient pam_succeed_if.so uid < 500 quiet
account [default=bad success=ok user_unknown=ignore] pam_ldap.so
account required pam_permit.so
password requisite pam_cracklib.so try_first_pass retry=3
password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok
password sufficient pam_ldap.so use_authtok
password required pam_deny.so
session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so
session optional pam_ldap.so
|
|
|
|
10-15-2012, 11:01 PM
|
#7
|
|
LQ Newbie
Registered: Aug 2007
Posts: 11
Rep:
|
Hi Skimeer,
I don't see anything the matter there, but get your database cleaned up (see my reply to your group lookup problem) and then see what works and what doesn't.
Cheers,
-Matt
Matthew Hardin
Symas - The LDAP Guys
http://www.symas.com
Last edited by Matthew Hardin; 10-15-2012 at 11:02 PM.
Reason: Fix vague language
|
|
|
|
10-16-2012, 12:27 AM
|
#8
|
|
Member
Registered: Jun 2007
Posts: 49
Original Poster
Rep:
|
Hi Matt,
Backup/Restore did not resolve this issue.
what I have observed that,when I tried to su for unauthorized users. It gives access denied message in /var/log/secure
Code:
Oct 16 06:50:12 localhost su: pam_access(su:account): access denied for user `kalpana' from `pts/4'
Oct 16 06:50:47 localhost su: pam_access(su:account): access denied for user `kalpana' from `pts/4'
However, I guess this should be printed just when I try for su with user kalpana.
Is there any way to handle messages before login for LDAP users through PAM files
|
|
|
|
10-16-2012, 02:21 PM
|
#9
|
|
LQ Newbie
Registered: Aug 2007
Posts: 11
Rep:
|
Hmm. It was late last night and I was thinking sudo, not su.
The su command works like this: If you type the target user's password, then su will authorize you for that id and either run the command you specified after -c or present you with a shell prompt. If you don't know the password, then it simply says "Sorry" and returns you to your original shall prompt. You'll also see a message in the log like the one you showed above.
The apparent exceptions in /etc/pam.d/su, but commented out in your example, are for members of group "wheel". One will implicitly trust members of that group, and the other will require that a user be a member of that group in order to succeed, even if the correct password is entered. Since they are commented out, neither of those cases will apply.
Is su behaving this way for both local and LDAP users? (maybe show the output so we can understand better if this is not the case)
Cheers,
-Matt
Matthew Hardin
Symas - The LDAP Guys
http://www.symas.com
|
|
|
|
10-17-2012, 07:02 AM
|
#10
|
|
Member
Registered: Jun 2007
Posts: 49
Original Poster
Rep:
|
Hi Matt,
Now I have added local user named tester. Now this user is also denied access, using PAM configuration as above.
Code:
[skimeer@test root]$ su tester
Password:
su: incorrect password
[skimeer@test root]$
Log (/var/log/secure) shows,
Code:
Oct 17 13:21:30 localhost useradd[32237]: new group: name=tester, GID=10126
Oct 17 13:21:30 localhost useradd[32237]: new user: name=tester, UID=10126, GID=10126, home=/home/tester, shell=/bin/bash
Oct 17 13:21:45 localhost passwd: pam_unix(passwd:chauthtok): password changed for tester
Oct 17 13:21:55 localhost su: pam_limits(su:session): unknown limit item 'nofiles'
Oct 17 13:21:55 localhost su: pam_limits(su:session): unknown limit item 'nofiles'
Oct 17 13:21:55 localhost su: pam_unix(su:session): session opened for user svaidya by root(uid=0)
Oct 17 13:22:04 localhost su: pam_access(su:account): access denied for user `tester' from `pts/3'
Hence there is no difference for LDAP users and Local users. I guess something we can play around su configuration to modify these messages. Mainly something for pam_access.
Last edited by skimeer; 10-17-2012 at 10:29 PM.
|
|
|
|
10-29-2012, 08:39 AM
|
#11
|
|
Member
Registered: Jun 2007
Posts: 49
Original Poster
Rep:
|
Any one has comment on this...I am still struggling to get this resolved.
|
|
|
|
11-05-2012, 11:23 PM
|
#12
|
|
Member
Registered: Jun 2007
Posts: 49
Original Poster
Rep:
|
I just checked with for single group only,In that case if I try for su. It gives proper message "like user must be member of x group"
Is there any restriction on using multiple groups.
|
|
|
|
12-14-2012, 08:19 AM
|
#13
|
|
Member
Registered: Jun 2007
Posts: 49
Original Poster
Rep:
|
Could anyone please help me out in this.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:15 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|