{"id":38178,"date":"2016-09-23T16:21:36","date_gmt":"2016-09-23T21:21:36","guid":{"rendered":"http:\/\/rubiology.com\/?p=734"},"modified":"2016-09-23T17:23:16","modified_gmt":"2016-09-23T22:23:16","slug":"quick-tip-sudo-timeout","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc2027fall2016\/syndicated\/quick-tip-sudo-timeout\/","title":{"rendered":"Quick Tip: SUDO timeout"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/rubiology.com\/2016\/09\/23\/qt-sudo-timeout\/\"><a href=\"https:\/\/rubiology.com\">TC2027 \u2013 Blog will Tear us Apart<\/a><\/a><\/em><br \/><\/p>\n<p>So, you&#8217;ve been playing with your Ubuntu distribution around, and suddenly you require <strong>sudo<\/strong> privileges in order to change or install a special feature. Thus, you enter your password and grant that privilege access to your computer.<\/p>\n<p>I believe I don&#8217;t have to remind you that being logged as root is dangerous and you should only run commands and programs as root when you&#8217;re 100% sure of what you&#8217;re doing.\u00a0In the default terminal, after you enter the password once, it allows you to run the next commands with the root privileges without password prompt.<\/p>\n<p>On my Linux experience I have typed commands that weren&#8217;t mean to be on root access or finding someone (my hacker girlfriend) accessing my root folders without having to input any password.<\/p>\n<p>After digging around I found a, surprisingly easy, way to modify the default sudo\u00a0settings in order to change the timeout of the root access.<\/p>\n<h4>Let us access the configuration file.<\/h4>\n<pre>\u00a0user@pc~$sudo visudo<\/pre>\n<p>This command is absolutely necessary in order to modify the file, even on the file it says so:<\/p>\n<pre>#This file MUST be edited with the 'visudo' command as root.<\/pre>\n<p>Don&#8217;t worry, the editor is not vim, it opens it with nano. Almost at the beginning of the file one can see preformed default variables, the one that matters to us is the following:<\/p>\n<pre>Defaults env_reset<\/pre>\n<p>This is where we can modify the value of timeout, notice that the variable is not even defined at the file. On the same line, we need to append the timeout variable with the following syntax:<\/p>\n<pre>timestamp_timeout=x<\/pre>\n<p>Now, instead of the x we can add any integer value. This value represent the time in\u00a0<strong>seconds<\/strong> that the terminal will wait before asking for the password again.<\/p>\n<p>If you want the computer to ask for the password <div class=\"post-limited-image\"><img alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc2027fall2016\/wp-content\/uploads\/2016\/09\/bc299997a8c2f7b9da72d74feb72219d.jpg\" \/><\/div>\n<div class=\"post-limited-image\"><img alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc2027fall2016\/wp-content\/uploads\/2016\/09\/12d1edbb25a46174c56327457f1af418.jpg#038;blog=115202735&%23038;post=734&%23038;subd=rubiology&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/><\/div><!--more--><strong>every\u00a0<\/strong><b>command<\/b> that requires root access the value should be\u00a0<strong>0<\/strong>. Also, if you want the terminal to never ask for your password, which I really don&#8217;t recommend it unless you really want your computer to be suicidal, the value you should write is <strong>-1.<\/strong><\/p>\n<p>And, that&#8217;s it, remember to<strong> ctrl+O<\/strong> to write it out, and <strong>ctrl+x<\/strong> to exit the editor.<\/p>\n<p>Stay safe.<\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/rubiology.wordpress.com\/734\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc2027fall2016\/wp-content\/uploads\/2016\/09\/bc299997a8c2f7b9da72d74feb72219d.jpg\" \/><\/a> <img alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc2027fall2016\/wp-content\/uploads\/2016\/09\/12d1edbb25a46174c56327457f1af418.jpg#038;blog=115202735&%23038;post=734&%23038;subd=rubiology&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at TC2027 \u2013 Blog will Tear us Apart So, you&#8217;ve been playing with your Ubuntu distribution around, and suddenly you require sudo privileges in order to change or install a special feature. Thus, you enter your password and grant that privilege access to your computer. I believe I don&#8217;t have to remind you &hellip; <a href=\"https:\/\/kenscourses.com\/tc2027fall2016\/syndicated\/quick-tip-sudo-timeout\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Quick Tip: SUDO timeout<\/span><\/a><\/p>\n","protected":false},"author":8,"featured_media":38179,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[29,105,124,122,121,24,123],"class_list":["post-38178","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-computer-security","tag-linux","tag-quick-tip","tag-root","tag-sudo","tag-tc2027","tag-timeout"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/posts\/38178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/comments?post=38178"}],"version-history":[{"count":2,"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/posts\/38178\/revisions"}],"predecessor-version":[{"id":38183,"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/posts\/38178\/revisions\/38183"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/media\/38179"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/media?parent=38178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/categories?post=38178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc2027fall2016\/wp-json\/wp\/v2\/tags?post=38178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}