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 06-08-2017, 01:09 PM   #1
mtsoule
Member
 
Registered: Aug 2012
Posts: 35

Rep: Reputation: Disabled
Logging in as a user with root password


we are currently running SLES 11, with LTSP and about 30 users. I am the admin and have the root password, what I would like to do is log in as a user "Mike" with out Mikes password and essentially be Mike, is this possible, I do have the root password.

I know I can SU to mike, but I still need his password.. I do not want to change his password.

the reason I want to do this is for privilege testing and application testing.
 
Old 06-08-2017, 01:11 PM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,344

Rep: Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258
Sudo?
 
Old 06-08-2017, 01:14 PM   #3
mtsoule
Member
 
Registered: Aug 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
Sudo, wont give me what I want, I don't want to be root, I want to be Mike.

our users have their own password, and I do not know what they ware, and I don't want to know what they are, but I need to be them, to test.
 
Old 06-08-2017, 01:36 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651
You are saying that you are logged in as 'root' and when you type 'su - mike' it asks you for a password?

That is not my experience as 'root'

Code:
[root@test-box ~]# su - user
[user@test-box ~]$
 
2 members found this post helpful.
Old 06-08-2017, 01:40 PM   #5
mtsoule
Member
 
Registered: Aug 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
no, I am not root. but I have the root password

your example does work. question, in doing an "su" do I have user prevs or root prevs?

also (and I should have mentioned this in the beginning, but I would like to be able to log in as the user in the gnome GUI
 
Old 06-08-2017, 01:50 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: MA, USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 7,998
Blog Entries: 13

Rep: Reputation: 3446Reputation: 3446Reputation: 3446Reputation: 3446Reputation: 3446Reputation: 3446Reputation: 3446Reputation: 3446Reputation: 3446Reputation: 3446Reputation: 3446
I don't understand why you "have" to login as these other users. You are, or can be root, for one, and you also can use sudo.

If there's something you need these users to do, then enable them by providing them with a script. If they come to you to do something recurring and you have to use their privileges to do that, then it would seem you could enable them with a process or script.

I suppose a little more insight as to why this is an adamant configuration need on your part.
 
Old 06-08-2017, 01:53 PM   #7
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,344

Rep: Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258
Quote:
Originally Posted by mtsoule View Post
Sudo, wont give me what I want, I don't want to be root, I want to be Mike.

our users have their own password, and I do not know what they ware, and I don't want to know what they are, but I need to be them, to test.
Talk to somebody who knows what they are doing and ask them to set it up for you.
Please, for everyone's good, step away from the computer now!

Apologies for potentially breaking forum rules but I do not think that letting somebody ignorantly assume the power of other users is in the best interest of anyone else.
 
Old 06-08-2017, 01:57 PM   #8
mtsoule
Member
 
Registered: Aug 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
it is just for testing prevledges, I want to be sure Mike can access what he needs to and not what he shouldn't.

also, I have a case where Larry had a problem with his email, so in order to launch thunderbird for his email, I had to do it from his account. however in that case I was able to use SU

and perhaps I am thinking too much in to this...

it would lust be nice for testing to be able to be the user, without having them have to change their password, or ask what it is.
 
Old 06-08-2017, 02:07 PM   #9
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,532

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
deleted

Last edited by JeremyBoden; 06-08-2017 at 02:09 PM.
 
Old 06-08-2017, 02:12 PM   #10
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,239
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Differences between 'su' and 'su -'
 
Old 06-08-2017, 03:01 PM   #11
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
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.

Last edited by AwesomeMachine; 06-08-2017 at 03:08 PM.
 
Old 06-08-2017, 03:14 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,149

Rep: Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918
I've never tried this but sudo su -user may work. Not sure.

It would be simple to go to Mike and tell him that you are the admin and you need his password. No one ever stops me from asking.
 
Old 06-08-2017, 03:17 PM   #13
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,016
Blog Entries: 5

Rep: Reputation: 2859Reputation: 2859Reputation: 2859Reputation: 2859Reputation: 2859Reputation: 2859Reputation: 2859Reputation: 2859Reputation: 2859Reputation: 2859Reputation: 2859
Personally I would set up a dummy user with exactly the same permissions as the user you want to test the privileges for.

That dummy user can then be modified accordingly to mimic different setups while maintaining a clear boundary between administrator and user.
 
1 members found this post helpful.
Old 06-08-2017, 03:18 PM   #14
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,344

Rep: Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258Reputation: 2258
Quote:
Originally Posted by jefro View Post
It would be simple to go to Mike and tell him that you are the admin and you need his password. No one ever stops me from asking.
That isn't really good practice, now, is it?
OK, perhaps I'm making this a bigger thing than it is but is it really a good thing to ever have a semi-skilled "administrator" log in as other users on any system?
 
Old 06-08-2017, 03:31 PM   #15
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,271

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
This will work with no special setup:
Code:
su -c "su - mike"
The first "su" will ask for the root password, then the second, which is running with root privileges, will launch a shell as user "mike" with no password required.
 
  


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
[SOLVED] Root password not accepted after logging in. herakles_14 Mageia 7 11-29-2015 08:25 AM
GNOME: Gain privileges using current user's password instead of root's password maxkukartsev Fedora 5 02-10-2012 09:46 AM
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
Logging On As Root User BACTRATE Mandriva 6 02-16-2004 10:48 AM
Logging in as root with incorrect password! Colonel Panic Linux - General 2 08-03-2001 02:57 PM

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

All times are GMT -5. The time now is 07:13 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