找回密码
 FreeOZ用户注册
查看: 2394|回复: 6
打印 上一主题 下一主题

[Linux] 问题又来了,还是关于mount的

[复制链接]
跳转到指定楼层
1#
发表于 15-12-2010 20:08:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?FreeOZ用户注册

x
上次问过关于NAS上目录的mount的问题后,虽然成功放到了fstab里并成功在开机时mount了,但问题随之来了,我ls发现mount的目录下所有文件的属性都是root/root,因为一般在ubuntu登录不是用root的,所以实际上还是没法用,这是怎么回事呢?而且我在ubuntu下用sudo还没法改,怎么弄啊?? 高手指点一下
回复  

使用道具 举报

2#
 楼主| 发表于 15-12-2010 20:12:10 | 只看该作者
补充一点,我用ssh进到NAS里看到的原本的文件的属性并不是root/root的,而是我在建那个目录时用的用户名。
回复  

使用道具 举报

3#
发表于 16-12-2010 00:01:26 | 只看该作者
回复  

使用道具 举报

4#
 楼主| 发表于 16-12-2010 08:52:13 | 只看该作者


唉,mount的说明看了几遍,没有我要的答案啊

是不是其它文件系统的,比如fat或者samba下面的目录,mount过来就都是root/root呢??

如果在gui下,如果打开我nas上相同的目录,onwer和group项都是unkown,但我不知道gui下是按什么指令mount的,有什么办法能查到么?
回复  

使用道具 举报

5#
发表于 16-12-2010 11:48:06 | 只看该作者
手工改一下。用root用户把nfs mount目录修改成
chmod -R your_id:your_group nfs_mount_dir

然后再重启看看是否已经正确了。
回复  

使用道具 举报

6#
 楼主| 发表于 16-12-2010 14:29:59 | 只看该作者
原帖由 李大锤 于 16-12-2010 12:48 发表
手工改一下。用root用户把nfs mount目录修改成
chmod -R your_id:your_group nfs_mount_dir

然后再重启看看是否已经正确了。


"而且我在ubuntu下用sudo还没法改,我用的命令是:
sudo chown my_name:my_group filename

没有任何错误提示,但就是执行完后什么都没变
我改单个文件都没有改成功,更别说目录了
回复  

使用道具 举报

7#
发表于 19-12-2010 12:32:29 | 只看该作者
提示: 作者被禁止或删除, 无法发言
原帖由 四香油饼 于 15-12-2010 21:08 发表
上次问过关于NAS上目录的mount的问题后,虽然成功放到了fstab里并成功在开机时mount了,但问题随之来了,我ls发现mount的目录下所有文件的属性都是root/root,因为一般在ubuntu登录不是用root的,所以实际上还是没法 ...


If your NAS Server is LInux NFS exports.

http://linux.die.net/man/5/exports

User ID Mapping

nfsd bases its access control to files on the server machine on the uid and gid provided in each NFS RPC request. The normal behavior a user would expect is that she can access her files on the server just as she would on a normal file system. This requires that the same uids and gids are used on the client and the server machine. This is not always true, nor is it always desirable.
Very often, it is not desirable that the root user on a client machine is also treated as root when accessing files on the NFS server. To this end, uid 0 is normally mapped to a different id: the so-called anonymous or nobody uid. This mode of operation (called 'root squashing') is the default, and can be turned off with no_root_squash.

By default, exportfs chooses a uid and gid of 65534 for squashed access. These values can also be overridden by the anonuid and anongid options. Finally, you can map all user requests to the anonymous uid by specifying the all_squash option.

Here's the complete list of mapping options:

root_squash
Map requests from uid/gid 0 to the anonymous uid/gid. Note that this does not apply to any other uids that might be equally sensitive, such as user bin.
no_root_squash
Turn off root squashing. This option is mainly useful for diskless clients.
all_squash Map all uids and gids to the anonymous user. Useful for NFS-exported public FTP directories, news spool directories, etc. The opposite option is no_all_squash, which is the default setting.
anonuid and anongid
These options explicitly set the uid and gid of the anonymous account. This option is primarily useful for PC/NFS clients, where you might want all requests appear to be from one user. As an example, consider the export entry for /home/joe in the example section below, which maps all requests to uid 150 (which is supposedly that of user joe).
回复  

使用道具 举报

您需要登录后才可以回帖 登录 | FreeOZ用户注册

本版积分规则

小黑屋|手机版|Archiver|FreeOZ论坛

GMT+10, 20-4-2024 04:58 , Processed in 0.022836 second(s), 25 queries , Gzip On, Redis On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表