Quantcast
Channel: How to su non-interactively? - Server Fault
Browsing latest articles
Browse All 3 View Live

Answer by John Mahowald for How to su non-interactively?

Several ways to become another user. su only works without a password if you are already root. Trying to provide a password to it on the command line is a bad idea, it will expose the credential. Don't...

View Article


Answer by tonioc for How to su non-interactively?

You could either use the echo : echo <otherpwd> | su - otheruser -c "my command line" or expect: expect -c 'spawn su - otheruser -c "my command line"; expect "Password :"; send...

View Article


How to su non-interactively?

I want to do something like this to non-interactively switch user: su otheruser -p <password> But this obviously doens't work... what will?

View Article
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>