{"id":1104,"date":"2010-01-14T10:19:23","date_gmt":"2010-01-14T14:19:23","guid":{"rendered":"http:\/\/www.red-sweater.com\/blog\/?p=1104"},"modified":"2016-03-08T13:21:09","modified_gmt":"2016-03-08T18:21:09","slug":"sudo-or-die","status":"publish","type":"post","link":"https:\/\/redsweater.com\/blog\/1104\/sudo-or-die","title":{"rendered":"Sudo Or Die"},"content":{"rendered":"<p>Dave Dribin offers a couple really handy tips for modifying the behavior of the &#8220;sudo&#8221; command-line tool, which allows ordinary admin users to acquire superuser powers for editing files, changing permissions, etc.<\/p>\n<p><a href=\"http:\/\/www.dribin.org\/dave\/blog\/archives\/2010\/01\/13\/handy_sudo_settings\/\">Handy Sudo Settings<\/a> &#8211; Dave Dribin&#8217;s Blog<\/p>\n<p>I knew about the ability to change the sudo timeout, but have never gotten around to looking into exactly how it&#8217;s done. Now, I&#8217;ll be annoyed a lot less often when I&#8217;m in an &#8220;administrative&#8221; frame of work.<\/p>\n<p>Dave&#8217;s post inspired me to finally do a little more research into sudo and the configuration options. For starters, now that I&#8217;ve upped my timeout value to something longer than the default 5 minutes, I might want to occasionally &#8220;logout&#8221; of my sudo authenticated session. The &#8220;kill&#8221; option does just this, putting you back in a &#8220;password required&#8221; state:<\/p>\n<pre>\r\n% sudo -k\r\n<\/pre>\n<p>As for the options Dave described, they and many others like them are described in the &#8220;sudoers&#8221; man page:<\/p>\n<pre>\r\n% man 5 sudoers\r\n<\/pre>\n<p>Hmm. What&#8217;s this option called <strong>insults<\/strong>? I turned it on, but Apple appears to have &#8220;cleaned up&#8221; this option in Mac OS X. It doesn&#8217;t do anything. On the Linux installation that runs <a href=\"http:\/\/www.red-sweater.com\/\">red-sweater.com<\/a>, I turned on the option to see what would happen:<\/p>\n<pre>\r\nyarn% sudo ls\r\ndaniel's password: \r\n... and it used to be so popular...\r\ndaniel's password: \r\nYou do that again and see what happens...\r\ndaniel's password: \r\nIt's only your word against mine.\r\nsudo: 3 incorrect password attempts\r\n<\/pre>\n<p>One of the things I love about UNIX heritage is the sense of humor that pervades most of the software. The Mac used to have much more of this itself. I guess we traded it in for a greater sense of professionalism and solidity, but I still miss the corny humor sometimes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dave Dribin offers a couple really handy tips for modifying the behavior of the &#8220;sudo&#8221; command-line tool, which allows ordinary admin users to acquire superuser powers for editing files, changing permissions, etc. Handy Sudo Settings &#8211; Dave Dribin&#8217;s Blog I knew about the ability to change the sudo timeout, but have never gotten around to [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,21,34],"tags":[],"class_list":["post-1104","post","type-post","status-publish","format-standard","hentry","category-apple","category-darwin","category-links"],"_links":{"self":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/1104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/comments?post=1104"}],"version-history":[{"count":14,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/1104\/revisions"}],"predecessor-version":[{"id":3157,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/1104\/revisions\/3157"}],"wp:attachment":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/media?parent=1104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/categories?post=1104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/tags?post=1104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}