Difference between revisions of "Sudo: menjalankan command di script"

From OnnoWiki
Jump to navigation Jump to search
Line 17: Line 17:
  
 
* https://askubuntu.com/questions/425754/how-do-i-run-a-sudo-command-inside-a-script
 
* https://askubuntu.com/questions/425754/how-do-i-run-a-sudo-command-inside-a-script
 +
 +
 +
==Pranala Menarik==
 +
 +
* [[ssh]]

Revision as of 07:20, 17 December 2018

sumber: https://askubuntu.com/questions/425754/how-do-i-run-a-sudo-command-inside-a-script

Cara yang normal tambahkan sudo sebelum menjalankan script

sudo myscript.sh

Atau jika hanya salah satu command saja, bisa

sudo -u username "perintah"

Atau kalau mau memaksa, bisa

exec sudo su -c "perintah"


Referensi


Pranala Menarik