April 23, 2009

Understand linux user login Scenario

Usually useradd OR adduser and passwd commands are used for creating an entry for a user in /etc/passwd, /etc/shadow and /etc/group files. However, adding user in files may not provide all the functionality needed. You need to set user customization by modifying various scripts located at /etc or ~/ (user home directory). These scripts executed at the start of every console (text based) login or ssh session to setup the user's environment.

Typical UNIX / Linux login scenario

User login / SSH Login
|
|
System login script /etc/profile
|
|
Personal login script $HOME/.profile
|
|
Shell startup script $HOME/.bash_profile $HOME/.shrc
|
|
User logged in (login complete)

You can add system wide customization using /etc/profile file. End users can manage their own profile / custom environment using personal login script or shell startup script.

No comments:

Post a Comment