LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-26-2009, 08:46 PM   #1
PhilipMiddleton
LQ Newbie
 
Registered: Mar 2009
Posts: 7

Rep: Reputation: 0
Hostname persistant (Samba issue)


How do I make the hostname stick?
Running Mandriva 2008.1 + Samba (user level shares)
Sharing a few folders, but when the hostname is localhost, the Windows machines complain about duplicate name when they login to the share, and hence wont work.
If I run the command line
hostname Linux01
then restart the smb service, then all OK (shares work great) until the next reboot.
a reboot resets the hostname to localhost and the windows machines complain again.
Adding the machines ip and name to /etc/hosts dont work.
what have I got to change to make the hostname stick after a reboot?

Thanks... Philip.

Last edited by PhilipMiddleton; 03-26-2009 at 09:04 PM.
 
Old 03-26-2009, 09:07 PM   #2
jman82s
Member
 
Registered: Jul 2007
Location: Central Coast, California
Distribution: "distro-hopper"
Posts: 66

Rep: Reputation: 15
I've never used Mandriva myself, but it is based off of Red Hat, which uses the file /etc/sysconfig/network to set the hostname. Debian-derived distros (and possibly others?) Use the file /etc/hostname to set it.

Hope that helps!
 
Old 03-27-2009, 01:10 AM   #3
PhilipMiddleton
LQ Newbie
 
Registered: Mar 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jman82s
/etc/hostname
.
As you suggested, this file does not exist

Quote:
Originally Posted by jman82s
/etc/sysconfig/network
.
Ah. This file only has NETWORKING=YES
so I have added hostname=linux01 (same as samba name)
will reboot now, see how this goes
 
Old 03-27-2009, 04:15 AM   #4
PhilipMiddleton
LQ Newbie
 
Registered: Mar 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Well, entering that extra line in the /etc/sysconfig/networking file has had a somewhat unexpected effect.
I can now get into the Linux shares perfectly, but the Lunix hostname (type hostname from a prompt) is still localhost.
I dont think I did anything else, but like I said, Samba is now working.
Very strange, but hay. Not going to argue with it (atm).

On to the next problem. While I can see the Linux shares on a WinXP machine, I cant see any Windows shares (including printers) on the samba machine. But, if I type smb://username@pcname/sharename (ie smb://philip@philippc1/data) into Konqueror or firefox, I can see and use the share no problem.
I'm trying to see the shares from MCC > Network Shareing >Windows Shareing (smb)...
Is there a better place to Browse available shares?
Is this a common problem?

Thanks... Philip.
 
Old 03-27-2009, 05:12 PM   #5
jman82s
Member
 
Registered: Jul 2007
Location: Central Coast, California
Distribution: "distro-hopper"
Posts: 66

Rep: Reputation: 15
Glad to hear you got the hostname situation laid to rest. I'm not sure why it still shows up as 'localhost' on the actual machine. It might have to do with the entry in the /etc/hosts file, which maps your local loopback address (127.0.0.1) to the name 'localhost'. Which should not be tampered with, as various programs need this for functionality.

I actually have very little experience with Samba. I'm more of an NFS guy, so I'm not sure where the best place to browse is. I always felt a little funny browsing files from a web browser, but I'm guessing you're probably safe enough.

Any other takers? Suggestions?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hostname issue - showing "localhost" instead of actual hostname. ryes31 Linux - Server 9 12-12-2012 09:19 PM
Samba or Wins issue: netbios aliases, not accessible by hostname pingu Linux - Networking 1 05-02-2008 02:51 PM
sendmail - masquerading - hostname issue lord-fu Fedora 3 12-19-2007 11:03 PM
hostname / email issue I_AM Linux - General 2 07-15-2005 12:39 PM
Hostname Issue with Netgear MR814 router tm68 *BSD 1 03-31-2003 05:09 PM


All times are GMT -5. The time now is 10:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration