I'm trying to login as root in shell by following command :
$ echo 'myPassword' | sudo -Si
But gets me following error:
stdin: is not a tty
-bash: line 1: myPassword: command not found
My Goal :
I added above command in ~/.bashrc
in order to whenever Terminal starts up, it logged in as root
P.S :
I can successfully run below command :
For instance
$ echo 'myPassword' | sudo -S chown $USER ~/file.txt
i
flag herei
flag because I need to login as rootsudo -S su -