Solved

RHEL, scripting an su

Posted on 2012-03-16
2
197 Views
Last Modified: 2012-03-16
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
Comment
Question by:Los Angeles1
2 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 37730861
Assuming you are doing this as root:

su - user -c "command"

Open in new window


otherwise use sudo.
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 37731124
can you show your script?
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now