Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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!
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.
Distribution: Debian Etch (w/ dual-boot XP for gaming)
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:
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).
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
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?
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!
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.
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.
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.
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.
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.
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
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.
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.