쉘(shell)은 크게 로그인 쉘, 비 로그인 쉘, 서브 쉘로 나뉩니다. 이번에는 로그인 쉘에 대해 알아보았습니다.
로그인 쉘은 로그인할 때 수행되는 기본 쉘입니다. 기본적으로 로그인할 때 로드되는 파일은 /etc/profile 와 ~/.profile이 있습니다.
로그인하여 bash가 처음 시작할 때(login shell)일 때, 다음의 스크립트 파일들을 수행하여 환경을 설정합니다.
/etc/profile
~/.bash_profile or ~/.bash_login or ~/.profile
~/.bashrc
/etc/bashrc
/etc/profile와 .profile은 shell이 bash가 아니더라도 로그인하면 로드되어 적용되고 .bashrc 와 .bash_login, .bash_profile은 bash shell로 로그인 되었을 경우만 적용이 됩니다.
root유저로 일반 계정(hello)을 생성 후 일반계정(hello)으로 접속했을 때 /etc/profile, ~/.bash_profile을 자동 로드 한다는건 이해했습니다.
hello 계정에서 로그아웃시에는 바로 bash 로그아웃 스크립트로 가는 것 같은데 비로그인 쉘은 어떻게 해야 진입할 수 있나요?