CentOS 7 mounted windows share is read only

I mounted a Windows share on CentOS 7, but I have read only access to it. I need write access.

Commands used to mount the share...

sudo mkdir /media/shared
sudo chmod 777 /media/shared
sudo vim /etc/fstab
//192.168.16.25/shared /media/shared cifs 
username=XXXX,password=XXXX,uid=1000,gid=1000 0 0

It mounts fine, but the owner is now "admin" and it's read only...

$ ls -lrt
total 8
drwxr-xr-x 2 admin admin 4096 Aug  7 18:11 shared

And I can't change it

$ sudo chown -R root shared
chown: changing ownership of ‘shared/System Volume Information’: 
Permission denied
sudo chown: changing ownership of ‘shared’: Permission denied
$ sudo chmod 777 shared
chmod: changing permissions of ‘shared’: Permission denied

What am I missing? And on the Windows Server, the drive is shared with "Everyone" with full access.

Fixed! Here is the solution to what I changed the config to in fstab...

//192.168.16.25/shared /mnt/shared cifs username=XXXX,password=XXXX,uid=0,gid=0,file_mode=0777,dir_mode=0777 0 0
1
задан 8 August 2017 в 18:28
1 ответ

cifs-utils RPM အထုပ်၏အစိတ်အပိုင်းဖြစ်သော mount.cifs လက်စွဲ ရှိဖိုင်ပိုင်ဆိုင်မှုနှင့်ခွင့်ပြုချက်များကိုဖတ်ပါ။ ခွင့်ပြုချက်များ

အဓိက CIFS protocol သည်ဖိုင်များနှင့်လမ်းညွှန်များအတွက် unix ပိုင်ဆိုင်မှုသတင်းအချက်အလက် သို့မဟုတ် mode ကိုမပံ့ပိုးပါ။ ဤအကြောင်းကြောင့်ဖိုင်များနှင့်လမ်းညွှန်များသည် uid = သို့မဟုတ် gid = ရွေးစရာများကိုသတ်မှတ်ပြီးမည်သည့်တန်ဖိုးများကိုမဆိုပိုင်ဆိုင်ကြောင်းတွေ့ရလိမ့်မည်၊ ခွင့်ပြုချက်ကိုမူသတ်မှတ်ထားသည်။ file_mode တောင်ပေါ်မှာ နှင့် dir_mode ။ ဤတန်ဖိုးများကို chmod / chown မှတဆင့်ပြောင်းလဲရန်ကြိုးစားခြင်းသည်အောင်မြင်လိမ့်မည်။ သို့သော်အကျိုးသက်ရောက်မှုမရှိပါ။

...

အခြေခံအားဖြင့်သင်သည်တိကျစွာအတင်းအကျပ်ပြုလုပ်ရန် mount options uid = 1000, gid = 1000 ကိုအသုံးပြုနေသည်။ သင်၏အစုရှယ်ယာပိုင်ရှင်သည်သင်၏ chown command ကိုပျက်ကွက်စေသည်။ အကယ်၍ သင်သည်ပိုင်ရှင်အားပြောင်းလဲလိုပါကမှန်ကန်သောပိုင်ရှင်နှင့်အစုရှယ်ယာကို uid = ?, gid =? mount / etc / fstab တွင် တွင်အစားထိုးခြင်းဖြင့်အစပျိုးပါ။ chown chmod အစား file_mode =? နှင့် dir_mode =? chown chown အသုံးပြုရန်။

2
ответ дан 3 December 2019 в 20:20

Теги

Похожие вопросы