Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Root login behaviour
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
catchpole
Tux's lil' helper
Tux's lil' helper


Joined: 03 Sep 2014
Posts: 103
Location: Leeds UK

PostPosted: Tue Feb 17, 2015 6:44 am    Post subject: Root login behaviour Reply with quote

when I log in as root I get the xfce desktop.
I only wanted this for my regular user session.

I'm using the xdm login.

How can I change it so that when I log in as root it goes to the command line?
_________________
Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Tue Feb 17, 2015 8:11 am    Post subject: Reply with quote

Well, you shouldn't log into X with root. Ever.

Just switch to another terminal with Ctrl+Alt+Fx where x!=7 (that's the terminal which is usually occupied by X).

Also you can just open a graphical terminal with your normal user and in it swith to root with su. Your regular user just needs to be in the wheel group.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Tue Feb 17, 2015 8:19 am    Post subject: Reply with quote

Properly configured, sudo is an outstanding tool. It should eliminate 99.999% of your root login needs. su works also, so which you use depends on style.

That said switching a different TTY is an exellent work around. Personally, I prefer using no login manager and using a .zshrc file to automatically start X as my user when I log in from the command line. Root should be kept far away from anything flashy or complex.

Okay, I know this is a suggestion to avoid the problem rather than fix the problem, but sometimes the best solution to a problem is to avoid having it in the first place. As someone said, it makes more sense to unload a firearm than to shoot it into a bullet proof vest.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Tue Feb 17, 2015 8:24 am    Post subject: Reply with quote

I guess that login managers which can be configured to disallow root login should have this in the default configuration.

The problem I have with sudo is that you must configure it properly. Especially since you don't need root's password to use it. And the default Ubuntu sudo config (everyone can do everything) makes me think that whoever thought it's smart should be slapped around for a while.
Back to top
View user's profile Send private message
catchpole
Tux's lil' helper
Tux's lil' helper


Joined: 03 Sep 2014
Posts: 103
Location: Leeds UK

PostPosted: Tue Feb 17, 2015 9:31 am    Post subject: Reply with quote

OK guys, thanks for the good advice.

I can change to a tty with ctrl+alt+f2. (After some experimentation)
And get back to my regular user with ctrl+alt+f7.

I tried a sudo command from my regular user and got:

Quote:
User is not in the sudoers file. This incident will be reported.


I guess from this that I have sudo installed.

Where can I read about setting up the sudoers file?
Any tips on doing this would be welcome.
_________________
Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Tue Feb 17, 2015 9:57 am    Post subject: Reply with quote

catchpole wrote:
Where can I read about setting up the sudoers file?
Any tips on doing this would be welcome.
Instead of working through complicated sudo setup you might consider not using sudo at all.
Then you don't even need to have sudo installed.
Try su -c "your command" and it will ask you for root login just only for your command.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Tue Feb 17, 2015 11:55 am    Post subject: Reply with quote

It's not hard to find ;) http://wiki.gentoo.org/wiki/Sudo

Also you can just use `su` instead `su -c <command>`. I find it the most convenient.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Feb 17, 2015 11:56 am    Post subject: Reply with quote

catchpole wrote:
Where can I read about setting up the sudoers file? Any tips on doing this would be welcome.

catchpole ... as always 'man <command>', in your case 'man sudoers', though if you use 'visudo' you can read and edit /etc/sudoers ... which has some examples (note, always edit sudoers with 'visudo').

charles17 wrote:
Instead of working through complicated sudo setup you might consider not using sudo at all. Then you don't even need to have sudo installed. Try su -c "your command" and it will ask you for root login just only for your command.

@charles17 ... while I don't generally recommend sudo (UOSCH) its not so complicated, its just people have a tendency to do ALL=(ALL) NOPASSWD: ALL for convenience.

best ... khay
Back to top
View user's profile Send private message
catchpole
Tux's lil' helper
Tux's lil' helper


Joined: 03 Sep 2014
Posts: 103
Location: Leeds UK

PostPosted: Tue Feb 17, 2015 2:03 pm    Post subject: Reply with quote

Thanks guys,

I'll try to setup sudo just to increase my knowledge and experience.

However if I want to do anything serious I'll use the tty. (Now that I know how to get in to it and return to the GUI)
_________________
Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum