Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Suse Linux on my desktop. So I am root and "normal" user. Frequently e.g. to start tomcat or install/remove a program I should use sudo or switch to super user. But I have defined many aliases in .bashrc, path in .profile etc.

Is it possible to assign to normal user some rights of super user? E.g. to install program?

share|improve this question
up vote 5 down vote accepted

Yes, but it's the worst thing you can do. There are different users with different permissions in your OS. And that is on purpose. Giving root permissions to your user permanently will compromise the security of the system. (Remember Windows 9x and all the viruses ?)

Executing a command with sudo wont need any of your customization stuff I guess, unless you execute /bin/sh (a shell).

To achieve what you wanted you can do the following:

You can move your stuff from ~/.bashrc and ~/.profile to the system /etc/bash/bashrc and /etc/profile, or even better put them in separate script in /etc/profile.d/mystuff.sh (dont forget chmod +x /etc/profile.d/mystuff.sh). These files will be executed for each login session.

Then start a root session with su -, the - (minus) sign passed to su will execute a login session and therefor will execute the files mentioned above. Depending on your linux distribution you may need to call sudo su - instead.

Once you finish with the root session, it's good idea to logout and leave the root permissions.

There is another way if you need root permissions only for specific binary, it's called Effective UID. For example you may use this for mtr binary:

chmod a+s `which mtr`

This way when you execute the mtr binary it will get effective permissions of the user who owns the binary - root in this case (chown root /path/to/mtr). It will save you the sudo typing, but you should carefully choose which binary you will give root permissions. It's dangerous if you do not know the risk. Better use the first option.

share|improve this answer

Starting of tomcat should be done in an init-script. If you want to give a group of users the right to (re)start tomcat, add a line to /etc/sudoers using visudo. This could look like:

%tomcatcontrol localhost = NOPASSWD : /etc/init.d/tomcat *

Replace localhost with the name of your machine. Then each user of the group tomcatcontrol will be able to issue:

sudo /etc/init.d/tomcat restart (or status, or stop, or start).

That is what sudo is for. If you want to work longer with the root-account you can do su -. If you want other users to actually manage tomcat contents (files owned by user tomcat) you could allow a su - tomcat for a user or group of users.

As for your aliasses - I think OpenSuSE has /etc/profile.local for that purpose: There you can put stuff that should be valid for every user.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.