1. guest 계정 생성
2. 홈 디렉토리 '/' 로 지정
3. /etc/ssh/sshd_config 수정:
Match User guest
#guest 부분에 계정명 입력
ChrootDirectory /home/guest
#격리할 디렉터리 지정
4. bash 등 필요한 명령어 복사
!) vim - terminfo 복사하지 않으면 키들이 정상 작동하지 않음 https://unix.stackexchange.com/questions/455276/bash-in-chroot-strange-key-movements
참고: www.tecmint.com/restrict-ssh-user-to-directory-using-chrooted-jail/
반응형
'Linux' 카테고리의 다른 글
Linux Omnisharp에서 C# WPF 개발 (빌드) (0) | 2022.06.01 |
---|---|
vim-gutentags 저장 시 오류 (0) | 2022.04.24 |
WSL2 /etc/wsl.conf 변경점이 적용되지 않음 (0) | 2021.10.05 |
특정 디렉터리를 제외한 디렉터리에서 탐색 (0) | 2021.03.15 |
WSL2 Ubuntu 시작 시 /var/run/utmp 파일을 생성하지 않음 (0) | 2021.03.13 |
chroot 사용시 bash 정상 작동하지 않음 (0) | 2021.03.12 |
WSL2 권한 실수 해결 (0) | 2021.03.10 |