ch04 user environments

Upload: m3onh0x84

Post on 30-May-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Ch04 User Environments

    1/10

  • 8/9/2019 Ch04 User Environments

    2/10

    SAIGONLAB83 Nguy n Th Nh , P9, Q.Tn B nh, Tp. HCM LPI 102

    Login ShellEnvironmentSecurity IssuesSummary

  • 8/9/2019 Ch04 User Environments

    3/10

    SAIGONLAB83 Nguy n Th Nh , P9, Q.Tn B nh, Tp. HCM LPI 102

    L ogin Shell

    Linuxs interactive command interpreter.Provide a layer around the system functions,invokecommandsThe mean interactive users access to many utilitiesShell not a part of the operating system kernelLinux provide three standard shells

    Bourne again shell (bash)tcshksh

  • 8/9/2019 Ch04 User Environments

    4/10

    SAIGONLAB83 Nguy n Th Nh , P9, Q.Tn B nh, Tp. HCM LPI 102

    Environment

    Two file executed when login:The system-wide initialization file /etc/profileThe personal initialization file ~/.bash_profile or

    ~/.bash_login or ~/.profile.Contain system commandsProvide a common environment for all users

    Set a user-customized environmentContain user commands and definitions

  • 8/9/2019 Ch04 User Environments

    5/10

    SAIGONLAB83 Nguy n Th Nh , P9, Q.Tn B nh, Tp. HCM LPI 102

    Environment

    Interactive non-login shells:Bash look for the environments ~/.bashrc andexecute it.Execute file was assigned by BASH_ENVExecute file was assigned by ENVExecute /etc/bashrc file

    /etc/profile and /etc/bashrc files contain system-widecommands.$HOME/.bash_profile,.bash_login,.profile,.bashrc,.bash_logout contain users initialization

  • 8/9/2019 Ch04 User Environments

    6/10

    SAIGONLAB83 Nguy n Th Nh , P9, Q.Tn B nh, Tp. HCM LPI 102

    Environment

    Environment Definition: user modify some of theenvironmental definitions to suite their requirements.PATH=$PATH:/usr/X11R6/binBASH_ENV=$HOME/.bashrc

    SHELL=/bin/bashPS1=[\u@\h\w]\$VISUAL=viMAIL=/var/spool/mail/$LOGNAME

    The umask commandumask plain text file (vi)000 rw-rw-rw-022 rw-rr

  • 8/9/2019 Ch04 User Environments

    7/10

    SAIGONLAB83 Nguy n Th Nh , P9, Q.Tn B nh, Tp. HCM LPI 102

    Security Issues

    Under traditional UNIX message of the day (motd)store in /etc/motd. Login program printed themessage of the day affter a successful login and

    before executing users login shell.Under linux motd be configurable through PAM(pluggable authentication modules) by addingapropriate references to pam_motd.so in /etc/pam.d

  • 8/9/2019 Ch04 User Environments

    8/10

    SAIGONLAB83 Nguy n Th Nh , P9, Q.Tn B nh, Tp. HCM LPI 102

    Security Issues

    Guest account with null password be a security risk,usually set disableSystem hacker logging as guest can:

    Get list of login name (/etc/passwd)Use find to look for security holesFind out about networked machines (/etc/hosts)Access the network via telnet or rlogin

  • 8/9/2019 Ch04 User Environments

    9/10

    SAIGONLAB83 Nguy n Th Nh , P9, Q.Tn B nh, Tp. HCM LPI 102

    Security Issues

    SGID2xxx

    SUID

    4xxxSTICKY BIT

    1xxx

  • 8/9/2019 Ch04 User Environments

    10/10

    SAIGONLAB83 Nguy n Th Nh , P9, Q.Tn B nh, Tp. HCM LPI 102

    Summary

    Contrust different login profiles and user accountsDefine, explain, and modify user environmentsExplain security issues