免费注册 查看新帖 |

Chinaunix

广告
  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1291 | 回复: 1
打印 上一主题 下一主题

菜鸟问一个很简单的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-10 17:54 |只看该作者 |倒序浏览
想把一个用户的umask设置成333,应该怎么设?

是不是直接在.bash_profile上修改

论坛徽章:
0
2 [报告]
发表于 2007-10-10 18:14 |只看该作者
We want to keep our system as secure as possible. To do this, we must change the
default permissions users have for new files and directories they make. We’ll set all
new files and directories to No Access to group or other members.
1.  Edit the /etc/bashrc file. Two lines in the file set the umask. One of the two
lines is selected depending on the if statement above them. See if you can
determine which line gets executed for an average user.
2.  The if statement tests to see if the user ID (uid) and group ID (gid) are the
same, and that the uid is greater than 99. If this is true, then the first umask
is executed; otherwise, the second is executed. The second umask is for root
and other key system accounts. The first is for users.
3.  Change the first umask statement to exclude all permissions for groups and
others. Use umask 077 to do the job.
4.  Save and exit the file.
5.  Log in as a nonprivileged user. Use the touch command to make a new empty
file. Use ls -l to verify the permissions.
6.  Log in as root. Again, use the touch command to make a new empty file and
use ls -l to verify their permissions.
You have just changed the default umask for all shell users.


希望对你有帮助
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP