User Environments

16 185 0
User Environments

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

The Saigon CTT User Environments The Saigon CTT  Objectives Objectives  Construct different login profiles and user accounts  Define, and modify user environments  Security issues The Saigon CTT  Login Shells Login Shells  Shell  an interface between the user and system (kernel).  reads commands from the user and executes appropriate programs  Shell is not implemented as part of OS kernel. The shells is a user-level program. Administrator can replace the standard shell by another shell.  There are many shells on Linux: • Bourne Again Shell (bash) : A superset of the commands of the origin Bourne shell, also implements features of csh and ksh • tcsh : A superset of the commands of the origin C shell • Public-domain Korn shell (pdksh): • zsh : similar to the ksh with many enhencements The Saigon CTT  Environment Files Environment Files  When bash is executed at login time, two initialization files are executed :  /etc/profile : system-wide initialization file  ~/.bash_profile or ~/.bash_login or ~/.profile : personal initialization file  These files :  Contains system commands  Provide a common environment for all users  Set a user-customized environment  Contain user commands and definitions The Saigon CTT  Environment Files Environment Files SYSTEMWIDE: /etc/profile /etc/bashrc USER 1 ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc ~/.bash_logout ~/.inputrc USER 2 ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc ~/.bash_logout ~/.inputrc USER 3 ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc ~/.bash_logout ~/.inputrc The Saigon CTT  Environment Files Environment Files login /etc/profile ~/.bash_profile ~/.bash_profile ~/.bash_login ~/.bash_login ~/.profile ~/.bashrc ~/.bash_logout /etc/bashrc yes yes no no bash start logout The Saigon CTT  /etc/profile Script  The /etc/profile do : o Exports environment variables such as LOGNAME for login name o Exports PATH for the default command path o Set some useful aliases o … The Saigon CTT  User-Specific Initialization Files  The user-specific initialization file(s) are stored in the home directory of the user. These initialization files can perform all or part of the following: o Set the default prompt o Define the default printer o Set default permissions o Tell the shell where to look for new mail (in MAIL=…) o Set noclobber to prevent overwriting of files during redirection o Set the command path to the user’s specification o Set up custom commands The Saigon CTT  Environment Files Environment Files  bash will follow a particular sequence to initiate non-login shells ( e.g open a terminal session or sub-shell bash )  bash will look for the environment file ~/. bashrc and execute it  If BASH _ENV has been assigned with an alternative file, that file is executed The Saigon CTT  Login sequence [...]... the Day (motd)  /etc/motd: print to a user' s terminal after a successful login and before executing the user' s login shell  Keep message short and up to date, otherwise users will stop reading it # more /etc/motd Welcome to Acme's Development System Access to this system is restricted to authorized users only Unauthorized access is prohibited and offenders are liable to prosecution The Saigon CTT ... for security holes  Find out about networked machines (/etc/hosts)  Access the network via telnet or rlogin The Saigon CTT  Summary  Construct different login profiles and user accounts  Define, explain, and modify user environments  Explain security issues ... Each user s environment will be established and customized to reflect their requirements  To see all of your current variable settings (local), execute command set without any options  to see the settings of all of those definitions in your current environment that have been exported (global), use the commands printenv or env The Saigon CTT Message of the Day (motd)  /etc/motd: print to a user' s...The Saigon CTT  Initialization Files Read Process The Saigon CTT  Environment Definitions  Most users will need to modify some of environmental definitions to suit their requirements: PATH=$PATH: Include required search directories PS1=“[\u@\h \W] \$” The interactive shell prompt . Saigon CTT User Environments The Saigon CTT  Objectives Objectives  Construct different login profiles and user accounts  Define, and modify user environments. system commands  Provide a common environment for all users  Set a user- customized environment  Contain user commands and definitions The Saigon CTT  Environment

Ngày đăng: 24/06/2013, 01:25

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan