Switching between root and user
I am running Slack 9.0 and I login at the command line. If I am in, say WindowMaker as user and desire to switch over to root (not su from command line) is there an easy way to switch over? Currently I am logging out, back to the prompt, then su to root, then reboot and reversing the process afterwards. There must be an easier way then this. Thanks in advance!:study:
|
why do you want to do as root that can't be done by 'su'ing at the command prompt?
|
personnaly, want I need to do some task at root, without using SU (as example, renamming files on Fat32 partition I want to keep unwritable to users) I start a SECOND xfree session under root name. I mean I have both my users and root running each one an x.
|
I must be missing something. Why aren't either of you using 'su' in an xterm?
|
Here's my take on the 2 things...
I push for more administration in a CLI. This does 2 things: Keeps you from really jackin up your system so easily (you have to know the commands to use to do things) Sorta forces you to get to learn what's actually going on behind the curtain, this will help for further diagnostics later sometimes. However, many people who know CLI (and those that don't of course) will do things in a GUI for whatever reason. That's fine, and that's part of what's nice about linux is that you can, sometimes. So if someone wants to be in root's gui everytime they use root to do something, or if they want to use a graphical tool that requires root priv's to run, that's great! The downside (other than that mentioned by Half_Elf) is that you have to logout and backin as root, then out as root and back in as user each time you want to. There are other ways, such as typing: xhost + first, but that's really work around and doesn't open up root's GUI. So anyway, to expand on Half_Elf's suggestion: Assuming you startx to get to your graphical environments, do this: CTRL ALT F1 Login as user startx Then CTRL ALT F2 Login as root startx -- :1 And X for root will now be accessible by: CTRL ALT F8 And X for user will be on CRLT ALT F7 HTH Cool <PS> There is also, sudo which is highly recommended even over su AFAIK. </PS> |
Quote:
First rename "/usr/X11/bin/startx" as "/usr/X11/bin/start" then create "startx" and write this script in it : Code:
#!/bin/sh This little script allow you to start up to 6 X sessions and save it's log in a files so you don't loose your terminal. Anyways have fun :) |
Very usefull, thanks people!
|
Switching between root and user
Quote:
|
Quote:
If you use KDE, there's an option in property to "run as different user". It is probably safer to run a single program at root than all an X. Just right click on a program icon and select property (the same things exist in gnome I believe). You may also want to know that it is possible to set a bit of permission to an executable to give the possibility to anyone to run it as a different user. Search about setuid and setgid (the first one tell that the program will run under owner name and the second, under group name. This is especially usefull for safe application that require a root right (like cdrecord and all burn cdrom apps). |
Re: Switching between root and user
Quote:
|
Quote:
|
Quote:
And I often start a second X when I want to use wine to run some progs on my fat32 partition. First, my users can't write on my fat32 partition (and I wish to keep it like this), second wine is a beta progs, meaning there's some strange bugs, like it has some problem resizing windows. Mean that if I start something in my 1280x1024 resolution, wine will only use a small square of 640x480. Ugly. And don't tell me my wine config isn't good I have tried a lot of things, if wine start the progs in full screen, it creates different problems. yes, there is EVER reasons to do that. and ANYWAYS it's not really dangerous to start an X at root, X isn't a major vulnerability, especially when it doesn't listen for external connection. |
Re: Re: Switching between root and user
Quote:
|
The difference between "su -" and "su" is, probably, that one will give you a "fully root" command line (with the options defined for user "root"), while the other will retain the options of the user entering "su".
Can't remember which is which, though... I use sudo myself... :D |
This is from the rute manual.
Quote:
regards... |
All times are GMT -5. The time now is 03:42 PM. |