samba文件共享出来只读遇到的坑

1.在工作遇到了samba文件共享的问题,由于我是接手别人的代码,共享出来的文件系统是只读的
2.我接手的时候需要将文件系统改成可写的
3.开始一直在调samba的配置文件user.smb.conf
1>增加了readonly = no
2>增加了writeable = yes
调试后还是只读,然后晚上各种baidu Google samba的配置文件的参数,经查了很久无果。。。。
4.实在不行boss看不下去了让一个老员工帮我看了看,结果一过来看了以前的代码
无语,挂载的时候以只读的方式挂载了,这样的话,不管你再怎么改samba的配置想要变成可写的文件系统也是白搭

#vers=3.0前面是只读的(改成了rw后就OK了)
 def mount(self):
        """
        mount -t cifs //172.29.100.100/wuo/W2003R2PAR_1_2018-08-01T20-30-38.350867
         /mnt/smb/ -o username="wuo",password="843207",iocharset=utf8
        :return:
        """
        assert self._server_ip
        cmd = r'mount -t cifs "//{samba_server}/{samba_user}/{host_name}/" "{dst_point}"' \
              r' -o username="{samba_user}",password="{samba_password}",iocharset=utf8,ro,vers=3.0'.format(
            samba_server=self._server_ip, samba_user=self._key_info['username'],
            host_name=self._key_info['hostname'], samba_password=self._key_info['userpwd'],
            dst_point=self.mount_point)
        rev = net_common.get_info_from_syscmd(cmd, timeout=5)
        return rev[0] == 0

猜你喜欢

转载自blog.csdn.net/mingtiannihaoabc/article/details/86623507
今日推荐