設定ftp/sftp連線到chroot目錄

ftp可以用vsftpd設定chroot,網路上很多文章可以參考

ref: http://unix.stackexchange.com/questions/94603/limit-ftp-access-only-to-the-var-www-with-vsftpd

不過我設定之後,只要改變資料夾就會出現550 permission denied,要傳檔案也是553,應該是權限問題,最後放棄。

sftp可以設定sshd_config

Match group [sftp]
  ChrootDirectory [/home/%u]
  AllowTcpForwarding no
  ForceCommand internal-sftp

改好之後再restart sshd

ref: http://serverfault.com/questions/448647/symbolic-link-and-filezilla-over-sftp

如果chroot directory裡面有symbolic link的需求可以用mount –bind [來源路徑] [目的路徑],就可以了。

Comments

comments

Leave a Reply

Your email address will not be published. Required fields are marked *