How to add a password in a remote script

General support questions
phil.e
Posts: 28
Joined: 2018/02/13 20:28:14

How to add a password in a remote script

Postby phil.e » 2018/04/11 03:19:11

I need to update several systems with the command "chkconfig --level 2345 restorecon on".

When I can login directly as root "ssh root@192.168.1.1 < /root/script/update.script" worked fine.

How can I accomplish the same thing as a regular user where I'd need to use sudo and enter a password on the other end?