LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Logging in as a user with root password (https://www.linuxquestions.org/questions/linux-newbie-8/logging-in-as-a-user-with-root-password-4175607550/)

lazydog 06-13-2017 11:26 AM

Quote:

Originally Posted by mtsoule (Post 5721885)
perhaps safest thing is SU. but, I need to test if I SU to Mike from Root, do I have mikes prevs, or root prevs? I would assume Mikes, otherwise there would be no point.

Perhaps? It is the best option.

su Mike
"no hyphen" will keeps your existing environment

su - Mike
"hyphen" will create a new environment with the settings of the actual user, not your own.

The answer your question is 'su - Mike' form within root.
I would first let them know that you are going to do this just to be upfront about it.

frieza 06-13-2017 11:52 AM

Quote:

Originally Posted by AwesomeMachine (Post 5720662)
su stands for switch user. It can be any user if changing from root to user. I don't think you need a pw to switch from root to a regular user. And when you have a shell run as a user, it doesn't have root privileges. It has that user's privileges.

If you want a certain users gnome session, I don't think that is possible in the strict sense. You might be able to examine some things, but without the pw it seems hopeless, because gdm3 greeter has no way to log in as a user with the root pw.

Unless perhaps you wee to for instance launch gnome as root, switch to the user in a terminal, and launch say thunderbird from the user shell. If you're persistent enough there is always some way. or perhaps
Code:

$ su -user startx &
might bypass the login screen.

getting a gnome desktop as user -mike for instance might be possible with xnest or Xephyr ( eg DISPLAY=:X su -user gnome-session&) where :X is the display # of the xnest/Xephyr window

Shadow_7 06-13-2017 02:27 PM

You can share X with multiple users.

$ xhost local:
(as the user who started X)

or

$ xhost local:user
(user specific access, in addition to the one who started X)

and

$ xhost

to list

$ xauth list

For more of the magic behind the scenes. No real need to restart X or start X in X with Xephyr or Xnest. Although I find Xephyr + Xdmx to be useful for really tall xterms without rotating the monitor. Not so good for editing though as it's been untouched too long and uses old input methods.


All times are GMT -5. The time now is 05:06 AM.