sudo is quite a good tool in Linux world in which you can specify commands with full access without giving root permissions to everything on the system.
When running on a root session, any commands executer after pressing enter. There's no way to cancel or abort the command. That's why sudo is a good practice to use, so any of change of mind before pressing enter can is still possible to cancel.
And running in a non-root session, if the command is executed accidentally that will harm or delete an important setting it will be denied by the system. If it requires a root permission, if the command was executed on a root permission, then the command will be executed and whatever consequences after running the command will immediately take effect on the system.
After the password is entered on the system, on the current session "sudo" will have 15 minutes by default that it won't ask for a password and any commands preceded by sudo, it will be executed automatically.
So, if you need to make changes on the system and need 5 minutes or less and don't want to wait the 15 minutes expiry?
This will require a sudo password or revoke the sudo on the current session and the next time, sudo is invoke a password would be required.
sudo -k or sudo -K is a good command to remember especially on a shared VM.
To learn more about sudo, consul the man page.
Below is an excerpt from the sudo man page.
man sudo
-K, --remove-timestamp
Similar to the -k option, except that it removes the user's cached
credentials entirely and may not be used in conjunction with a command or other
option. This option does not require a
password. Not all security policies
support credential caching.
-k, --reset-timestamp
When
used without a command, invalidates the user's cached credentials. In other words, the next time sudo is run a
password will be required. This option
does not require a password and was added to allow a user to revoke sudo
permissions from a .logout file.
When
used in conjunction with a command or an option that may require a password,
this option will cause sudo to ignore the user's cached credentials. As a result, sudo will prompt for a password
(if one is required by the security policy) and will not update the user's
cached credentials.
Cheers! Take care. Till next Time. Enjoy Sudo'ing. Explore Linux and enjoy the journey..
Stay safe! and Keep things up!
Do ASAP, Always Say A Prayer...
Practice O.T.G. = Obedience To God
Make time for Prayer and Meditation.
================================
Free Android Apps:
Click links below to find out more:
Free Android Apps:
Click links below to find out more:
Excel Keyboard guide:
https://play.google.com/store/apps/details?id=chrisjoms.myexcelapplicationguide
Heaven's Dew Fall Prayer app for Android :
https://play.google.com/store/apps/details?id=soulrefresh.beautiful.prayer
Catholic Rosary Guide for Android:
Pray the Rosary every day, countless blessings will be showered upon your life if you recite the Rosary faithfully.
https://play.google.com/store/apps/details?id=com.myrosaryapp
Divine Mercy Chaplet Guide (A Powerful prayer) BFF = Be Filled Faith:
Comments
Post a Comment