- 論壇徽章:
- 0
|
如何在Windows和Linux中共享文件?samba也許是個不錯的選擇。但是我用的CentOS5中若用smbfs就是一個“Wrong fs type”。仔細(xì)查找了相關(guān)資料,找出幾個解決方法:
1 mount -o username=your_name,password=your_password //server/share_folder /mount_point
2 mount -t cifs username=your_name,password=your_password //server/share_folder /mount_point
這兩種方法本質(zhì)都一樣,但要注意your_name用戶必須對share_folder擁有完全操作的權(quán)限,當(dāng)然若要只讀甚至隨便亂寫個用戶名密碼都可以。
3 寫到/etc/fstab文件中,在該文件最后添加一行:
//server/share_folder /mount_point cifs username,password,rw
這樣還是有個缺點,即用戶名和密碼都以明文的方式暴露了,還可以這樣:
4 編輯/etc/fstab,按如下格式添加:
//server/share_folder /mount_point cifs credential=/root/credential
而/root/credential中內(nèi)容如下:
useername=your_name
password=your_password
但是還有個問題,普通用戶是無權(quán)使用mount的,
5 使用sudo
6 對mount.cifs添加suid。
本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u2/69551/showart_1276202.html |
|