My understand is that sudo is executes a given command with root privileges, but I experienced that entering a command in Terminal with sudo caches the authorization. How does it actually works?
For e.g.
sudo fdisk -l
[sudo] password for xxxxx:
(once I authorize by entering a password, successive sudo commands are not prompting for passwords)
sudo fdisk -l
(not prompting for password)
sudo mount -t vfat /dev/sda1 /media/test
Whether sudo is really a wrapper for su (substitute/switch user)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…