Skip to content

SFCOMPY™ :: Computer Repair Blog :: IT Blog

  • .HOME
  • .CATEGORIES
    • Ads
    • Audio
    • Booting
    • Data Recovery
    • Drivers
    • Data Recovery
    • File System
    • Hardware
    • Network
    • OS
    • Software
    • Security
    • System
    • User Account
    • Utility
    • Video
    • Web Browser
  • .MY ACCOUNT
  • .ABOUT
    • .Privacy Policy
    • .Terms
  • .SFCOMPY™
  • Toggle search form
sfcompy-spend-hours-ad
  • InMotion! Shared Hosting Landing Page Ads
  • Namecheap! Transfer .COM and save 16% Ads
  • NameCheap Web Security QR SFCOMPY
    #ChooseNamecheap Web Security -Internet protection for you and your customers Ads
  • sfcompy-inmotion-cyber-month
    InMotion Hosting – Cyber Week/Month Ads
  • sfcompy namecheap ninja-black Friday deals
    NameCheap Black Friday: Web Ninjas unite! Ads

Create a Sudo User – MacOS CLI

Posted on June 11, 2021June 26, 2021 By SFCOMPY™ Editor No Comments on Create a Sudo User – MacOS CLI
sfcompy_macosx_suso_user

This is an example that shows how to create a Sudo user, means a Standard user with an Admin privileges, with this capabilities you will be able to perform some system changes and install software at system level(root level) from your a standard user account without the need to switch to an Admin user account , changes with privileges that only belong to Administrator users. So keep in mind!, on a regular daily work base , you should never work and login as a user with Administrator\sudo power and privileges, and if you are not sure what you are doing and you must using this command at the terminal to make some system changes or to install some software or library, after you complete the task, make sure that you close all the Sudo process and to exit form Sudo user by typing ‘exit’ command at the terminal and close the terminal window (to avoid further confusions)

1). Log in to admin user

2). Open a terminal

3). Edit the file 'sudoers' located at \etc folder

bash> nano /etc/sudoers

4). Scroll down and find the line with 
 .
 .
 # root and users in group wheel can run anything on any machine as any user
 root ALL = (ALL) ALL 
 .
 .

5). Under line that begin with the 'root' add the user (ex: myuser) that you want it to be with the sudo privileges,  write it with the same format as the line with the root... end-up to have:
 .
 .
 # root and users in group wheel can run anything on any machine as any user
 root  ALL = (ALL) ALL
 myuser ALL = (ALL) ALL
 .
 .

6). Save and exit the editor 

7). Logout from the Admin account and login to the new sudo user account (myuser)

8). To check if the sudo works, try to see the content of the suders file type: 

bash> cat /etc/sudoers

this will reject the request and print a denied message
cat: /etc/sudoers: Permission denied'

9). now try to run this line again but this time with the sudo command at the beginning : 

bash> sudo cat /etc/sudoers
if the sudo is working, it will output the content of the suders file and you will see the line with the user name that you just added
 .
 .
 myuser ALL = (ALL) ALL
 .
 .
 
DONE! 

Related posts:

  • sfcompy_blog_412x331Hide or Show the mac Users folder - MacOS CLI
  • sfcompy namecheap ninja-black Friday dealsNameCheap Black Friday: Web Ninjas unite!
  • sfcompy_macosx_usersGet the User's List - MacOS CLI
Security, User Account Tags:All Macs, Command Line (CLI), iMac, Mac Mini, MacBook, Pro and Advance User

Post navigation

Previous Post: Hide or Show the mac Users folder – MacOS CLI
Next Post: Find the Running Process of a Given User – MacOS CLI

Leave a Reply Cancel reply

You must be logged in to post a comment.

InMotion Hosting - Cyber Week/Month Dedicated Hosting Landing Page

Recent Posts

  • sfcompy-protected-zip-filePassword Protected Zip file – MacOS CLI
    July 16, 2021
  • sfcompy-zip-archive-and-comoressZip or UnZip files and folders – MacOS CLI
    July 13, 2021
  • sfcompy_blog_412x331Show Hidden files – MacOS CLI
    June 23, 2021

InMotion Shared Hosting Landing Page Sale

InMotion WordPress Hosting Landing Page Sale

InMotion Reseller Hosting Landing Page

Categories

  • Ads (5)
  • Data Recovery (1)
  • File System (3)
  • Network (4)
  • OS (3)
  • Security (9)
  • Software (1)
  • System (3)
  • User Account (5)
  • Utility (4)
  • Video (1)
  • Web Browser (1)

Tag

All Ads (4) All Android (2) All IOS (2) All Linux (2) All Macs (12) All Windows (4) Command Line (CLI) (8) iMac (8) InMotion (2) mac (1) MacBook (8) Mac Mini (8) namecheap (2) Pro and Advance User (7) Standard or local User (1)
May 2025
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Mar    
  • Sign a pdf file Using Microsoft Edge
  • InMotion Hosting – Cyber Week/Month
  • NameCheap Black Friday: Web Ninjas unite!
  • #ChooseNamecheap Web Security -Internet protection for you and your customers
  • InMotion! Shared Hosting Landing Page

  • Sign a pdf file Using Microsoft Edge
  • InMotion Hosting – Cyber Week/Month
  • NameCheap Black Friday: Web Ninjas unite!
  • #ChooseNamecheap Web Security -Internet protection for you and your customers
  • InMotion! Shared Hosting Landing Page
  • Sign a pdf file Using Microsoft Edge
  • sfcompy-inmotion-cyber-monthInMotion Hosting – Cyber Week/Month
  • sfcompy namecheap ninja-black Friday dealsNameCheap Black Friday: Web Ninjas unite!
  • NameCheap Web Security QR SFCOMPY#ChooseNamecheap Web Security -Internet protection for you and your customers
  • InMotion! Shared Hosting Landing Page
  • sfcompy-protected-zip-file
    Password Protected Zip file – MacOS CLI File System
  • sfcompy_blog_412x331
    Hide or Show the mac Users folder – MacOS CLI Security
  • sfcompu_macosx_login_412x331
    Hide or Show mac Login User – MacOS CLI OS
  • sfcompy_macosx_users
    Get the User’s List – MacOS CLI User Account
  • sfcompy-vsc-color-theme-screens
    SFCOMPY™ Visual Studio Code Color Theme For Pro System
  • sfcompy_blog_412x331
    Find the Running Process of a Given User – MacOS CLI OS
  • Sign a pdf file Using Microsoft Edge Software
  • Namecheap! Transfer .COM and save 16% Ads
  • About
  • Cart
  • Category
  • Checkout
  • Computer Repair & IT Service Blog
  • My account
  • Post Page
  • Privacy Policy
  • Shop
  • Terms

Copyright © 2025 SFCOMPY™ Computer Repair & IT Blog .

Powered by SFCOMPY™ WP Theme for Pro WordPress theme