LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Simple Question - how to modify file attributes? (https://www.linuxquestions.org/questions/linux-newbie-8/simple-question-how-to-modify-file-attributes-176270/)

xanas3712 04-30-2004 05:25 AM

Simple Question - how to modify file attributes?
 
I have no idea how to do this, and apparently it's supposed to be so easy I can't find the answer anywhere easily.. what command do I type, or whatever to take off the readonly attribute on a file.. I want to edit my XF86Config-4 file so that I can get dual monitor support working, and besides I need to know this anyway right?

ac1980 04-30-2004 05:35 AM

use chmod attributes filelist
for info read the manpage ('info chmod' or 'man chmod').
You must be either file owner or root (which in your case are the same) to be allowed to do this.
Note that on non-native fs (like vfat) most attributes can't be changed on a per-file basis, all the files have the same owner/permissions determined at mount time.

PS: note that you should not make files in /etc writeable to normal user, since you (or an application) may damage the system. Instead, use 'su' to become root before launching the editor

xanas3712 04-30-2004 05:37 AM

right.. um.. just noticed something.. I can't log in as root to modify it.. which is incredibly lame..

mandrake gives me this menu when I logout that won't let me select anything but the one user I created .. kinda stupid if you ask me and I remember it didn't use to do that (back when I tried mandrake a couple years ago now..)

Any idea how I can even log in as root...?

verstapp 04-30-2004 05:38 AM

In file manager (Konqueror in KDE) right-click on the file, select the properties menu item, select the permissions tab, and click in boxes to switch permissions on/off, click OK to set them.
Of course there is a command-line prog that this is a front end for - type man chmod at the command line.

xanas3712 04-30-2004 05:39 AM

yeah the problem was I'm not logged in as root.. but I can't figure out how to login as root on mandrake 10...

bigjohn 04-30-2004 05:46 AM

Not to up with technospeak, so I don't follow what you mean by attributes!

Anyway, to alter the XF86Config-4, you can either log in as root (as in a graphic login), and then just use konqueror to search for it (probably /etc/X11/XF86Config-4) or you can do the mod with an editor.

For example, using VI (which is installed as default ed with mandrake), you'd open a terminal/konsole, the "SU" and root password so you are then in as root, you'd then type
Code:

vi /etc/X11/XF86Config-4
That opens the file in VI, you then have to navigate it with keyboard arrows. To actually do the changes move cursor to wherever, then hit the "insert" key, enter/delete/modify so the changes are done, to save the changes hit Esc key, then type :wq enter (note you must type in the : colon). If you aren't sure of what changes you want to make, you can just do :q to quit (again, the colon).

You should have, or be able to find some documentation for using VI (maybe in /usr/share/doc). But which editor you try, if they are "proper" editor's the you'll have to find the instructions.

Erm if you've got kde installed, you can do the root login (graphical), then just got to editors and then select kwrite, that is the kde editor, and you can use it like a word procesor.

that's what I do

regards

John

ac1980 04-30-2004 05:47 AM

I don't use mdk, however you can try these:
1. on login page there's a system menu that should contain something like 'prefereces' or 'config'
2. maybe after logging in as user, in the start menu/system there's a gdm (or xdm) config tool

Look there if there's a 'don't allow root login' checkbox
However you should better only run only needed applications as root, using a "run as root" command that probably is in atart/system menu

xanas3712 04-30-2004 06:06 AM

I've figured out how to do this, (get root permissions and log in as root, etc.).. So thanks, though I'm still having trouble with what I'm actually trying to do, but I had another thread for that so I'll just use it..

vectordrake 04-30-2004 07:04 AM

http://www.linuxquestions.org/questi...hreadid=164314

Follow that short thread for a howto get root login for KDM in KDE 3.2 on MDK 10.

Or just "su" to it in a terminal...

xanas3712 04-30-2004 07:07 AM

i just right clicked the terminal window and used the root terminal to what was that command again..whatever command it is that allows you to change the runlevel.. i just changed it to 3 which disabled the gui.. and was able to login root from there and just restart x with startx command.

Heh.. I figured that out by myself.. of course nothing else so far I have

vectordrake 04-30-2004 07:15 AM

That's another way. You're thinking about
Code:

telinit
To do simple things like change your runlevel, make your like easier and just open a small terminal window and "su" into root. Change what you need with chmod and close the window when you're done.

There's also a way to log a session within a session too (like vmware), but I forget what that was...

xanas3712 04-30-2004 02:02 PM

su = switch user eh? I just figured that out.. it's nice to have a brain after sleeping.. lol.

vectordrake 04-30-2004 07:03 PM

After doing things this way, I can't feel safe on a Redmond machine any more. Default admin accounts are just too scary.


All times are GMT -5. The time now is 12:09 AM.