How can I log in with the su
command in one line in the terminal? I know that the sudo
command can do that:
echo [password] | sudo -S [command]
But when I try to imply it in the su
command :
echo [password] | su [username]
I get an error:
standard in must be tty
I don't have access to the sudo
account (so I can't access and edit the sudoers
file).
I know that the right syntax is basically:
su [username]
What I want to do is to add a su
command to aliases without being needed to enter password every time