Unix Shell - how to change userid inside a shell script ?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > April 2004 > how to change userid inside a shell script ?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author how to change userid inside a shell script ?
fabien

2004-04-23, 4:34 am

the command 'su - userid' followed by password will allow me to change
user id to someone else. I am running a shell script ksh and I want to
change to a different user before I kick off another program call within
the script.

su doesn't allow me to do it without prompting for the password.

any suggestions on how I can change user id's without having to provide
input for the password?

thanks
Peter Boosten

2004-04-23, 4:34 am

on Fri, 23 Apr 2004 at 08:20 GMT, fabien wrote:
> the command 'su - userid' followed by password will allow me to change
> user id to someone else. I am running a shell script ksh and I want to
> change to a different user before I kick off another program call within
> the script.
>
> su doesn't allow me to do it without prompting for the password.
>
> any suggestions on how I can change user id's without having to provide
> input for the password?
>


sudo

Regards, Peter
--
This novel is not to be tossed lightly aside, but to be hurled with
great force.
-- Dorothy Parker

MSN/Mail: pboosten at hotmail dot com
Michael Heiming

2004-04-23, 10:36 am

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

fabien <fabien.duthu@orange.fr> wrote:
> the command 'su - userid' followed by password will allow me to change
> user id to someone else. I am running a shell script ksh and I want to
> change to a different user before I kick off another program call within
> the script.


> su doesn't allow me to do it without prompting for the password.


It does, if your UID is 0.;)

> any suggestions on how I can change user id's without having to provide
> input for the password?


$ man -k sudo
sudo (8) - execute a command as another user
sudoers (5) - list of which users may execute what
visudo (8) - edit the sudoers file

Good luck

--
Michael Heiming (GPG-Key ID: 0xEDD27B94)

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of spam.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAiSNUAkPEju3Se5QRAsWbAKDWSYzZ6Tc6
rBc7GQBmzgIEl2i/AACggTxg
2fZofjiQprY5Jhb+q2wsavQ=
=Gozq
-----END PGP SIGNATURE-----
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com