[英]Setting permissions for a user on linux system so they cannot access parent directory
I create a user with useradd and edited the /etc/passed file but the user can still see parent and can go in to parent directorys 我使用useradd创建了一个用户,并编辑了/ etc / passed文件,但该用户仍然可以看到父目录,并且可以进入父目录
how can I restrict him from going into parent directory. 如何限制他进入父目录。
Why do you want that? 你为什么要那样? What are exactly the parent directory?
父目录到底是什么?
Often, the home directory of user foo
is ~foo
ie /home/foo
通常,用户
foo
的主目录是~foo
即/home/foo
It depends upon the permissions on others home directories. 这取决于对其他主目录的权限。 So if there is user
bar
you might chmod o-rwx /home/bar
; 因此,如果有用户
bar
,则可以使用chmod o-rwx /home/bar
; and you could set up groups and group permission, etc... 您可以设置组和组权限等。
Or perhaps try (with caution and care) chmod o-rwx /home/
或尝试(小心谨慎)
chmod o-rwx /home/
You could also use some restricted shell for foo
eg rbash or rssh , configure it wisely, and chsh foo /bin/rbash
您还可以对
foo
使用一些受限制的shell ,例如rbash或rssh ,进行明智的配置,然后chsh foo /bin/rbash
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.