Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

RHEL, scripting an su

When I write a script, and in the script I do a

su - user

Open in new window


None of the other commands in the script are executed.

How do I get the other commands to be executed
0
Los Angeles1
Asked:
Los Angeles1
1 Solution
 
TintinCommented:
Assuming you are doing this as root:

su - user -c "command"

Open in new window


otherwise use sudo.
0
 
omarfaridCommented:
can you show your script?
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now