Change Hostname

Hi there,

a few minutes ago I installed openSUSE on my notebook with an usb drive using openSUSE 11.4 KDE LIVE iso.
The installation process set the name to “linux-ygrl” which I don’t really like. (I probably just missed the setting during the installation…)
I tried to change it through YaST → Network Services → Hostnames and I set everything where needed to the new name and restarted but the changed weren’t applied. I searched the web and found out about the /etc/HOSTNAME file which still contains “linux-ygrl”. Now I could change it manually but I was wondering if there is a GUI for it? (I mean, openSUSE has for alsmost everything a GUI… :S)

Thanks

To change your PC Hostname, Goto:

YaST / Network Services / Hostnames and find it as an aliias. Mine shows up on the 127.0.0.2 line. I can select it and then press the Edit button on the bottom left and modify the Host Alias, press OK and then press OK again. You can also get to this same name from:

YaST / Network Devices / Network Settings / Press OK to the warning if you have set NetworkManager to control your network / Hostname/DNS Tab / Hostname and press OK if you make a change there.

The way mention 1st would be the best way to make this change. If you are using Samba, I do not recommend you make your Hostname the same as your netbios name which should be different.

Thank You,

If I change this, /etc/HOSTNAME stays as it is and the OS still uses the old hostname e.g. for DHCP.

Any other ideas?

Ctwx If I change this, /etc/HOSTNAME stays as it is and the OS still uses the old hostname e.g. for DHCP.

Any other ideas?
Did you restart your PC after making this change using YaST as suggested?

Thank You,

Perhaps check that change Hostname via DHCP isn’t checked on the Hoastname/DHCP tab of network settings in yast.

On Fri April 1 2011 06:36 pm, jdmcdaniel3 wrote:

<snip>
>
> The way mention 1st would be the best way to make this change. If you
> are using Samba, I do not recommend you make your Hostname the same as
> your netbios name which should be different.
>
> Thank You,
>
jdmcdaniel3;

Can you give one good reason why the netbios name and hostname should differ.
The only problem that can crop up is having a hostname longer than 15
characters or characters not supported by netbios [not unicode letters
numerals, white spaces nor !@$%^&’)(.-_{}~ ].


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Can you give one good reason why the netbios name and hostname should differ.
The only problem that can crop up is having a hostname longer than 15
characters or characters not supported by netbios [not unicode letters
numerals, white spaces nor !@$%^&’)(.-_{}~ ].
Yes I have had issues where a Windows computer would not connect to a Linux machines where the two names where the same and other oddities. My suggestion is based on these issues and I did state that it was recommended, not required. If you do not really use Samba or your have both names already set the same and have no problem, then you are fortunate or your usage of Samba is limited in some way. I have had the same questions posed before and I give the same answer. To avoid possible Samba issues, it is not unreasonable to use a different Linux Hostname or to continue using the name you were given during the installation of openSUSE, which is my normal thing to do.

Thank You,

On Fri April 1 2011 08:36 pm, jdmcdaniel3 wrote:

>
>> Can you give one good reason why the netbios name and hostname should
>> differ.
>> The only problem that can crop up is having a hostname longer than 15
>> characters or characters not supported by netbios [not unicode letters
>> numerals, white spaces nor !@$%^&’)(.-_{}~ ].Yes I have had issues where a
Windows computer would not connect to a
> Linux machines where the two names where the same and other oddities.
> My suggestion is based on these issues and I did state that it was
> recommended, not required. If you do not really use Samba or your have
> both names already set the same and have no problem, then you are
> fortunate or your usage of Samba is limited in some way. I have had the
> same questions posed before and I give the same answer. To avoid
> possible Samba issues, it is not unreasonable to use a different Linux
> Hostname or to continue using the name you were given during the
> installation of openSUSE, which is my normal thing to do.
>
> Thank You,
>
jdmcdaniel3;

By default Samba will use the hostname for the Netbios name, you would only
have two names for the linux machine if you CHANGED the Netbios name to
something else. You have this backwards. There is absolutely no harm leaving
them the same.

Windows will also use the same name for the hostname and Netbios name. Newer
windows machines (AD)like to use DNS rather than Netbios for name resolution.
By leaving them the same names can be looked up by broadcast, wins or DNS and
they all resolve to the same machine. We have multiple linux servers for our
Windows Domain and never a problem.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

By default Samba will use the hostname for the Netbios name, you would only
have two names for the linux machine if you CHANGED the Netbios name to
something else. You have this backwards. There is absolutely no harm leaving
them the same.

Windows will also use the same name for the hostname and Netbios name. Newer
windows machines (AD)like to use DNS rather than Netbios for name resolution.
By leaving them the same names can be looked up by broadcast, wins or DNS and
they all resolve to the same machine. We have multiple linux servers for our
Windows Domain and never a problem.
So you say. But, do you have Samba loaded on your Machine? Is your Netbios Name the same as its Hostname? Can you show your configuration files to prove this? Like so:

/etc/HOSTNAME

linux-l9oq.site
/ect/samba/smb.conf

# Samba config file created using SWAT
# from UNKNOWN (127.0.0.1)
# Date: 2011/03/14 21:08:05

[global]
    workgroup = WINDOWSNT
    netbios name = MASTERLINUX
    server string = The Master of the Universe
    security = SHARE
    map to guest = Bad Password
    socket options = SO_KEEPALIVE TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192
    printcap name = cups
    logon path = \\%25L\profiles\.msprofile
    logon drive = P:
    logon home = \\%25L\%25U\.9xprofile
    local master = No
    domain master = No
    wins support = Yes
    ldap ssl = no
    usershare allow guests = Yes
    usershare max shares = 100
    hosts allow = 192.168.0.0/255.255.255.0, 127.0.0.1
    hosts deny = ALL
    cups options = raw
    posix locking = No
    ldap suffix = 
    passdb backend = smbpasswd

[Software]
    path = /Software
    read only = No
    acl check permissions = No
    inherit acls = Yes
    guest ok = Yes
    profile acls = Yes

[Windows]
    path = /Windows
    read only = No
    acl check permissions = No
    inherit acls = Yes
    guest ok = Yes
    profile acls = Yes

Here is a listing of my local PC’s using Samba in Linux:

smb://james-pc/
smb://jamie-pc/
smb://linuxmaster/
smb://masterlinux/
smb://mctronics/

Thank You,

On Fri April 1 2011 09:36 pm, jdmcdaniel3 wrote:
<snip>
>
> But, do you have Samba loaded on your Machine? Is your
> Netbios Name the same as its Hostname? Can you show your configuration
> files to prove this? Like so:
>
<snip>
> Thank You,
>
jdmcdaniel3;
The domain name has been changed to protect the guilty.

As Swat will only show the parameters that are set the smb.conf, testparm -v
will give all the parameters including the default parameters. fermat is a
member server of a Samba3 Domain and running OpenSuse 11.4, Samba 3.5.8. Hal2
is an OpenSuse 10.2 running Samba 3.5.8 (Binaries from Sernet) and is the PDC

venxyz@fermat:~> cat /etc/HOSTNAME
fermat.XXXXXX

venxyz@fermat:~> testparm -vs
Load smb config files from /etc/samba/smb.conf
<snip>
Loaded services file OK.
Server role: ROLE_DOMAIN_MEMBER
[global]
dos charset = CP850
unix charset = UTF-8
display charset = LOCALE
workgroup = XXXXXX
realm =
netbios name = FERMAT
netbios aliases =
netbios scope =

venxyz@fermat:~> nslookup fermat
Server: 192.168.0.25
Address: 192.168.0.25#53

Name: fermat.XXXXXX
Address: 192.168.0.26

venxyz@Hal2:~> cat /etc/HOSTNAME
Hal2.XXXXXX

venxyz@Hal2:~> testparm -vs
Load smb config files from /etc/samba/smb.conf

<snip>

Loaded services file OK.
Server role: ROLE_DOMAIN_PDC
[global]
dos charset = CP850
unix charset = UTF-8
display charset = LOCALE
workgroup = XXXXXX
realm =
netbios name = HAL2
<snip>

venxyz@Hal2:~> nslookup hal2
Server: 192.168.0.25
Address: 192.168.0.25#53

Name: hal2.mshome
Address: 192.168.0.25

Here are the clients/servers on line at this time, during the day there are a
lot more:
venxyz@Hal2:~> smbtree
Enter venzke’s password:
XXXXXX
\VAL Windows XP
<snip>
\TEEN1
<snip>
\PAL
<snip>
\HP0025B3A2FCC8
<snip> {note this is actually a network printer}
\HAL2 Samba 3.5.8
<snip>
\GAUSS Windows 7
<snip>
\FERMAT Samba on fermat
<snip>
venzke@Hal2:~>


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On Fri April 1 2011 10:10 pm, PV wrote:

> On Fri April 1 2011 09:36 pm, jdmcdaniel3 wrote:

<snip>
> venzke@Hal2:~>

I should really learn to proof read my posts before sending. )-: To bad nntp
does not allow edits.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On Fri April 1 2011 09:36 pm, jdmcdaniel3 wrote:

>
<snip>
>
>
> Code:
> --------------------
> # Samba config file created using SWAT
> # from UNKNOWN (127.0.0.1)
> # Date: 2011/03/14 21:08:05
>
> [global]
> workgroup = WINDOWSNT
> netbios name = MASTERLINUX
> server string = The Master of the Universe
> security = SHARE
> map to guest = Bad Password
Although you insist on using security = SHARE, not very wise, the above
probably makes no difference, but in a normal install it can be quite
harmful to the clients since entering a bad password will silently log them
in as guest and they may not be able to access their shares. It is better to
use


map to guest = Bad User

socket options = SO_KEEPALIVE TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192
SO_RCVBUF=8192
The above parameter is obsolete. Any kernel 2.6 or later will do a much
better job of setting these. These parameters actually can degrade your
performance
printcap name = cups
logon path = \%25L\profiles.msprofile
logon drive = P:
logon home = \%25L%25U.9xprofile
The above 3 parameters are for domains only. They do no harm, but also do no
good for a simple workgroup setting

local master = No
domain master = No
wins support = Yes
ldap ssl = no
Since you are not using ldap why is the above here.
usershare allow guests = Yes
usershare max shares = 100
hosts allow = 192.168.0.0/255.255.255.0, 127.0.0.1
hosts deny = ALL
cups options = raw
posix locking = No
read man smb.conf for the meaning of “posix locking” I’m not sure this is
really what you want.
ldap suffix =
again no LDAP so this is not needed

passdb backend = smbpasswd
As smbpasswd is plain text it is not very secure, you should really use the
default tdbsam. ldapsam would be over kill for you.

> -------------------- > Thank You, > jdmcdaniel3;

You did not ask for a critique but…

See the comments above on your /etc/samba/smb.conf file.

What I see missing is the name resolve order parameter. Since you have
configured your machine as a Wins Server why not use it. Add the following
parameter:


name resolve order = wins bcast host lmhosts

The default value for the above is really not very good.

Make sure nmbd is enabled at boot and that the Netbios server is allowed
through your firewall.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

linux-ygrl:~ # cat /etc/HOSTNAME
linux-ygrl.site

I have checked

# yast2 runlevel

if samba is activated but I found out, that there’s no entry for samba. Only smb. (I don’t know if on openSUSE smb is the same as “samba”.) It’s not running.
So it’s the standard smb.conf. (Sorry, I have currently no connection to the internet on my laptop… NetworkManager somehow don’t like my wifi card…)

On Sat April 2 2011 06:06 am, Ctwx wrote:

>
> Code:
> --------------------
> linux-ygrl:~ # cat /etc/HOSTNAME
> linux-ygrl.site
> --------------------
>
>
> I have checked
> Code:
> --------------------
> # yast2 runlevel
> --------------------
> if samba is activated but I found out, that there’s no entry for samba.
> Only smb. (I don’t know if on openSUSE smb is the same as “samba”.) It’s
> not running.
> So it’s the standard smb.conf. (Sorry, I have currently no connection
> to the internet on my laptop… NetworkManager somehow don’t like my
> wifi card…)
>
CTwx;

smb is short for the Samba3 daemon smbd, what you see is all right. You
should also have nmb set to start at boot. For opensuse 11.4, there is a
problem with AppArmor that keeps smbd from running. Go to YaST>Novell
AppArmor >AppArmor Control Panal > configure Profile Modes there set
usr.sbin.smbd and usr.sbin.nmbd to complain and NOT enforce.

After making that adjustment do:


su
rcsmb status
rcnmb status

If either of these indicate they are not running then execute


rcsmb start
(and/or)
rcnmb start

Finally make sure that these three services are set as allowed by the
Firewall:
Samba Server, Samba Client and Netbios Server

Yast>Security and Users>Firewall>Allowed Services

To setup your smb.conf, and other Samba related topics, it would be best if
you followed this HowTo:
http://opensuse.swerdna.org/suselanprimer.html

Swerdna has written a number of helpful howtos for samba and networking in
general. They are all well written and correct.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

OK, I think I found out where to set the hostname.

# yast2 lan

in the tab Hostname/DNS. So, problem solved – on the “GUI way”.

Thanks for the descriptions to samba, but I don’t think I’ll need it. So I’ll keep AppArmor the way it is. As long as everything works I want it to, I don’t see any reason to change. But thank you.

First off, not to confuse the original subject of this thread, Ctwx I am happy to hear you found your problem and got it fixed.

Now to the suggestions being made by venzkep, I always listen to suggestions made by others. Here is a modified smb.conf file based on suggestions made.

[global]
    workgroup = WINDOWSNT
    netbios name = MASTERLINUX
    server string = The Master of the Universe
    security = SHARE
    map to guest = Bad User
    name resolve order = wins bcast host lmhosts
    printcap name = cups
    local master = No
    domain master = No
    wins support = Yes
    usershare allow guests = Yes
    usershare max shares = 100
    hosts allow = 192.168.0.0/255.255.255.0, 127.0.0.1
    hosts deny = ALL
    cups options = raw

[Software]
    path = /Software
    read only = No
    acl check permissions = No
    inherit acls = Yes
    guest ok = Yes
    profile acls = Yes

[Windows]
    path = /Windows
    read only = No
    acl check permissions = No
    inherit acls = Yes
    guest ok = Yes
    profile acls = Yes

Now consider this does not really concern any possible issue with having a Hostname and Netbios Name being the same, but all suggestions concerning my smb.conf file are considered.

Thank You,

On Sat April 2 2011 09:06 am, jdmcdaniel3 wrote:

>
> First off, not to confuse the original subject of this thread, Ctwx I am
> happy to hear you found your problem and got it fixed.
>
> Now to the suggestions being made by venzkep, I always listen to
> suggestions made by others. Here is a modified smb.conf file based on
> suggestions made.
>
>
> Code:
> --------------------
> [global]
> workgroup = WINDOWSNT
> netbios name = MASTERLINUX
> server string = The Master of the Universe
> security = SHARE
> map to guest = Bad User
> name resolve order = wins bcast host lmhosts
> printcap name = cups
> local master = No
> domain master = No
> wins support = Yes
> usershare allow guests = Yes
> usershare max shares = 100
> hosts allow = 192.168.0.0/255.255.255.0, 127.0.0.1
> hosts deny = ALL
> cups options = raw
>
> [Software]
> path = /Software
> read only = No
> acl check permissions = No
> inherit acls = Yes
> guest ok = Yes
> profile acls = Yes
>
> [Windows]
> path = /Windows
> read only = No
> acl check permissions = No
> inherit acls = Yes
> guest ok = Yes
> profile acls = Yes
>
> --------------------
> Now consider this does not really concern any possible issue with having
> a Hostname and Netbios Name being the same, but all suggestions
> concerning my smb.conf file are considered.
>
> Thank You,
>
jdmcdaniel3;

I think you will be happier with this setup. There is no great harm done in
using separate hostnames and netbios names. On the other hand as long as the
the hostname is an acceptable netbios name there is no harm letting the
netbios name default to the hostname.

Thank you for all your contributions to the OpenSuse community they are very
much appreciated. Please do not take my comments personally, they were only
meant to inform.

Ctwx;

Congratulations on getting your hostname problem solved. As long as you are
not using Samba there is no need to worry about AppArmor

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

I think you will be happier with this setup. There is no great harm done in
using separate hostnames and netbios names. On the other hand as long as the
the hostname is an acceptable netbios name there is no harm letting the
netbios name default to the hostname.

Thank you for all your contributions to the OpenSuse community they are very
much appreciated. Please do not take my comments personally, they were only
meant to inform.

Ctwx;
venzkep, this forum is for the free exchange of help to others and of ideas on all subjects about openSUSE and computers. Everyone has something to contribute and no one knows it all or even has seen it all. I will say that on several occasions, an issue did arise due to having identical netbios and host names on the same Linux computer using Samba. The occurrences where far enough apart to not have been fixed by any single update. But, the exact cause was never determined by me as the fix was simple to just avoid the issue. Kind of like using any Samba settings that simply does nothing, when something works, even once, it may be copied a thousand times. Your input and help is also valuable. I try to not make absolute statements but suggestions which one can follow or not. Users that use Samba all the time tend to not use the Hostname per say and visa versa. For most, not having them the same just does not matter all that much and thus my recommendation to anyone that uses Samba on this subject, but your point is well taken.

Thank You,