I am using the following command to skip the 'password' check using 'echo' in ubuntu,
echo $password | sudo -S apt-get install -y default-jdk
I am using the following command to skip the 'password' check using 'echo' in centos,
echo $password | yum -S -y install python-pip
But the -S and echo is not working in CentOS rather, It is asking me to enter the password again. What is the way to skip asking for password using echo Or anything wrong in this command?
NOTE: I can't use SSH-KEY
EDITED: To make it clear,
1)I need to deliver a script to my customer, where the script will install python-pip as one of the part. The customer will provide the password as input for that script so I don't want the customer to enter the password during the execution of script.
(i.e) I need to install the python-pip in the same machine without asking the user to enter the password. So as I tried in ubuntu I used the echo $password with -S, So I dont have any way to edit the sudoers also.
So now Is there a way like echo $password / -S in centos?