2021年2月3日 星期三

ubuntu connect to windows file share

Trying to link to a Git repo on NAS folder, where I have no authority to run a Git server.

first, init a bare Git repo on server,

for windows, there's no problem that a can mount the folder on NAS and clone the Git repo. (need some Git config tweak to push)

But I encounter a problem that I can't directly write to the path where I mount the smb:\\ on Ubuntu, which make Git clone failed.

here's how I solves it


install cifs-utils

$ sudo apt install cifs-utils
$ sudo mount.cifs //$IP/$Resource /mnt/samba -o user=$username,domain=$domainName

you can use smbclient to check samba connection and resource first

$ sudo apt install smbclient
$ sudo smbclient -L $IP -W $domainName -U $userName


在ubuntu上git push到NAS上的資料夾會因為權限問題push不上去 

嘗試著用 chmod 更改權限失敗
目前work around 是用
$ sudo git push 
在掛載時加入dir_mode=0777,file_mode=0777設定權限
或加入noperm參數(ref)

沒有留言:

張貼留言