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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
06-08-2017, 02:09 PM
|
#1
|
Member
Registered: Aug 2012
Posts: 35
Rep:
|
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.
|
|
|
06-08-2017, 02:11 PM
|
#2
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
Sudo?
|
|
|
06-08-2017, 02:14 PM
|
#3
|
Member
Registered: Aug 2012
Posts: 35
Original Poster
Rep:
|
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.
|
|
|
06-08-2017, 02:36 PM
|
#4
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
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.
|
06-08-2017, 02:40 PM
|
#5
|
Member
Registered: Aug 2012
Posts: 35
Original Poster
Rep:
|
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
|
|
|
06-08-2017, 02:50 PM
|
#6
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,914
|
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.
|
|
|
06-08-2017, 02:53 PM
|
#7
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
Quote:
Originally Posted by mtsoule
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.
|
|
|
06-08-2017, 02:57 PM
|
#8
|
Member
Registered: Aug 2012
Posts: 35
Original Poster
Rep:
|
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.
|
|
|
06-08-2017, 03:07 PM
|
#9
|
Senior Member
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,950
|
deleted
Last edited by JeremyBoden; 06-08-2017 at 03:09 PM.
|
|
|
06-08-2017, 03:12 PM
|
#10
|
Senior Member
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Rep:
|
|
|
|
06-08-2017, 04:01 PM
|
#11
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
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 04:08 PM.
|
|
|
06-08-2017, 04:14 PM
|
#12
|
Moderator
Registered: Mar 2008
Posts: 22,177
|
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.
|
|
|
06-08-2017, 04:17 PM
|
#13
|
LQ Guru
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
|
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.
|
06-08-2017, 04:18 PM
|
#14
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
Quote:
Originally Posted by jefro
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?
|
|
|
06-08-2017, 04:31 PM
|
#15
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,797
|
This will work with no special setup: 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.
|
|
|
All times are GMT -5. The time now is 03:28 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|