我曾经听到这么一个故事: 一个年轻的程序员问一个老程序员(一个比较牛逼的公司的CTO) 年轻程序员: 你为什么这么牛X., 就好像没有你不会的。老程序员: 积累的。年轻程序员: 怎么才能积累到您的程度呢。我每天都在积累。但是似乎都没有感觉到进步。老程序员: 我从20岁开始做到了一件事情,直到今天,而且尽可能地保证不间断。年轻程序员: 到底是什么? 老程序员: 我每天保证自己有2个小时在学习新的东西。

Redhat Enterprise linux 6 - 3

上一篇 / 下一篇  2012-08-31 15:47:21 / 个人分类:linux

1. Enabling Automatic Logouts -- 限制登录到root用户的安全风险。
When the user is logged in as root, an unattended login session may pose a significant security risk. T o reduce this risk, you can configure the system to automatically log out idle users after a fixed period of time:
    1. Make sure the screen package is installed. You can do so by running the following command as root:
          yum install screen

    2. As root, add the following line at the beginning of the /etc/profile file to make sure the processing of this file cannot be interrupted:
          trap "" 1 2 3 15
    3. Add the following lines at the end of the /etc/profile file to start a screen session each time a user logs in to a virtual console or remotely:
          SCREENEXEC="screen"
          if [ -w $(tty) ]; then
             trap "exec $SCREENEXEC" 1 2 3 15
             echo -n 'Starting session in 10 seconds'
             sleep 10
             exec $SCREENEXEC
          fi
       Note that each time a new session starts, a message will be displayed and the user will have to wait ten seconds. T o adjust the time to wait before starting a session, change the value after the sleep command.
    4. Add the following lines to the /etc/screenrc configuration file to close the screen session after a given period of inactivity:
          idle 120 quit
          autodetach off
       T his will set the time limit to 120 seconds. T o adjust this limit, change the value after the idle directive.
       Alternatively, you can configure the system to only lock the session by using the following lines instead:
          idle 120 lockscreen
          autodetach off
       T his way, a password will be required to unlock the session.
T he changes take effect the next time a user logs in to the system.



TAG:

 

评分:0

我来说两句

Open Toolbar