環境:x台windows,x台linux
linux 是ubuntu的機器。
主機環境ubuntu 10.04
解決檔案分享權限設定的問題:
1、samba伺服器的搭建(linux上的檔案系統)
apt-get --purge remove samba-common smbclient samba刪除ubuntu自己的smb,
apt-get install smba smbfs
apt-get install samba smbfs(10.10)
#cat /etc/samba/smb.conf
###
[global]
workgroup = WORKGROUP
security = share
guest ok = yes
[share]共用在網路上看到的檔案名稱
path = /work本地的路徑
browseable = yes
writeable =yes
檔案結束。
配置二,有使用者權限的。
[global]
workgroup = WORKGROUP
security = user
guest ok = yes
[share]共用在網路上看到的檔案名稱
path = /work本地的路徑
browseable = yes
writeable =yes
出於安全問題,需要為samba配置密碼:
$ smbpasswd -a <username>
按提示輸入想使用的密碼即可
另外 /etc/samba/smb.conf 的 [global] 段必須有:
security = user
測試命令:#testparm
#/etc/init.d/smbd restart
1.1、windows訪問:
serverip 是192.168.0.10
在win的命令輸入口 寫入\\192.168.0.10
1.2、linux訪問:
mount.cifs 依據smbfs軟體包。。。。。
mount.cifs //192.168.0.10/share ./ss -o user=username%password
mount.cifs //192.168.0.10/share ./ss -o user=, pass=, 匿名並無密碼訪問(widows掛載也是如此)
window XP 共用檔案的設定:工具-》檔案夾選項-》查看-》使用簡單檔案分享權限設定。必須選上。否則上面命令NG。
或者:輸入smb://192.168.0.10
2、nfs檔案系統的搭建(linux上的檔案系統)
2.1、#apt-get install nfs-kernel-server
#gedit /etc/profile
檔案內容:/work *(rw,sync,no_root_squash)
#/etc/init.d/nfs-kernel-server restart
#exportfs -ra
2.2、linux機器掛載mount -t nfs 192.168.0.10:/work ./ss
3、tftp
#apt-get install tftpd-hpa tftp-hpa
#gedit /etc/default/tftpd-hpa
TFTP_OPTIONS="-l -c -s"
#service tftpd-hpa restart
(1). 掛載遠程ftp目錄
sudo apt-get install curlftpfs #安裝軟體
curlftpfs user:pass@ftp.yourdomain.com ~/ftpfolder/ #掛載過程,如果掛載windows下的ftp伺服器目錄,可能會顯示亂碼,可以使用參數 -o pagecode gbk等方式轉碼。
如果ftp沒有密碼就直接
eg:
curlftpfs ftp://ftp.hrbeu.edu.cn ~/ftp -o codepage=gbk
卸載ftp如下
sudo umount ~/ftpfolder/
PS:可以加入fstab中,來自動掛載