參考資訊:
https://unix.stackexchange.com/questions/199960/login-to-users-session-with-chroot
問題如下:
bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell
解法如下:
# 修改前 sudo chroot $MYDIR su - xxx /bin/su # 修改後 sudo chroot $MYDIR /bin/su - xxx