0

Here is the problem: I use django pam to let django able to authenticate linux users but it can only be run as root. Is there any solutions to let normal user able to authenticate lunux users?

1
  • Can you provide more info (errors you get)? Using pam module I can authenticate any user... Commented May 11, 2013 at 11:00

1 Answer 1

1

This is a bit round about, but I imagine it would work.

Assuming a debian distro, you could try adding the specific command that you want to a script, then chmod/chown it to restrict access to root only.

chown root:root /path/to/script.sh chmod 755 /path/to/script.sh 

Next, run sudo visudo and add the following:

normalusername ALL = NOPASSWD: /home/usr/path/to/script.sh 

Reboot, write some code in python to execute your script as a normal user, and I imagine you'd be good to go.

Your python code would look like this:

import os os.system("sudo path/to/script.sh") 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.