RSS

Monthly Archives: September 2018

How to use sudo with Touch ID on your Mac

By: Cabel (Twitter: @cabel)

How to enable Touch ID for sudo commands on your MacBook Pro with Touch Bar

  1. In Safari, paste the following into the search bar: file:///etc/pam.d/sudo.

    Alternatively, you can edit the file within the Terminal app itself using command-line text editors like emacs or nano; if you choose to do this, go to step 8, and skip steps 10-12.

  2. Press Command-I with the sudo file highlighted to open up the information screen.

  3. Click on the Lock icon in the bottom right corner.
  4. Enter your authentication information (or use Touch ID).
  5. Change the privileges of all users to Read & Write.

  6. Download TextWrangler, a free plain text editor, or use the plain text editor of your choice.
  7. Open the sudo file in TextWrangler (or equivalent).
  8. Paste auth sufficient pam_tid.so on line 2 of the document (underneath the initial comment line)

    Note: If you get a note about the document being locked, go back to step 2-5 and make sure you’ve enabled Read & Write privileges on the document.

  9. Save the sudo file and close it.

  10. In Finder, press Command-I with the sudo file highlighted to open up the information screen.
  11. Change the privileges on all users to Read only.
  12. Click on the Lock icon in the bottom right corner.

Now, when you open Terminal and attempt a sudo command, you should be prompted with a Touch ID authentication in lieu of entering your administrator password.

Copy from: https://www.imore.com/how-use-sudo-your-mac-touch-id

Advertisements
 
Leave a comment

Posted by on September 24, 2018 in Mac

 

Install npm packages without sudo

By Tim Kamanin

1) Set yourself as an owner of ~/.npm directory, like this:

sudo chown -R $(whoami) ~/.npm

and if error persists, set yourself as an owner /usr/local/lib/node_modules directory too, like this:

sudo chown -R $(whoami) /usr/local/lib/node_modules

Now you can install npm packages without sudo.

 

Copy from https://timonweb.com/posts/install-npm-packages-without-sudo/

 

 
Leave a comment

Posted by on September 20, 2018 in NodeJs