shell script how to switch users?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,
i am not sure if this is the right mailing list for asking this question. I would appreciate any help on this.

I want to switch users using a shell script, i.e.
Say i am logged in as user1. I would like to say su - user2 in my script.
I would be performing some operations as user "user2" as part of the script after logging in as this user.
Finally i will be exiting back to user1 shell.

How will i login as user2 through shell script?
How will i  execute scripts as user2 after logging in from shell script? Even if i am able to login as user2
any commands after "su - user2" are not executed as user2. They are executed only as user1 when i exit the
user2 shell.

--
Regards,
Rajiv

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux