The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

Things look quiet here. But I've been doing a lot of blogging at dan.langille.org because I prefer WordPress now. Not all my posts there are FreeBSD related. I am in the midst of migrating The FreeBSD Diary over to WordPress (and you can read about that here). Once the migration is completed, I'll move the FreeBSD posts into the new FreeBSD Diary website.

su - how to become a super user. avoid using root 18 October 1998
Need more help on this topic? Click here
This article has 2 comments
Show me similar articles
If you're like most people new to Unix, you do everything as root.  You shouldn't.   I know I don't follow my own advice, but I'm trying to improve.

Create yourself another account.  Use that instead of root.  Unless you really need root.  You can always invoke su to become a super user.   That way, you don't have to log out and back in every time you need the power.

wheel
Only users in the wheel group can run su.  The group can be specified when creating a user via adduser.  To add a user manuall, just put the name of the user at the end of the line in /etc/group.  For example:
wheel:*:0:root,marc

This adds the user marc to the wheel group.

su
To become super user, you do this:
bash-2.02$ su
Password:
su-2.02#

At the password prompt, supply the root password.

Note that you might also want to use either the -l or the -m options.  Respectively, these options will simulate a full login or leave the environment unmodified.  see man su for details.


Share
Need more help on this topic? Click here
This article has 2 comments
Show me similar articles