I need to switch users in a script in order to gain access to a server outside a firewall. User1 calls scripts owned by User2.
User2 is able to run commands outside firewall but User1 can't, so when user1 calls the script authorisation denied occurs.
I have tried:
sudo su - user2<<-EOF
user2password
but it still asks for the password when the file runs. Is there any way around this.
cheers
simmo
User2 is able to run commands outside firewall but User1 can't, so when user1 calls the script authorisation denied occurs.
I have tried:
sudo su - user2<<-EOF
user2password
but it still asks for the password when the file runs. Is there any way around this.
cheers
simmo