{"id":137,"date":"2014-06-24T16:04:42","date_gmt":"2014-06-25T01:04:42","guid":{"rendered":"http:\/\/blog.box.kr\/?p=137"},"modified":"2014-06-24T16:04:42","modified_gmt":"2014-06-25T01:04:42","slug":"how-to-set-default-session-timeout-in-linux","status":"publish","type":"post","link":"https:\/\/blog.box.kr\/?p=137","title":{"rendered":"How to set default session timeout in Linux"},"content":{"rendered":"<header class=\"entry-header\" style=\"color: #404040;\">\n<h1 class=\"entry-title\" style=\"font-weight: inherit; font-style: inherit; color: #333333;\"><a style=\"color: #333333;\" title=\"Permalink to How to set default session timeout in Linux\" href=\"http:\/\/thedaneshproject.com\/posts\/how-to-set-default-session-timeout-in-linux\/\" rel=\"bookmark\">How to set default session timeout in Linux<\/a><\/h1>\n<div class=\"entry-meta\" style=\"color: #666666;\">\n<\/div>\n<\/header>\n<div class=\"entry-content\" style=\"color: #404040;\">\n<p>My DC operation guys access Linux servers on a daily basis but somehow they never remember to log out. This is a security risk as anyone could gain access to the open console and create caos.<\/p>\n<p>Today, yet again I\u2019m forced to play the bad guy by dummy proofing my Linux servers by implementing default timeout for user sessions.<\/p>\n<p>Bash and Korn both support the TMOUT variable which I will use to set the default timeout.<\/p>\n<p>The etc\/.bashrc file will apply the timeout system wide but if you need it to be user specific then modify the ~\/.bashrc file instead.<\/p>\n<p>Here\u2019s how it\u2019s done.<\/p>\n<pre><code>echo \"TMOUT=300 &gt;&gt; \/etc\/bashrc<\/code><\/pre>\n<pre><code>echo \"readonly TMOUT\" &gt;&gt; \/etc\/bashrc<\/code><\/pre>\n<pre><code>echo \"export TMOUT\" &gt;&gt; \/etc\/bashrc<\/code><\/pre>\n<p>Log off, start a new session and wait for 5 minutes. Your session should terminate<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to set default session timeout in Linux My DC operation guys access Linux servers on a daily basis but somehow they never remember to log out. This is a security risk as anyone could gain access to the open console and create caos. Today, yet again I\u2019m forced to play the bad guy by dummy proofing my Linux servers by implementing default timeout for user sessions. Bash and Korn both support the TMOUT variable which I will use to set the default timeout. The etc\/.bashrc file will apply the timeout system wide but if you need it to be user specific then modify the ~\/.bashrc file instead. Here\u2019s how it\u2019s done. echo &#8220;TMOUT=300 &gt;&gt; \/etc\/bashrc echo &#8220;readonly TMOUT&#8221; &gt;&gt; \/etc\/bashrc echo &#8220;export TMOUT&#8221; &gt;&gt; \/etc\/bashrc Log off, start a new session and wait for 5 minutes. Your session should terminate<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[7],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5q9Zn-2d","jetpack-related-posts":[{"id":158,"url":"https:\/\/blog.box.kr\/?p=158","url_meta":{"origin":137,"position":0},"title":"how to set the idle-timeout in linux SSH","date":"2014-07-06","format":false,"excerpt":"in \/etc\/ssh\/sshd_config insert \u00a0 ClientAliveInterval 600 ClientAliveCountMax 3 \u00a0 That will give you an timeout of 30 minutes (600 sec x 3)","rel":"","context":"In &quot;Linux&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":170,"url":"https:\/\/blog.box.kr\/?p=170","url_meta":{"origin":137,"position":1},"title":"[\uac1c\ubc1c\ud301] Spring + Quartz\uc5d0\uc11c \ud30c\ub77c\ubbf8\ud130\ub97c \uac00\uc838\uc624\ub294 \ubc29\ubc95","date":"2014-07-08","format":false,"excerpt":"\uc77c\uc804\uc5d0\u00a0\uc608\uc57d\uc791\uc5c5\uc744 \uc2e4\ud589\ud558\ub294 \uba87\uac00\uc9c0 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubd24\ub294\ub370\uc5ec.. Spring + Quartz\ub97c \uc774\uc6a9\ud560\ub54c \uc0ac\uc6a9\uc790 \ud30c\ub77c\ubbf8\ud130\ub97c Job \uc124\uc815\ud30c\uc77c\uc5d0 \ub4f1\ub85d\ud558\uace0 \uc2e4\ud589\uc2dc \uc774\ub97c \uac00\uc838\uc62c \uc218 \uc788\uc2b5\ub2c8\ub2e4.. \uba3c\uc800 Job \uc124\uc815\ud30c\uc77c\uc5d0 \uc544\ub798\uc640 \uac19\uc774 \uc0ac\uc6a9\uc790 \ud30c\ub77c\ubbf8\ud130\ub97c \ucd94\uac00\ud558\uace0 <bean id=\"MyJob\" class=\"org.springframework.scheduling.quartz.JobDetailBean\"> <property name=\"jobClass\" value=\"net.openintegration.sample.scheduling.MySpringQuartzJob\" \/> <property name=\"jobDataAsMap\"> <map> \u00a0\u00a0\u00a0<entry key=\"timeout\" value=\"5\" \/> \u00a0\u00a0\u00a0<!--entry key=\"timeout\"><value>5<\/value><\/entry--> <\/map> <\/property> <\/bean> \uc544\ub798\uc640 \uac19\uc774 \ubd88\ub7ec\uc624\uba74\u2026","rel":"","context":"In &quot;JAVA&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70,"url":"https:\/\/blog.box.kr\/?p=70","url_meta":{"origin":137,"position":2},"title":"JEUS \ud074\ub798\uc2a4 \uc790\ub3d9 \ubc18\uc601..\ucc98\ub9ac","date":"2014-06-12","format":false,"excerpt":"<?xml version=\"1.0\" encoding=\"utf-8\"?> < jeus-system xmlns=\"http:\/\/www.tmaxsoft.com\/xml\/ns\/jeus\"> <node> < name>bb<\/name> < engine-container> < name>container1<\/name> < command-option> -Djeus.servlet.classloader.spec23=true < \/command-option> < engine-command> < type>ejb<\/type> < name>engine1<\/name> < \/engine-command> < engine-command> < type>servlet<\/type> < name>engine1<\/name> < \/engine-command> < sequential-start>true<\/sequential-start> < user-class-path>C:\/test\/WEB-INF\/classes<\/user-class-path> < tm-config> < uncompleted-timeout>43200000<\/uncompleted-timeout> < \/tm-config> < \/engine-container> < class-ftp>true<\/class-ftp> < sequential-start>true<\/sequential-start>\u2026","rel":"","context":"In &quot;JEUS &amp; WEBToB&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":724,"url":"https:\/\/blog.box.kr\/?p=724","url_meta":{"origin":137,"position":3},"title":"[\ud38c]45 Useful JavaScript Tips, Tricks and Best Practices","date":"2015-04-15","format":false,"excerpt":"http:\/\/modernweb.com\/2013\/12\/23\/45-useful-javascript-tips-tricks-and-best-practices\/ \u00a0 45 Useful JavaScript Tips, Tricks and Best Practices By Saad Mousliki As you know, JavaScript is the number one programming language in the world, the language of the web, of mobile hybrid apps (like PhoneGap or Appcelerator), of the server side (like NodeJS orWakanda) and has many other\u2026","rel":"","context":"In &quot;JAVA&quot;","img":{"alt_text":"keep-calm-and-learn-javascript","src":"https:\/\/i0.wp.com\/fw008950-flywheel.netdna-ssl.com\/wp-content\/uploads\/2013\/12\/keep-calm-and-learn-javascript.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":116,"url":"https:\/\/blog.box.kr\/?p=116","url_meta":{"origin":137,"position":4},"title":"MYSQL + TOMCAT \ub610\ub294 MYSQL\ub97c\u2026","date":"2014-06-18","format":false,"excerpt":"MYSQL + TOMCAT \ub610\ub294 MYSQL\ub97c \uc0ac\uc6a9\ud558\ub294 WEB \uac1c\ubc1c \uc2dc Connection POLL\uc774 \uc790\uc8fc \ub04a\uae30\ub294 \uc77c\uc774 \ube48\ubc88 \ud568.. \u00a0 \uc774\ub97c \ub9c9\uae30 \uc704\ud574 WAS Connection POOL \uc124\uc815\uc5d0 AutoReconnect = true\ub97c \uc918 \ubd24\uc9c0\ub9cc \uc18c\uc6a9 \uc5c6\uc74c.. \uc0dd\uac01 \ub05d\uc5d0 DB\uc758 connection time out\uc774 \uc5bc\ub9c8 \uc77c\uae4c \ud655\uc778 \ud574\ubcf4\ub2c8.. \u00a0 \uae30\ubcf8 \uac12\uc774.. 10\ucd08\uc784.. \uc820\uc7a5.. \uadf8\ub798\uc11c 600 \ucd08\ub85c \ub298\ub824\uc8fc.\u2026","rel":"","context":"In &quot;DB\uad00\ub828&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":729,"url":"https:\/\/blog.box.kr\/?p=729","url_meta":{"origin":137,"position":5},"title":"install PostgreSQL on CentOS7","date":"2015-04-21","format":false,"excerpt":"1.\u00a0Install ( \u00a02015-04-21 > \ucd5c\uc2e0 \ubc84\uc804\uc740 9.4\u00a0 ) [root@localhost ~]# rpm -Uvh http:\/\/yum.postgresql.org\/9.4\/redhat\/rhel-7-x86_64\/pgdg-centos94-9.4-1.noarch.rpm http:\/\/yum.postgresql.org\/9.4\/redhat\/rhel-7-x86_64\/pgdg-centos94-9.4-1.noarch.rpm(\uc744)\ub97c \ubcf5\uad6c\ud569\ub2c8\ub2e4 \uacbd\uace0: \/var\/tmp\/rpm-tmp.z0BMz8: Header V4 DSA\/SHA1 Signature, key ID 442df0f8: NOKEY \uc900\ube44 \uc911...\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ################################# [100%] Updating \/ installing... 1:pgdg-centos94-9.4-1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ################################# [100%] [root@localhost ~]# yum install postgresql94 postgresql94-server postgresql94-libs postgresql94-contrib postgresql94 Loaded plugins: fastestmirror, langpacks http:\/\/linuxdownload.adobe.com\/linux\/x86_64\/repodata\/repomd.xml: [Errno\u2026","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/137"}],"collection":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=137"}],"version-history":[{"count":0,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/137\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}