首页 > 科技 > Login environment

Login environment

2006年5月9日 15点41分 发表评论 阅读评论

When login on the Linux system, the following steps must be passing by.

First,the system will check the password and user name inputed from the “/etc/passwd” file which is a pure text file. Each line of “/etc/passwd” can be splited to 7 partitions.
for example:
root:x: 0: 0: root:/root:/bin/bash
[1] [2][3][4] [5] [6] [7]
[1]: the 1st partition, means the login name,here is root
[2]: the password which has been encrypted.
[5]: the whole user name
[6]: the user’s directory, of course, the root’s HOME directory is “root”
[7]: the user’s SHELL, default setting is “/bin/bash”

Second and third, the system will execute two environment configuration files: “/etc/profile” and “.profile” which is always located at user’s home directory.

“/etc/profile” contains both global and local variables settings which is could be accessed by sessions and instances. PATH information, termina configuration, and security commands are also declared in this files(I think KDE wallet is such tool in Mandriva).
It indicated the date and recorder the events when log on.

“.profile”, is build up as new user created, this configuration could recovery some items of /etc/profiles by using “unset” command.

If we want to make the two files actively right now, log in again or issue the following commands: # ./pathname/file

stty, is used to set temina features. query the current configuration,executing “# stty -a”

In some cased, we need to create “.logout” file. Edit the “.profile”, and add the following line:
trap ” $HOME/.logout” 0
when the users log out, the signal “0” was passed, it meangs quit from SHELL now, and before this matter happen, “.logout” file was executed.

分类: 科技 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.
您必须在 登录 后才能发布评论.