6 ms·
The article will not allow sudo changes on Big Sur - at least, not without changing permissions of the sudo file first: 1. sudo -Si 2. chmod 644 /etc/pam.d
by bitlevel 6y ago
The article will not allow sudo changes on Big Sur - at least, not without changing permissions of the sudo file first:
1. sudo -Si
2. chmod 644 /etc/pam.d/sudo
3. vi /etc/pam.d/sudo
4. Add the 'Auth sufficient pam_tid.so' line
5. chmod 444 /etc/pam.d/sudo
6. ...
7. Profit!
Very handy tip though, thanks!
- mega_dingus 6y agoOr when using vi, just use :wq!
- cyberge99 6y agoshift Z Z is faster.
- asidiali 6y agoDebatable and depends on length of time shortcut has been in use. I can type :wq like a madman. My finger can slide straight from w to q, whereas with double-z, I have to pick my finger up and put it back down. So much movement! What next, you want me to run a marathon?
- exikyut 6y agoI guess it's a learned dexterity thing. :wq = <move finger of right hand to Shift> <depress Shift> <move finger of left hand to ;> <press-release ;> <release Shift and move finger of left hand and press w and q> ZZ = <move 2nd finger of left hand to Shift> <depress Shift> <move index finger of left hand to z> <press-release z twice> As someone with mildly poor dexterity (and I don't touch-type with all my fingers, I mostly use my index fingers), the second approach looks somewhat more interesting to test.
- asidiali 6y agoInteresting, I will add flexibility too, or maybe hand size. I find it slightly uncomfortable to hit shift and Z simultaneously with solely my left hand, so I hit shift with my right and z with my left. Alternatively, I will simultaneously hit shift + colon with my right, and then do the wq slide as mentioned above. Nice that all hands can be accommodated :)
- nxpnsv 6y agoThis is going to save you seconds, every year!
- toyg 6y agoThat's all over the place from a touchtype perspective. 2nd finger? That's a pinkie. And you're supposed to use modifier keys from the opposite hand when available. So it should be <move right pinkie to hold right Shift> <move left pinkie to hit Z twice>. I honestly didn't know about ZZ, seems very convenient. :wq! on a qwerty forces the pinkie to travel all the way up to the top row, which is hell. On my home keyboard I use a layer for special characters, which helps, but still I guess I'll stick to ZZ from now on.
- ed25519FUUU 6y agoI’ve typed in :wq! so often I sometimes accidentally type it in when trying to do things like close browser tabs or exit programs.
- Florin_Andrei 6y agoYou are all wrong. The Emacs shortcuts are far superior. /s
- malobre 6y agoHere comes the `:x!` clan
- rectang 6y ago[offtopic] zoinks fam that's some next-level bikeshedding
- deleted 6y ago[deleted]
- zaphirplane 6y agoI don’t get it, the article shows it in 2 steps why the 5 step verbosity??
- deleted 6y ago[deleted]
- philote 6y agoIt seems in Big Sur the file you need to edit is not writable. So you need to make it writable first, edit it, and then change permissions back to read-only.
- angulardragon03 6y agoThis doesn't seem to be strictly true - the two-line solution worked exactly as expected for me on 11.2.1. I used nano instead of vi (personal preference), but it worked nonetheless.
- bitlevel 6y agoMaybe that's the difference. I was using vi, and not nano. Have confirmed that using 'sudo nano /etc/pam.d/sudo' works fine. No need for the verbosity when nano works I guess. :S
- cprecioso 6y agoI usually just `sudo nano` it, works fine
- helsinkiandrew 6y ago:w!
- toyg 6y ago:wq!
- ivrrimum 6y agoStill didn't work for me
- philsnow 6y agos/vi/visudo/ visudo will lint the resulting file and (should) reject the change if it would break your system.
- ArchOversight 6y agoThis isn't modifying the sudoers file, it is modifying the pam file.
- girishso 6y agoSomething weird going on, it still asks for password on the command prompt, if I press just Return key then dialog for touch id opens.. after touching it says `Sorry try again` (my touch id works in other places). On 11.2.1
- girishso 6y agoMy bad, should have RTFA. It needs to be the very first line.