Showing posts from January, 2020

MacOS: zsh Terminal and other misc restore/configuration portability...

Summary: I bought a new macbook pro and typical behavior is to use time machine to restore.  This method is perfectly acceptable 99% of the time.  Those that mess w/ kext, sudoers, and other jazz... not so much.  I originally did a time machine restore, but that brought over a mess of things that I quite frankly had forgotten about (I like to tinker) and that was unfair to my new macbook.  Needless to say, but I bricked my new macbook which led me to  Konmari my setup. Details: Then there is the portability aspect of my terminal environment that I've been so lacking.  In combination w/ Dropbox, I'm able to move this stuff around and keep things in sync much easier now. Basically restoring bash/zsh alias is a pain.  Modifying any of these things is also a hassle.  So I developed a shell script that will basically take files that exist in my Dropbox directory and symlink the original files back to Dropbox. This way I can simply run this shell script on any new syst

Misc: Adding/Enabling a Linux user via ssh public key w/ sudo and to not require a password.

Summary: This is a very specific use case, but is helpful when working w/ cloud instance VM's that don't make use of central auth.  The following script essentially adds a user to Linux so that they can ssh into the system w/ using their ssh public key and utilize sudo if granted.  Running sudo as these users typically requires a password be set.  In this case, we are not setting a password on the account as  This script circumvents the need for users to provide a password. Details: Effectively, the script works like so: An existing sudoer/root/admin must run this script. You provide a username and the user's ssh public key. Set sudoer to true or false (or anything other than true really) customsudofile path defaults to /etc/sudoers.d/nopasswd Essentially, anything in sudoers.d path is ingested by sudoer file as an override. customsudodata is what you want to insert into the custom sudo file. Default set to allow sudo members to invoke sudo w/o a passwo