Linux

ssh guest 격리 (chroot)

Segel 2021. 3. 12. 08:35

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/

반응형