Skip to content

daverolo/cansudo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

CanSudo.sh 1.0.1

Bash script to check whether or not the current user can sudo without entering a password.

Example

bash cansudo.sh

Run the command above with users that have different settings in /etc/sudoers!

Arguments

Argument Required Accepts Value Description
--version No None Returns script name and version
-v No None Returns script name and version

Exit Codes

Code Type Description
0 SUCCESS The user is in sudo group and can use sudo without password
1 FAIL The user can not use sudo at all because he is not in sudo group
2 FAIL The user can use sudo but requires to input a password

Important

  1. Currently only tested with bash on Ubuntu 20.04
  2. Script may not work with zsh on Mac or other shells/OS
  3. You may have to adjust the timeout value on busy systems (see ESSENTIALS section in cansudo.sh)
  4. Still a bit hacky solution - use at your own risk

Credits

Resources i found during research wich helped develop this script:

I am not associated in any form with the mentioned resources.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages