Solved

How to put su credentials in a script

Posted on 2013-11-19
2
180 Views
Last Modified: 2013-11-26
Could someone please port an example of how to put su credentials in a script

ex: su - mqm (how do I define a password)
0
Comment
Question by:Los Angeles1
2 Comments
 
LVL 34

Accepted Solution

by:
Seth Simmons earned 500 total points
ID: 39660975
for security reasons, you can't do that

what you can do is define in sudoers that user running that command without prompting for a password

<your username> ALL=(ALL) NOPASSWD: <command>
0
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39663602
See post.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

932 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

18 Experts available now in Live!

Get 1:1 Help Now