Run Linux command as predefined user
- by vijay.shad
Hi all,
I have created a shell script to start a server program.
startup.sh start
When above command will executes, it will try starts the server as adminuser. To achieve this my script has written like this.
SUBIT="su - adminuser -c "
SERVER_BOX_COMMAND_A="Server"
##############
# Function to start cluster
function start(){
$SUBIT "$SERVER_BOX_COMMAND_A"
}
When i execute the command it asks for password. Is there any other way to do this so, it will not ask for password.