LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   su and pam (https://www.linuxquestions.org/questions/linux-security-4/su-and-pam-658726/)

G4tsu 07-28-2008 04:33 AM

su and pam
 
Hi all,
I need your help.
I need "su" to ask for password only when you are trying to NOT become root.

That means all can be root, but if you are tring to become another user (and precisely a user who belongs to a certain group) you need his password.

I know it can seem silly (once you are root you can do everything), just help me doing this, it's not a choise of mine.

I think I would need some sort of logic within the pam stack, I need to obtain su arguments in order to see what kind of user you are trying to become, and I really don't know how to do this.

Thanks very much to all of you that will help me.

billymayday 07-28-2008 04:59 AM

It's double stupid, since root doesn't need a password to su to any user, so you'll be able to su to root then su to any user without a password.

Even if you could set it up, hoe could you stop someone as root reversing any changes you'd made?

And yes, the basic idea is incredibly stupid too

G4tsu 07-28-2008 05:42 AM

Thx for your help and support, you was very useful. You confirmed its a stupid policy and your contribute was nothing.

I must repeat myself:
"I KNOW IT'S STUPID, JUST HELP ME DOING THIS", if you are able and kind enough.

By the way root does not need a passwd to su someone in the default settings, but I am sure you can edit the stack to ask a password even to root.

Of course root could just undo those changes, but pls, IGNORE THIS PROBLEM.

Thank you.

billymayday 07-28-2008 05:50 AM

Why? To waste my time too? Not likely

G4tsu 07-28-2008 07:01 AM

You are already wasting your time, and sounds incredibly stupid to post just to say "I don't want to waste my time posting".

Try to avoid threads you are not interested in.

KasMage 07-28-2008 08:33 AM

The purpose of this site is to help people with issues in Linux as much as possible. Even if somebody helps you to solve this problem, he or she really won't be helping you much at all. What you're attempting to do is completely paradoxical. You're essentially trying to create unlimited accounts with limited permissions. But what the hey; I'll throw an idea into the hat.

You could modify 'sudo' so as to only allow the 'su -l root' command to be run from it.

G4tsu 07-28-2008 08:57 AM

Thank you for the contribute.

At this point I want to give more explanations about the choice.

As I told, it's not mine, the owner of the system (a distributed system) wish so.

Here all users should be administrator (this guy see it from a Microsoft point of view) able to perform every operation on the system. They are trusted. Anyway only root can do some stuff, so all should be able to su root at will. This is easily done.

The owner anyway disklike the fact that any user now can impersonate anyone else... He knows that if anyone can be root anyone could do everything... But as a compromise he wishes this kind of solution.. he wants su command to works only towards root. I told him it's stupid, but for now, he wants his system to work this way, cause he is sure that users anyway will not try to edit system files.

I am not really interested about it, I need only to get su's arguments within pam stack, but I am not able.

If you know how to do it, thank you, if you know a better policy to allow ANYONE to do ANYWHAT except stealing identity you are welcome too.


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