我试图白色列出某些SFTP请求,以便用户只能打开和读取文件和文件夹。目前,基于这个线程,我有了以下内容:
Subsystem sftp internal-sftp
Match User my-read-user
ChrootDirectory /sftp/%u
ForceCommand internal-sftp -p open,close,read,opendir,stat,readdir,fstat,lstat,statvfs,fstatvfs,readlink,realpath这似乎很好--除了一个例外:我可以创建文件,尽管我不能将任何内容放入其中。有点像touch会起作用?!
任何想法都是值得赞赏的!另外,任何更好的方法都会很好:)谢谢!
发布于 2016-11-15 11:19:09
哦,我刚刚找到了-显然-最好的解决方案:参数-R将整个会话设置为只读模式。
Match User my-read-user
ChrootDirectory /sftp/%u
ForceCommand internal-sftp -Rhttps://serverfault.com/questions/814963
复制相似问题