限制通过 cygwin sshd 的文件夹共享
我最近在 Windows 7 PC 上安装了 SSH 服务器,并为此创建了一个单独的用户帐户。当我使用 SSH 登录时,我可以访问所有 Windows 目录。
/cygdrive/c
/cygdrive/d
/cygdrive/e
我如何阻止该用户访问除 cygwin /home/chuck/ 下的主目录之外的所有 win 目录?
最好我什至不希望用户查看 /当用户输入“mount”时,cygdrive。
有没有简单的方法可以做到这一点?
我想稍后允许远程用户登录到这台计算机并避免搞乱其他事情。
我知道我可以设置一台单独的计算机,但这是以后的计划。
I recently installed a SSH server on my Windows 7 PC and created a separate user account for this. When i logged in using SSH, i could access all the windows directories.
/cygdrive/c
/cygdrive/d
/cygdrive/e
How do i prevent this user from accessing all the win directories other than its home directory under cygwin /home/chuck/ ?
Preferably i do not want the user to even view /cygdrive when the user types "mount".
Is there a easy way to do this?
I want to later allow remote users to log on to this machine and avoid messing up other things.
I know i can setup a separate machine but this is a plan for later.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不太了解 Cygwin,但在 Unix 中通常你可以使用 chroot 。
I don't know specifically about Cygwin but in Unix in general you could use the chroot.
尝试将 ssh_user_name 的组更改为 Guest,然后通过 Windows 中的安全选项卡专门允许 Guest 组的 rwx 权限。我以前没有尝试过这个,我很快就会尝试一下。这应该比通过添加 ssh_user_name 来拒绝对每个驱动器的访问更容易,如果您像我一样有很多驱动器,那么效率非常低。
我选择 guest 的原因是因为默认情况下它会拒绝所有访问,这使得更容易专门选择您希望 ssh_user_name 有权访问的驱动器。
try changing the group of the ssh_user_name to Guest, then specifically allow rwx perms for the Guest group through the security tab in Windows. I have not tried this before, which I am going to try soon. This should be easier than denying access to each drive by adding the ssh_user_name, which is highly inefficient if you have many drives like I do.
The reason why i chose guest is because by default it is denied all access, which makes it easier to specifically choose which drive you want the ssh_user_name to have access to.