Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

login and bash

Status
Not open for further replies.

cmancre

Programmer
Jan 30, 2005
35
0
0
PT

is there a way in bash to validate a login like
$/ comand --login=user --pass=yeahright
 
If you want to execute a command under a different login, you can use sudo to do so. For instance, if you have the following line in your /etc/sudoers:

Code:
myuser ALL=(user) ls /secret NOPASSWD: /usr/bin/make install

then, you can execute the following lines:
Code:
$ sudo -u user ls /secret
Password: .......
# Contents of /secret shown
$ sudo -u user make install
# Make install runs
$ echo password | sudo -S -u user ls /secret
# Contents of /secret shown without password prompt

: Daniel :

-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top