一、組網(wǎng)圖
不涉及。
二、問(wèn)題描述
Linux客戶(hù)端掛載CIFS共享且可正常寫(xiě)入文件,但修改文件屬主報(bào)“ ”。
-bash-4.1# mount -t cifs -o username=vsphere6/administrator,password=P@ssw0rd //172.0.120.50/SMB /mnt -bash-4.1# ll /mnt/total 0 -rwxrwxrwx 1 1002689 1000000 0 Jun 13 17:43 1 -bash-4.1# chown -R root:root /mnt/1 chown: changing ownership of `/mnt/1': Permission denied
三、過(guò)程分析
1、Linux系統(tǒng)與的ACL機(jī)制不同共享目錄去除寫(xiě)入權(quán)限有什么壞處共享目錄去除寫(xiě)入權(quán)限有什么壞處,CIFS常用于系統(tǒng)之間的共享;初步判斷平臺(tái)ACL機(jī)制不同導(dǎo)致權(quán)限無(wú)法修改。
四、解決方法
由于用戶(hù)需求需明確修改文件屬主為root:root;建議采用如下方法解決:
1、查看Linux系統(tǒng)的root用戶(hù)及組的uid、gid;
-bash-4.1# id root uid=0(root) gid=0(root) groups=0(root)
2、使用指定的root用戶(hù)的uid、gid掛載CIFS共享。
-bash-4.1# mount -t cifs -o uid=0,gid=0,username=vsphere6/administrator,password=P@ssw0rd //172.0.120.50/SMB /mnt
3、查詢(xún)掛載目錄文件屬主均為root:root
-bash-4.1# ll total 0 -rwxrwxrwx 1 root root 0 Jun 13 17:48 1
五、風(fēng)險(xiǎn)提示
每個(gè)共享目錄只能指定一個(gè)uid、gid掛載,該方法只能規(guī)避無(wú)法修改權(quán)限問(wèn)題;建議Linux客戶(hù)端采用NFS共享協(xié)議掛載。
友情鏈接: 餐飲加盟
地址:北京市海淀區(qū) 電話(huà):010- 郵箱:@126.com
備案號(hào):冀ICP備2024067069號(hào)-3 北京科技有限公司版權(quán)所有