Sistema de blogs Diarium
Universidad de Salamanca
Pablo Gallardo's Blog
My professional web log about IT, Cybersecurity & Project Management

How to check from command line if your user has admin rights


Using sudo command

You can run a command like this:
timeout 2 sudo id && echo Access granted || echo Access denied

Mac OS X

Using sudo command

You can use the same timeout command on Mac, but you need to install coreutils.

To install coreutils using brew:
brew install coreutils

You might be also interested in…

External References


About pmgallardo

I studied Computer Science at University of Salamanca. Since then, I have been working first as developer and then as SAP consutant. This blog is about problems I dealt when using computers, and more important, the solutions I found. Whenever I am on an issue and suddenlly I have a flash that leads me to a solution, I document my discoveries in a post.

, , , , , , , , , , , , , ,

No comments yet.

Leave a Reply


Política de privacidad
Studii Salmantini. Campus de excelencia internacional