第一中種方法:linux
Linux中啓動shell,輸入以下命令:ios
mount -t cifs -o username="my-pc-name",password="my-password" //my-ip-addr/sharefolder /mnt/my-linux-sharefoldershell
回車,ok。服務器
第二種方法:ui
1. linux的/etc/smb.conf備份,而後touch smb.conf一個新文件。server
2. vi smb.conf以下:ip
[global]ci
workgroup = SMBMEstring
netbios name = linuxsambait
server string = LinuxSambaMe
security = share
[SMBME]
path = /opt/mysambafolder
writeable = yes
browseable = yes
guest ok = yes
註釋:workgroup:Windows中輸入linux的ip後顯示的文件夾名稱(須要大寫,Windows顯示爲小寫);
netbios name:Windows中顯示出的linux計算機名稱;
server string:samba服務器說明,隨便定義;
security:驗證和登錄方式,這裏用share方式,不須要設置用戶名和密碼;
path:linux中的共享目錄
3. mkdir -p /opt/mysambafolder
4. id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)
5. chown -R nobody:nobody /opt/mysambafolder
6. smbd
7. nmbd
ok啦。Windows裏面輸入\\linux-ip,回車,看到「smbme」文件夾了。