Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

RHEL, scripting an su

Posted on 2012-03-16
2
Medium Priority
?
209 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 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month10 days, 9 hours left to enroll

886 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