Solved

How to put su credentials in a script

Posted on 2013-11-19
2
179 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
Comment Utility
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
Comment Utility
See post.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

9 Experts available now in Live!

Get 1:1 Help Now