I have a script that runs and will
ssh into another server to restart its
In the script, the command literally is:
sudo ssh -n $SERVER /sbin/service dhcpd restart
This works fine when the script is called, but when I try to manually run the command myself at the command line, it prompts and waits for me to input the root password.
How does it not prompt for the root password simply because the command was called from within the script?
I've also checked to ensure I was running both as the same user. I didn't create the script, so I'm not sure if there is some magic going on when the script gets called that allows this type of thing.