When you’re new to Ubuntu, these are some of the tasks you would want to perform. Tasks such as changing your computer name (hostname), connecting to Windows shares (file sharing) and changing your workgroup name are just a few. This brief tutorial shows you how to change your system name, your workgroup name and how to configure Ubuntu to access Windows shares easily. If not configured correctly, you may get errors such as ‘failed to retrieve share list from server’ and you don’t want that. Without wasting your precious time, lets’ get going.
Objectives:
- Change computer name in Ubuntu 12.04 (Precise Pangolin)
- Change Workgroup name
- Connect to Windows shares
Changing Your Hostname
To change your hostname in Ubuntu 12.04, press Ctrl – Alt – T on your keyboard to open Terminal. When it opens, run the commands below to open the hostname file.
sudo gedit /etc/hostname
Then change whatever in the file to what you want your computer new name to be and save it.
Next, open the hosts file by running the commands below.
sudo gedit /etc/hosts
Change the second line to match your computer new name and save.
Changing your computer workgroup name (domain name)
To change you computer workgroup name in Ubuntu, open the terminal and run the commands below to edit smb.conf file.
sudo gedit /etc/samba/smb.conf
Finally, change the workgroup name value and add the line shown below as well.
name resolve order = bcast host
Filesharing with Windows systems
To share files with Windows system, run the commands below to install Samba. This will enable file sharing.
sudo apt-get install system-config-samba
If Ubuntu and your Windows machine are in the same workgroup and LAN, you should be able to see your Windows machine from nautilus.
To access Ubuntu shares from Windows, you must add your account to Samba database. To do that, run the commands below.
sudo smbpassed -a USERNAME
Enjoy!