LinuxQuestions.org
Help answer threads with 0 replies.
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 10-25-2003, 10:18 PM   #1
classon
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Mandrake 9.1
Posts: 11

Rep: Reputation: 0
Exclamation strange computername issue


I run Mandrake 9.1 and I like to change my computername.

To do that permanently i edit my /etc/sysconfig/network to:

NETWORKING=yes
HOSTNAME="classon"

I then do a reboot without any effect. The strange thing is that I had RH9 installed before and there it worked. I know I can change the hostname by writing: hostname classon in a terminal but that is just a temporary sullotion.

This is really driving me mad. I thought I knew my way around computers but apparently not.
 
Old 10-25-2003, 10:40 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Is there a /etc/hostname file that contains the hostname? (There is such file in debian.) If
there is, changing it changes the hostname that is set at boot.
 
Old 10-25-2003, 10:45 PM   #3
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
To change the hostname go to rc.sysinit in the /etc/rc.d directory. Change line 30 from "HOSTNAME=localhost" to "HOSTNAME=classon" or whatever you want to name it. You have to have root access to change that file.

When you reboot you should see where it sets the hostname.

Hope that helps.

 
Old 10-25-2003, 11:21 PM   #4
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
Quote:
Originally posted by dalek
To change the hostname go to rc.sysinit in the /etc/rc.d directory. Change line 30 from "HOSTNAME=localhost" to "HOSTNAME=classon" or whatever you want to name it. You have to have root access to change that file.

When you reboot you should see where it sets the hostname.

Thank you, THANK YOU, dalek! I knew at one time how to change hostname in Mdk 8.2, but apparently in 9.1 it's done differently. I followed your instructions and now have my machine named the way I want it!

It's a trivial matter (I don't run a server or anything...), but I think most of us know how trivial bothers can nag and nag like a tune you can't get out of your head.

I can rest easier now, and worry about a million other Linux matters.

You made my day--no exaggeration.
 
Old 10-25-2003, 11:25 PM   #5
classon
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Mandrake 9.1
Posts: 11

Original Poster
Rep: Reputation: 0
Well this raise another problem that occurred when I changed distribution to mdk. I thought that once you were root you had access to all files. But I dont have it now.

I can read the rc.sysinint but cannot write on it.
ls -l shows:
-rwxr-xr-x 1 root root 33883 Oct 9 22:06 rc.sysinit

But when i type:
su
chmod a+w rc.sysinit

I get "Operation not permitted" that is strange. I also here used to be able to edit it. I even now entered my computer in rescuemode but root did not have enough permissions there either.

hm... when my computer boots it reads: Setting hostname classon [ok]
should not that be enough? Hm... Perhaps it works to add HOSTNAME=classon in /etc/rc.d/rc.sysinit but I cannot test it since I dont have enough access to do it as root. Sigh...

Shall I reinstall my whole system just because of this? I installed mdk9.1 on an other machine and there is worked without any problems.
 
Old 10-25-2003, 11:41 PM   #6
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
Quote:
Originally posted by classon
I can read the rc.sysinint but cannot write on it.
ls -l shows:
-rwxr-xr-x 1 root root 33883 Oct 9 22:06 rc.sysinit

But when i type:
su
chmod a+w rc.sysinit

I get "Operation not permitted" that is strange. [/B]
I think I would try (as root)

chmod o+rwx ./rc.sysinit

before I resorted to reinstalling my system...

Don't know if it would work or not, but it looks like it couldn't hurt to try.
 
Old 10-26-2003, 04:16 AM   #7
classon
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Mandrake 9.1
Posts: 11

Original Poster
Rep: Reputation: 0
[root@dhcppc2 rc.d]# chmod o+rwx ./rc.sysinit
chmod: šndrar ršttigheter pŚ "./rc.sysinit": Operation not permitted

Did not work. Very strage indeed.
 
Old 10-26-2003, 05:10 AM   #8
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
I named mine smoker. I went from a 400MHz amchine to the one in my sig below. It smokes OK.

If you are using 9.1 do this:

Start thingy then Applications then File Tools then 'File Manager - Super User'. Put in root password. Then use the buttons to get around and go to /etc/rc.d then click on the file rc.sysinit. It should open in Kwrite. If it won't let you change the file then close Kwrite and right click on the file and choose properties. Make sure the following have a 'X' next to it in the permissions tab:

User Read Write Exec
Group Read Exec <no x for write>
Others Read Exec <no x for write>

Ownership should be

User root
Group root

If you have that click on it again and it should let you change it.

Hope that helps. Post back either way.

 
Old 10-26-2003, 08:43 AM   #9
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
This problem bothered me all night! I searched this morning on the Web and found similar problems reported; one was where a user's computer had been hacked (cracked) maliciously at such a basic level that root permissions no longer existed; two or three others just had no solution (yet); and I found a page that described Linux security settings that can be set so strict that even the root user cannot chmod or chown. (But how then would you change the settings back?!)

I will keep looking. Meanwhile I bravely experimented and found I could chmod just fine on that file. Hmm.

P. S. I had a year of Swedish long, long ago in my university years. I remember only a few words, but I could make out the line in one of your posts, classon--from context!

Last edited by jonr; 10-26-2003 at 08:45 AM.
 
Old 10-26-2003, 03:46 PM   #10
classon
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Mandrake 9.1
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by dalek
Make sure the following have a 'X' next to it in the permissions tab:

User Read Write Exec
Group Read Exec <no x for write>
Others Read Exec <no x for write>

Ownership should be

User root
Group root
Everything looked as when I wrote ls -l and when I tried to change the properties (add more readacces) i got an error message.

Is there an other startupscripts like the /etc/rc.d/sysinit? If there is I can att a line "hostname classon" and the problem will be solved. Almost but as good as solved.

I run enlightenment and I tried to put it into the initfile of the theme Im running but without any success. Do you know of any other place I could place that piece if code?
 
Old 10-26-2003, 04:00 PM   #11
classon
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Mandrake 9.1
Posts: 11

Original Poster
Rep: Reputation: 0
jonr: I dont think that my computer as been hacked/Cracked. Eh... at least I hope so
One thought that had occurred to me is about if it is possible to mount the filesystem so that all rights are set from the beginning?

Something went wrong when I made my last installation and the installationprogram hang just before the last reboot was going to be. I hoped for the best and did a manual reset (stupid computer! I have the power over you! hm... who am I trying to convince here? ) and the system booted fine. So I ran it and started out using enlightenment from start. It might be so that I missed to install some really important file regarding changing rights to a file such as /etc/rc.d/sysinit. But then I can change the rights of a file I (root) made in the same catalog /etc/rc.d/sysinit.old. Quite odd I think.

Perhaps I rather do a complete reinstallation?

By the way! Im honored seing you talk about that you have tried to learn my language.
 
Old 10-26-2003, 04:25 PM   #12
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
I wish I knew more so I could give good advice here. Before Mandrake 9.1, I had problems with installations hanging up various places, and trusted to luck and everything seemed to turn out OK. I just don't know why you have LOST the ability to chmod certain files, when you did have it before! I know it would make me feel really frustrated and maybe I would think about re-installing--but that brings headaches with it, too, doesn't it...

Re: Swedish studies--I never got very good. My major is in French, and I also can read German and Spanish fairly easily. Swedish seems a good deal more difficult--and I never mastered the "sj" sound at all! But I enjoyed learning what I did learn and I feel some accomplishment when I watch a Swedish movie and understand about one phrase every twenty minutes!

I'm going to continue to look into this file permission problem. After all, it seems fairly common, and it could happen to me one of these days....
 
Old 10-26-2003, 05:57 PM   #13
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
I don't understand why root can't chmod a file either. Can you do it the way I mentioned above or do you get a error then to? It should at least let you look at the permissions box.

Strange

 
Old 10-26-2003, 06:07 PM   #14
classon
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Mandrake 9.1
Posts: 11

Original Poster
Rep: Reputation: 0
No. Sorry cannot do that either. I get into that I can click the boxes to change ownership att read/write/exe access but when I klick ok i get an error message saying konquerer made a mistake.

Thaks for the support anyway. This is a lot better then seaching for dump hard to find howtos. Thank you guys. I dont know what I would do without ya! )
 
Old 10-26-2003, 06:44 PM   #15
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
Grr! There's got to be an answer to this! Something's just not right.

It's almost as though the name "root" were assigned to a regular user--but I don't think that's possible. As far as I know, it's a reserved word....

Oh, well. Please keep us informed if you find anything else out. Sorry there was no easy solution....
 
  


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
Computername Ruben2 Linux - Networking 6 07-07-2005 04:18 AM
strange FTP issue tanmaya Linux - Networking 2 05-23-2005 07:15 AM
strange c issue exvor Programming 8 01-29-2005 02:23 PM
Setting Samba //computername !! Driving me Nuts! Amir Linux - Networking 2 02-27-2004 06:16 AM
help me on a strange issue. newpenguin Linux - General 11 10-06-2002 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:36 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