By default, Samba requires you to configure a password for use when accessing the shares from other computers. (In a later part of this series we'll discuss advanced sharing configuration, like guest shares) This will be, for example, the password you'll use in conjunction with your Ubuntu username when prompted to enter logon credentials after double-clicking a computer icon in the My Network Places or Network window in Windows.
Creating a username for Samba only takes one line of code in Terminal:
sudo smbpasswd -a usernameand hit the Enter key.
Replace the word username above with the login or user name of your Ubuntu account, as you can see in the example shown in Figure 2.
If Terminal comes back and says
sudo: unable to resolve host <your domain/workgroup name | , you'll need to refer to the next set of steps before moving on.
If you received the
unable to resolve host error after executing the smbpasswd command, it's probably because you were fiddling around with settings and you specified a Domain Name in the General tab of the Network Settings. (We discuss changing the Workgroup value later.) Yet you can revert to being domain name-less (so you can continue setting up SMB) by editing the hosts file. Here's exactly how to perform the fix:
sudo gedit /etc/hostsand hit the Enter key.
account passwordand hit the Enter key.
The text editor should pop-up with the hosts file opened.