linux给目录修改属主,在挂载的目录下 如何使 文件或目录的属主 变成 创建者的...

fujiefujie 于 2011-01-13 01:35:28发表:

以下是我的实验过程:

[root@localhost /]# useradd ggg

[root@localhost /]# passwd ggg

Changing password for user ggg.

New UNIX password:

BAD PASSWORD: it is WAY too short

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

[root@localhost /]# tail -1 /etc/passwd

ggg:x:502:502::/home/ggg:/bin/bash

[root@localhost /]# mkdir ggg

[root@localhost /]# ls ./

bin etc lib misc net root srv tmp var

boot ggg lost+found mmm opt sbin sys ttt

dev home media mnt proc selinux tftpboot usr

[root@localhost /]# chmod 777 ggg

[root@localhost /]# ls -ld /ggg

drwxrwxrwx 2 root root 4096 01-13 01:28 /ggg

[root@localhost /]# mount -o uid=501,gid=501 /dev/web/web_v1 /ggg

[root@localhost /]# cd ggg

[root@localhost ggg]# ls -ld ./

drwxrwxrwx 4 root root 4096 01-13 01:25 ./

[root@localhost ggg]# su sunyu

[sunyu@localhost ggg]$ ls -ld ./

drwxrwxrwx 4 root root 4096 01-13 01:25 ./

[sunyu@localhost ggg]$ cd /

[sunyu@localhost /]$ ls -ld /ggg

drwxrwxrwx 4 root root 4096 01-13 01:25 /ggg

[sunyu@localhost /]$ cd ggg

[sunyu@localhost ggg]$ mkdir ggg

[sunyu@localhost ggg]$ ls -ld ggg

drwxrwxr-x 2 sunyu sunyu 4096 01-13 01:32 ggg

[sunyu@localhost ggg]$ cd ggg

[sunyu@localhost ggg]$ touch ggg

[sunyu@localhost ggg]$ ls

ggg

[sunyu@localhost ggg]$ ls -l ggg

-rw-rw-r-- 1 sunyu sunyu 0 01-13 01:32 ggg

[sunyu@localhost ggg]$

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值