แห่งนี้ตั้งอยู่ตามปกติโดยตัวเลือกในsecure_path /etc/sudoersจากman sudoers:
secure_path Path used for every command run from sudo. If you don't
trust the people running sudo to have a sane PATH environ‐
ment variable you may want to use this. Another use is if
you want to have the “root path” be separate from the “user
path”. Users in the group specified by the exempt_group
option are not affected by secure_path. This option is not
set by default.
หากต้องการเรียกใช้คำสั่งที่ไม่ได้อยู่ในค่าเริ่มต้น$PATHคุณสามารถทำได้
ใช้เส้นทางแบบเต็ม: sudo ~/bin/my-command; หรือ
secure_pathเพิ่มไดเรกทอรีที่มีคำสั่งไปยัง เรียกใช้sudo visudoและแก้ไขเส้นทางที่ปลอดภัย:
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/youruser/bin/"
บันทึกไฟล์และครั้งต่อไปที่คุณเรียกใช้sudoไดเรกทอรี~/binจะอยู่ใน$PATHนั้น