原文链接:
Filesharing Between Windows and Ubuntu 11.10 (Oneiric Ocelot)
This short guide shows you how to enable file sharing between Windows and Ubuntu 11.10 machines easily. We have covered a lot on this topic already and this is just a continuation. Our goal today is to have users on either machine access and edit files and folders on the other machine. For all this to work, we’ll be configuring our systems to allow file sharing using the same protocol. For Ubuntu systems, Samba will be used to allow both systems to share files and folders.
Objectives:
- Add Ubuntu systems to Windows Workgroup
- Configure Windows system to allow file sharing
- Add Ubuntu users to Samba user database
- Access files and folders from either system
Our first objective is to add Ubuntu systems to Windows’ Workgroup. To find out which workgroup Windows belongs, type the command below:
net config workstation
Take notes of Windows workgroup name and continue below.
Next, open the terminal in Ubuntu and type the command below to install ‘Samba Config’
Then open ‘Dash’ and select ‘Samba’
When Samba opens, select ‘Preferences –> Server Settings’
Then enter the Windows workgroup name here and click ‘OK’
After that, logon to Windows and in the search box, type ‘Manage advanced sharing settings’
From there. enable ‘file and printer sharing’ for Home and Work networks.
When all computers are restarted you should begin to see each machine in the workgroup on all systems that are member of the group.
Now all you need to do is create shares (resources) on each system to share.
Things to remember:
- Make sure the admin account on the Windows machines has password assigned.
- You must share at least one file or folder on the Windows machine in order to open the Windows shares from Ubuntu. I had a problem when accessing the Windows shares from Ubuntu. It displays error ‘Cannot list shares from server’
- Add your Ubuntu account to Samba user database in order to access Ubuntu shares from Windows machines.
In order to access Ubuntu shares from Ubuntu, you must add your Ubuntu account to Samba user database. To do that, run the command below:
sudo smbpasswd USERNAME -a
That’s all it. Now you can go back to each system and begin sharing files. In Ubuntu, open Samba and click ‘Add’ to add shares (folders) so Windows machines can access it.
对于域账号共享模式下的问题解决:
在Ubuntu访问windows network出现domain名称后,弹出错误:Unable to mount location...
解决办法如下:
I've had very good results in mixed network environments (window-ubuntu) with this method:
1) Press alt+F2 >> type gksu gedit /etc/nsswitch.conf
2) Look for this line: hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
3) Add "wins" so it looks like this: hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4
4) Install the "winbind" package: sudo apt-get install winbind (or via software center or synaptic)
5) Reboot or restart your network
重启Ubuntu 之后,一切正常。