Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Unix&Linux>>Authenticating from command-line when "su user ..."

Authenticating from command-line when "su user ..."

elmimmo
04-08-2004, 05:07 AM
Is there a way to authenticate when doing "su username blah" in the same line as that command. Sort of like "su username -p passw blah" or "su username blah | whatever"?

As it works now you write "su username blah" and then the shell prompts for password authentication. i am trying to bypass that interruption so that when invoking a single line from the CLI, "blah" executes, no questions asked.

"sudo -u user -p passw" is not viable, since it is only usable to admins or users in the sudoers file.

acme.mail.order
04-09-2004, 11:34 PM
You can't do it with 'su'. Sudo will accept a password from stdin with the -S option. Regular users generally have no business running commands as another user so no one's written this massive security hole into the code, but you can always add them to the sudoers file if that's acceptabe in your environment and adjust sudoers so they can run a few commands without authentication. See the sudoers manual for details.

You can also explore the set-uid bit and, if it's a maintenance script, put it in the users crontab.


 

TOP

Windows Server Outsell
Unix Signals And C++ E

For more info

Unix Signals And C++ E
Windows Server Outsell
ssh setup for password
Bash script does not w
esc code 
ARD send unix command 
question about binarie
Scanning mail 
Issuing multiple comma
How do I install Linux

News Archive

/etc/hosts? 
Manually Start a Start
mounting missed hard d
Using Netinfo in Singl
darwin/bsd login probl
system_profiler and fi
Send mail from script 
mounting a drive 
OS X disk first aid ha
system.log shows steal

Related stories:

Scanning mail
Get a Tab Del File from ls output
Extracting CPIO archive
Unmounting
CpMac
Problems installing from source
.bashrc not being executed?

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics