Quantcast
Channel: How to su non-interactively? - Server Fault
Browsing all 3 articles
Browse latest 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 all 3 articles
Browse latest View live




Latest Images