LinuxQuestions.org
Review your favorite Linux distribution.
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 02-20-2006, 03:21 PM   #16
Miya
LQ Newbie
 
Registered: Feb 2006
Location: Germany
Distribution: Debian Sarge
Posts: 2

Rep: Reputation: 0
editor in graphical mode


Quote:
Originally Posted by mbreith
So that those of us who don't know how to use vi or emacs can edit the config files. If there is another way to open those files up for editing in a graphical editor I would love to know about it.
Hello, this is my first post in this forum. I have been lurking and reading so far.

Actually, I think it is important to learn at least vi(m) so that you can rescue your system if something goes wrong. I speak from experience here - I'm still a newbie and bad things can happen.

Since I have learned a lot here and want to give something back, I will tell you a way to edit config files as root without using a terminal. At least in KDE, you can start a program (like kate) as root from the K-Menu, there is 'Run Command', then you put the name into the box and click on 'Options', then on 'Run as a different user'. Type in root and your root password - there you go. Program starts with root privileges. Have fun!

Greetings,
Miya
 
Old 02-20-2006, 05:37 PM   #17
zaphod_es
Member
 
Registered: Jun 2003
Location: Brazil
Distribution: Ubuntu
Posts: 134

Rep: Reputation: 15
I think a lot of people on this thread have been missing the point. It is not a question of bossy control freaks creating distros so that they can tell you what to do. There are very real dangers in running a gui as root and as a matter of good security you should never do it.

Every program run under a GUI runs with the privileges of the user, in this case root. Any program has access to all files on your system. This is how Windows runs and why it is fundamentally insecure. Open an email in Microsoft Lookout Express and launch a program from there and it has administrator (root) rights over the box. It can do anything!

The same thing goes for linux if you logged onto the desktop as root and ran Firefox you could visit a website that abused some hole in FF to execute something on your machine - say "rm -rf /" for example. As you are root it would cause quite a bit of damage.

If you were logged in as an ordinary user it would have access to your home directory and could cause damage to your personal files, but would not compromise the entire system. This is one of the great strengths of *nix and should not be discarded without thinking.

The other thing to think about is that if you need to run a gui as root you have fundamentally failed as a Linux administrator. With experience you can do all system maintenance at the command line. Without experience and with a suitable distro you can do it all with specialist GUI programs which call for the root password each time you use them. If you cannot use a console text editor or work out how to open a gui editor such as gedit or kate as root without logging in as root you would be better off doing a bit of research than logging in insecurely.
 
Old 02-28-2006, 07:36 AM   #18
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
Posts: 4,035

Rep: Reputation: Disabled
Quote:
Originally Posted by mbreith
...If there is another way to open those files up for editing in a graphical editor I would love to know about it.
You might want to give "nano" or "pico" a try. To edit config-files they should suffice anytime.

BTW. I use KDE as root for system maintenance offline. There is no harm in that and a lot of benefits from the tools that come along with KDE...

Last edited by JZL240I-U; 02-28-2006 at 08:05 AM.
 
Old 02-28-2006, 08:02 AM   #19
Dtsazza
Member
 
Registered: Oct 2005
Location: Oxford, UK
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282

Rep: Reputation: 31
If you really want to do something as root in a graphical environment, I find it's better to log in yourself, and su or sudo from a console (probably issuing xhost beforehand). The reason being, as pointed out above, is that you're minimising the number of programs running as root - it's not worth spawning a dozen or so processes with root priviledges (probably several with network capabilities) when all you want is a GUI editor.

And sorry to drag something up from a while back, but I had to address this:
Quote:
Originally Posted by exsat
It is a stupid qusk to ask why poeple wanto log in as root.
Not at all. Asides from the fact that there are no stupid questions , the general consensus (especially in the Newbie forum) is that people have incomplete knowledge about the way things work. Often, people accidentally come across something that appears to do what they want, but without realising its full implications. Yes, as you acknowledge, logging in as root is "more easy,If you wanto delete something [to which you have no write permissions],you cant do before you are logged in as root." However, there are fundamental security flaws introduced that make it less suitable than other methods of deleting restricted files. Asking the question allows us to address the issue holistically, and introduce the poster to other methods that will acheive the same thing more safely, or even to avoid having to log in as root at all (see this part of my sig link).

And yes - people should be able to log in as root if they want to, and I'm sure that they can in any distro. IMO, though, it makes sense to disable it by default, so that people can't log in as root without having read how to activate it (and hopefully having read about the security issues that go with it).
 
Old 02-28-2006, 08:18 AM   #20
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
Posts: 4,035

Rep: Reputation: Disabled
There is some work done better by console, other done easier by GUI. Okay? I do the latter during administration of my WS -- or, rather, usually I have both console and GUI opened simultaneously and have them interact (e.g. drawing the address field from Konqueror to the console as a "cd /long/long/long/path/to/where/I/want/to/change/to/"). Reasonable?
 
Old 02-28-2006, 05:39 PM   #21
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
I believe many desktops let you "Run as Root" in which you can type "kate /config/filename" or "gedit /config/filename" and it will open a gui text editor. In ubuntu you can sudo gedit filename, in fact, that's how all the tutorials are written.

but just so you know, I'm not proficient with vi or emacs, but find nano quite usable from the CLI...

Sorry, just realized I only read the first page of the thread and must have posted before reading the rest. I see the question has been answered numerous times... mistake!

Last edited by pljvaldez; 02-28-2006 at 06:14 PM.
 
Old 02-28-2006, 08:20 PM   #22
DanTaylor
Member
 
Registered: Jan 2006
Distribution: Debian Sarge
Posts: 265

Rep: Reputation: 30
open the 'run as' program in utilities or system(i can't remember which) or run filemanager as superuser in the same folders. It is more dangerous to run kde as root because it is easier to accidentally delete the wrong file or folder, or edit the wrong one.
 
Old 03-04-2006, 10:19 AM   #23
jchajecki
LQ Newbie
 
Registered: Feb 2006
Posts: 7

Rep: Reputation: 0
For some it may be for convenience. For example, managing the file system is far easier in GUI than on the command line. Running SAX (ok you don't do that too often!) can only be done in the GUI on SuSE. Of course these apps can also be run su root. I'm not sure about the security argument since either way you have the same privileges and so in theory you can do the same damage. Of course, using the command line requires more in-depth knowledge. Messing with the command line when you don't have a proper understanding of what you are doing can also create plenty of havoc. Either way, GUI or text, when using root you have to be very carefull.

The main principle I abide by is to only do root tasks while logged in as root. Normal day-to-day user tasks should always be done as a normal user, NEVER as root. The same applies for Windows systems. Use Administrator only for admin tasks.

On a linux server though it might be better to init level 3 and then do a startx on the command line, after all, why have the overhead of GUI when you don't need it?

On a workstation, init level 5 is probably more appropriate since most users will probably want the GUI enviroment. In this case, disabling GUI login for root is probable safer if only to prevent unathorised users from trying to log in as root. The su root approach in this case is safer as it limits access to root to only those users that have authority to use the system.

This is my twopenceworth, and I stand to be corrected.
 
Old 03-04-2006, 10:35 AM   #24
jchajecki
LQ Newbie
 
Registered: Feb 2006
Posts: 7

Rep: Reputation: 0
zaphos_es, you make some good points in #17, especially the Firefox issue. Its always a bad idea to run web browsers as root. It sounds a little harsh to say "The other thing to think about is that if you need to run a gui as root you have fundamentally failed as a Linux administrator.", but your following comments are spot on. Security should not be taken lightly and any system administrator who is worth their salt should endeavour to fully understand the security implications of what they are doing.
 
Old 03-04-2006, 02:45 PM   #25
zaphod_es
Member
 
Registered: Jun 2003
Location: Brazil
Distribution: Ubuntu
Posts: 134

Rep: Reputation: 15
jchajecki, I was not trying to be smart or put anyone down but I do feel that it is should only be necessary to fire up KDE or Gnome as root in an emergency. There is always a better way. Maybe that way is not immediately obvious and maybe there is no time to find out what it is.

You can use the command line as root, open many gui front ends as root, use one of the many configuration tools which ask for the root password (like webmin) or run a file manager like Konqueror, Nautilus or MC as root. These are done for specific tasks and then closed down.

This is a newbie list and if anyone is not sure how to do any of those things this is the place to ask. That is a much better way.

Just to show that I am not a fanatic I will point out http://www.hexus.net/content/item.php?item=1121&page=4 where Michael Robertson of Linspire justifies the Linspire default of making the user root. He is wrong but has sold a lot of Linux so who am I to argue

ZB
 
Old 03-04-2006, 07:30 PM   #26
isd2301
Member
 
Registered: Mar 2005
Location: Chula Vista, CA, USA
Distribution: Ubuntu, Fedora
Posts: 41

Rep: Reputation: 15
Lest We Forget MC

There is one application that IMHO fills the void between GUI and command line if you need to do something as root....Midnight Commander (mc). This little gem has been around a very long time and I believe, correct me if I'm wrong, it was originally designed to give a GUI-like look and feel to the DOS environment. Anyone remember DOS?

It is a standard installed app in many Linux distros (if not all of them). It has saved me from many a potential re-install because of an ill-behaved tarball installation. If you aren't familiar with it, give it a look. Open it from the command line using the command 'mc'--- as a normal user at first if I might suggest --- and check out what it can do. It is also a menu selection in many distros as well.

It won't prevent you from reducing your install to trash if you are so inclined. On the other hand, it will give you a lot of information that might keep you from creating a catastrophy though.
 
Old 03-05-2006, 05:31 AM   #27
zaphod_es
Member
 
Registered: Jun 2003
Location: Brazil
Distribution: Ubuntu
Posts: 134

Rep: Reputation: 15
In my previous post I did briefly refer to MC and should have expanded that a little. It is a great application which I use a lot. It has a nice text editor for people who do not want to use one of the more esoteric *nix editors. It was not on the default installation of Mandrake when I last used it and, from memory, was not on my Ubuntu installation either.

You can wash your mouth with soap for linkng MC with DOS Here is an interview with Miguel de Icaza the author http://www.tldp.org/linuxfocus/Engli...article25.html where he talks about it. Since then he has risen to fame with the Mono and Evolution mail projects and his company has been take over by Novell. MC certainly was inspired by DOS programs like PC Tools and Norton Commander

ZB
 
Old 03-05-2006, 11:55 AM   #28
isd2301
Member
 
Registered: Mar 2005
Location: Chula Vista, CA, USA
Distribution: Ubuntu, Fedora
Posts: 41

Rep: Reputation: 15
zaphod_es....I have been a bad boy! You are right, it was Norton Commander in DOS I was thinking of. And I didn't even think about PC Tools mostly because MC is more like Norton Commander than PC Tools. It has been such a long time since I used DOS I just forgot. But then I'm getting older and my memory is fading.

I wasn't sure which distros have MC since I haven't had the chance to run them all. I think it would be safe to say it is available as at least an add-on for just about every distro, do you agree? It would be interesting to know which distros have it pre-installed and which do not.
 
Old 03-06-2006, 11:28 AM   #29
jchajecki
LQ Newbie
 
Registered: Feb 2006
Posts: 7

Rep: Reputation: 0
zaphod_es, I understand and accept your point of view. In fact your comments made me think carefully about my approach to using root.

isd2301, thanks for reminding us about mc. I used to use it at Uni on Slackware. I also used xtree on DOS. mc is an excellent command line tool and I had indeed (alomst) forgotten it.

Incidentally, if anyone using SuSE 9.x or 10.x has suddenly found that they are no longer able to log into GUI as root, this might be the reason:

http://wiki.suselinuxsupport.de/wikk...wToLoginasroot

The article seems to have been edited since it was first posted as it no longer mentions the fact that SuSE released an auto update to address this security issue. Anyone with auto update enabled and configured will have had this 'fix' delivered automatically and will have found that their GUI login as root now opens up a restricted xterm instead of the KDE desktop.
 
Old 03-14-2006, 06:43 AM   #30
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 431

Rep: Reputation: 30
I have just installed Gentoo on my AMD64 system, and, like the users above, I am locked out of my GUI.

Certainly, the constant use of root when logging into the gui is a *BAD IDEA*.

However, there is a lot of tweaking I want to do to my system before it is set up correctly and this kind of nannying, besides getting people's back up, is just downright unhelpful.

If I wanted to be bossed about by my OS, I would have installed XP.

The fact is that neither sudo nor su work on my system, for reasons I have yet to work out. Sudo allows me to use console-based tools, any request for a graphical tool gives
Quote:
ERROR. Can't determine DISPLAY. Aborting.
su just refuses to accept the root password. (For some reason it's finding the PAM at a location other than /etc/shadow).

I last installed gentoo 3 or 4 years ago, so I'm not all that familiar with it.
 
  


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
Graphical login fail, text login works livewire98801 Linux - General 2 10-11-2004 06:09 PM
Crazy blank dialog boxes and windows at login. Can't login as user soren625 Linux - General 2 08-11-2004 06:30 AM
I have re-installed MK 9.2 but cannot login as user, login as root works. bobinglis Mandriva 2 02-22-2004 11:39 AM
can only login as root? user login doesnt work..? anyone? hacking_4_b33r Linux - General 1 02-05-2004 11:40 PM
Changin Graphical Login to command line login 3DLirio Linux - Newbie 2 10-16-2003 09:43 PM

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

All times are GMT -5. The time now is 10:19 AM.

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