The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
switching user from root to ordinary user
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
switching user from root to ordinary user
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
01-25-2008
RTM
Hog Hunter
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
If $cmd is where you are running the command as root, change it to
su - sasia -c "$cmd"
Test it to see if it is what you need and read the man page on su command.
RTM
View Public Profile
Find all posts by RTM