linux用戶登錄指定目錄


一、創建用戶和用戶組

[root@web4 lianyu]#  groupadd lianyu
[root@web4 lianyu]#  useradd lianyu -g lianyu
[root@web4 lianyu]#  passwd lianyu

二、用戶登錄指定目錄

[root@web4 lianyu]# cd /home/lianyu
[root@web4 lianyu]# ls -a
.  ..  .bash_history  .bash_logout  .bash_profile  .bashrc  .cache  CATALINA_HOME_IS_UNDEFINED  .config  .dubbo  .ssh  .viminfo

 編輯.bash_profile,來指定:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

export IPOWER_HOME=/usr/local/


PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

cd $IPOWER_HOME

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM