• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

How to put su credentials in a script

Could someone please port an example of how to put su credentials in a script

ex: su - mqm (how do I define a password)
Los Angeles1
Los Angeles1
1 Solution
Seth SimmonsSr. Systems AdministratorCommented:
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>
See post.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

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