[SOLVED] Shell script stops and ask root password but it does not work !
Posted: 23 Feb 2021, 15:33
Hi,
I am trying to write a script file which use root priviliges such as changing files under root folder by script (usr/local/bin). However, although I used my commands in "sudo -s<<EOF ... EOF" block, script stops when it see sudo commands and ask root password. However Porteus's default root password" , since I did not change it, does not work in terminal window. It writes :
" We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
"
Where am i doing wrong? Why root password does not work?
My code is :
Thanks.
I am trying to write a script file which use root priviliges such as changing files under root folder by script (usr/local/bin). However, although I used my commands in "sudo -s<<EOF ... EOF" block, script stops when it see sudo commands and ask root password. However Porteus's default root password" , since I did not change it, does not work in terminal window. It writes :
" We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
"
Where am i doing wrong? Why root password does not work?
My code is :
Code: Select all
#!/bin/sh
sudo -s <<EOF
cp -v unrar /usr/local/bin
EOF