Ask Your Question

As su switch user without password

asked 2015-07-09 08:39:27 -0500

sjmolinski gravatar image

I currently have more than a hundred different users and groups which control their own files via git. Is there a way for me to quickly switch to a user from the su without using the password for these users?

Essentially I want to do a git commands and preserve the users name and group when I access it as root. How can do this? I am currently using Fedora 22.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-07-11 00:42:22 -0500

Saule gravatar image

I think you can simply do sudo su - <user>. For that you need to be in the sudoers group, you have to put yourself in /etc/sudoers. Also take take care of the hypen in the su command, without that the login script of the user you are becoming is not executed.

edit flag offensive delete link more


I think I may be a little too new to this, so help me out. When I switch to root via "su" command, I am using it to transverse the paths to get to several projects. Each of these projects directories are or owned by various users. When I am finally in the directory I want to be I just want to switch to the owner and do some work. The 'local' user that I would be switching to can't be a sudo user for security reasons.

I maybe missing something, but what you are suggesting doesn't make sense if I am already using root. I will however try it :D

sjmolinski gravatar imagesjmolinski ( 2015-07-12 09:52:50 -0500 )edit

Question Tools

1 follower


Asked: 2015-07-09 08:39:27 -0500

Seen: 1,007 times

Last updated: Jul 11 '15