PDA

View Full Version : [ubuntu] How do I set my system name & workgroup?



bamim2
January 7th, 2013, 05:43 PM
I've just installed Ubuntu 12.10 & I have a couple of things I need to set correctly:
1) I need to change my system name / hostname.
2) I need to set my workgroup to match my Windows workgroup name.

If somebody could please walk me through doing those things, I would really appreciate it.

-THX-

haqking
January 7th, 2013, 05:46 PM
I've just installed Ubuntu 12.10 & I have a couple of things I need to set correctly:
1) I need to change my system name / hostname.
2) I need to set my workgroup to match my Windows workgroup name.

If somebody could please walk me through doing those things, I would really appreciate it.

-THX-

edit the
/etc/hostname with gksudo gedit or nano if you do it in CLI

type
hostname <name> for a temporary name

you may also want to edit the

/etc/hosts
this for workgroup http://www.techrepublic.com/blog/opensource/how-to-join-ubuntu-to-a-windows-workgroup/1948

slickymaster
January 7th, 2013, 05:55 PM
In a terminal window run the following command:

sudo gedit /etc/hostname
Next, change whatever in this file to whatever you want it to be and save.

Afterwards run the command below to open the hosts file:

sudo gedit /etc/hosts
Then change the 2nd line of the file to reflect the new name and save.

Finally, to change your system workgroup name, run the command below to edit samba smb.conf file:

sudo gedit /etc/samba/smb.conf
Find the following line: workgroup = WORKGROUP and change the workgroup name to whatever you want it to be and save.

(Note that you have to replace gedit with the name of your textpad)

haqking
January 7th, 2013, 05:59 PM
In a terminal window run the following command:

sudo gedit /etc/hostnameNext, change whatever in this file to whatever you want it to be and save.

Afterwards run the command below to open the hosts file:

sudo gedit /etc/hostsThen change the 2nd line of the file to reflect the new name and save.

Finally, to change your system workgroup name, run the command below to edit samba smb.conf file:

sudo gedit /etc/samba/smb.confFind the following line: workgroup = WORKGROUP and change the workgroup name to whatever you want it to be and save.

(Note that you have to replace gedit with the name of your textpad)

gksudo should be used for gedit and graphical apps and not sudo.

Morbius1
January 7th, 2013, 06:01 PM
If you are doing this only for Samba compatibility remember that technically samba / SMB knows nothin' about no hostname. Samba cares about netbios name - those are two different things.

Samba does force the netbios name to match the hostname but smb.conf can always be used to override this by adding a line right under the workgroup line:

netbios name = somethingJust make sure that something is 15 characters or less in length.

Your hostname will be one thing and your netbios name ( and the name others will see on the network ) will be something else.

Then restart samba:

sudo service smbd restart
sudo service nmbd restart

slickymaster
January 7th, 2013, 06:02 PM
gksudo should be used for gedit and graphical apps and not sudo.

You're right. I stand corrected.

bamim2
January 7th, 2013, 06:07 PM
Thank you!!