I want to change the user in one command line with su
echo password | su user
But this is not working.
Is there a other possibility?
best wishes
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First of all: Ask yourself whether it is really necessary for a script to know the password.
sudoand SE-Linux usually give you plenty of options to avoid entering passwords.This being said,
suopens its controlling terminal to read the password, not stdin. You can usesudowith the-Soption to read the password from stdin.