Root user in MacOSX

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Root user in MacOSX
# 1  
Old 12-26-2005
Root user in MacOSX

Hello, Do you guys know how does the root user works in this system?

from the terminal i try to su to root, and i thought the password was the same as the macosx password, at the /etc/passwd file the passwd field appears as *, so it's system bussines only, is there a way to become root? i thought since i was the only user registered in the system i was kind of like root... guess not Smilie

thanks.
# 2  
Old 12-26-2005
Prefixing each command with sudo works well. Also, you only need to enter a password once per session.
# 3  
Old 01-07-2006
Re: Root User in MacOS X.

Gee, it's been a while since I did this.

Use the NetInfo Manager (in /Applications/Utilities). "Unlock" the access, and the system will ask you for YOUR password. You can then go th the columnar display, click on users, and the list of users will appear in the 'next-right' column. Click on root, and all the info on 'root' will appear in the bottom window. Double click on the field to the RIGHT of the 'password' label, which is the encrypted password for 'root'. CLEAR that field, and 'submit it' by hitting 'Return'. Then hit <Command>-S, to SAVE this new data. You can then open a terminal window, and "su -". A password will be asked for, and the 'Return' will be it. Change the root password to something secure by entering: "passwd root". This will NOW be the 'root password', and you will be able to login at the "login window" AS root, and "su"-ing in a terminal session will work as expected.
# 4  
Old 01-13-2006
I tried that, sudo still returns an incorrect password error.

running 10.4.4
# 5  
Old 01-13-2006
Quote:
Originally Posted by cymon
I tried that, sudo still returns an incorrect password error.

running 10.4.4
This is because sudo != su. SUDO has it's own 'privileges file'. On MacOS X, this file is: /private/etc/sudoers

You MUST edit this file with 'visudo' AS root, to establish how you want sudo to behave.

So, first go HERE in your browser:
http://www.almaren.org/tmp/sudoers.sample

Then, with the file in your browser as a guide enter (in a terminal window):
'su -' <return>
visudo <return>

You will then have an *example* reference 'sudoers' file in your browser, and be editing the 'sudoers' file in a terminal window.
The sample 'sudoers' file, in your browser, will help you set up your 'sudoers' file that you are editing.

Last edited by dsbeerf; 01-13-2006 at 05:51 PM..
# 6  
Old 01-19-2006
It should be much simpler than that. If you are designated as an admin for that system, type: sudo [whatever command you wanted to use]
You'll be presented with a prompt for a password. Type "your" password, not root's, not the the File Vault password, but "your" password.

If your account is "allowed to administer this computer" then you are automagically added to the sudoers file.
Which version of OS X are you using?
# 7  
Old 01-19-2006
Quote:
Originally Posted by [MA]Flying_Meat
It should be much simpler than that. If you are designated as an admin for that system, type: sudo [whatever command you wanted to use]
You'll be presented with a prompt for a password. Type "your" password, not root's, not the the File Vault password, but "your" password.

If your account is "allowed to administer this computer" then you are automagically added to the sudoers file.
Which version of OS X are you using?
Yup. You are correct. I started off telling how to get 'su' to work, I 'kept going' describing 'sudo', and I should have quit while I was ahead. You only need to futz around with visudo (and all that other 'stuff') if another user (not the Owner/Administrator) needs sudo.

Sorry, my mistake. (Hey -- THANKS !!)
---
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Switch from Local user to root user from a shell script?

Hi, I need to switch from local user to root user in a shell script. I need to make it automated so that it doesn't prompt for the root password. I heard the su command will do that work but it prompt for the password. and also can someone tell me whether su command spawns a new shell or... (1 Reply)
Discussion started by: Little
1 Replies

2. UNIX for Dummies Questions & Answers

Switching from root to normal user takes me to user's home dir

Whenever i switch from root to another user, by doing su - user, it takes me to home directory of user. This is very annoying as i want to be in same dir to run different commands as root sometimes and sometimes as normal user. How to fix this? (1 Reply)
Discussion started by: syncmaster
1 Replies

3. Shell Programming and Scripting

How to give root access to non root user?

Currently in my system Red Hat is installed. And Many user connect to my machine via SSH Techia Terminal. I want to give some users a root level access. Can anyone please help me how to make it possible. I too searched on the Google but didn't find the correct way Regards ADI (4 Replies)
Discussion started by: adisky123
4 Replies

4. UNIX for Advanced & Expert Users

Root and non-root user not able to delete the file

Hi!! one strange problem occurred with my RHEL 5 box. i'm having logs folder with ownership of non-root user. Created some files with root user under logs folder. here is the scene: -rw-r----- 1 root root 1048227 Feb 28 12:34 SystemOut_13.02.28_12.34.10.log -rw-r----- 1 root root ... (6 Replies)
Discussion started by: sukhdip
6 Replies

5. Shell Programming and Scripting

How to Login as another user through Shell script from current user[Not Root]

Hi Every body, I would need a shell script program to login as different user and perform some copy commands in the script. example: Supppose ora_toms is the active user ora_toms should be able to run a script where user: ftptomsp pass: XXX should login through and run the commands ... (9 Replies)
Discussion started by: ujjwal27
9 Replies

6. UNIX for Dummies Questions & Answers

Restricting Usage of Setuid Programs to the Admin User In MacOsx

This is a quote from the Apple security configuration (you can download it from Apple) " Using ACLs to Restrict Usage of Setuid Programs The ACL feature of Mac OS X can also be used to restrict the execution of setuid programs. Restricting the execution of setuid programs to administrators... (3 Replies)
Discussion started by: Vera
3 Replies

7. UNIX for Dummies Questions & Answers

Sudo to delegate permission from non-root user to another non-root user

I've been through many threads before i decide to create a separate thread. I can't really find the solution to my (simple) problem. Here's what I'm trying to achieve: As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user. The only to achieve this is to... (1 Reply)
Discussion started by: canar
1 Replies

8. Solaris

java version mismatch for normal user and root user

:confused: I installed latest version of java ( jre 1.6) on Solaris Machine ......when I run java -version as root, shows the latest version but when I run java -version as normal user, shows the old / previous version What should I do to fix this ...should show the latest version... (3 Replies)
Discussion started by: frintocf
3 Replies

9. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

10. Shell Programming and Scripting

root user command in shell script execute as normal user

Hi All I have written one shell script for GPRS route add is given below named GPRSRouteSet.sh URL="www.google.com" VBURL="10.5.2.211" echo "Setting route for $URL for GPRS" URL_Address=`nslookup $URL|grep Address:|grep -v "#"|awk -F " " '{print $2}'|head -1` echo "Executing ... (3 Replies)
Discussion started by: mnmonu
3 Replies
Login or Register to Ask a Question