2012年7月4日 星期三

(Pseudo-)Enable root in Mac OSX Snow Leopard

To enable root in terminal, Try "dsenableroot". You wil be prompted for your password and then what you want as root password and then a confirmation of the root password. "dsenablerood -d" disbles the root password


Here is part or the man page.


dsenableroot -- enables or disables the root account.


SYNOPSIS


dsenableroot [-d] [-u username] [-p password] [-r rootPassword]


DESCRIPTION
dsenableroot sets the password for the root account if enabling the root user account. Otherwise, if disable [-d] is chosen, the root account passwords are removed and the root user is disabled.


A list of flags and their descriptions:


-u username
Username of a user that has administrative privileges on this computer.


-p password
Password to use in conjunction with the specified username. If this is not specified, you will be prompted for
entry.


-r rootPassword
Password to be used for the root account. If this is not specified for enabling, you will be prompted for
entry.



There's no reason I'm aware of to enable the root user. If you need to do things as root, simply type sudo -s in the Terminal to start a shell with root access and proceed from there.


or

use sudo su - which makes sure that you keep the same shell settings as you had in you administrator settings



reference: http://hints.macworld.com/article.php?story=20090909081659323

沒有留言:

張貼留言

文章分類