su password

Joined
Feb 28, 2005
Messages
198
Reaction score
7
Points
18
Location
Bagshot, Surrey, UK
Your Mac's Specs
Powerbook 17" 1.5GHz, 2GB, 160GB Momentus; iMac 24" 3.06GHz, 2GB; iPhone 2.5G 8GB; iPod 5G 60GB
I feel so stupid asking this... but...

I have 2 accounts set up on my Powerbook (one for me, one for my wife). My account is the first account which was set up and has a password.

However, when I try to su from a shell, this password doesn't work. What password am I being asked for when I su?

I don't remember setting up any other passwords when I first set up the machine other than the account password for my account.

Any help appreciated... I'm sure the answer will make me groan!
 
M

meltbanana314

Guest
thermidor said:
I feel so stupid asking this... but...

I have 2 accounts set up on my Powerbook (one for me, one for my wife). My account is the first account which was set up and has a password.

However, when I try to su from a shell, this password doesn't work. What password am I being asked for when I su?

I don't remember setting up any other passwords when I first set up the machine other than the account password for my account.

Any help appreciated... I'm sure the answer will make me groan!

The correct term is "sudo" though it's often abbreviated to 'su'.

You are being asked for *your* password, but you have to be on the /etc/sudoers list I believe.
 
OP
T
Joined
Feb 28, 2005
Messages
198
Reaction score
7
Points
18
Location
Bagshot, Surrey, UK
Your Mac's Specs
Powerbook 17" 1.5GHz, 2GB, 160GB Momentus; iMac 24" 3.06GHz, 2GB; iPhone 2.5G 8GB; iPod 5G 60GB
I was phrasing on the basis that sudo runs another process as superuser, but su drops the shell into superuser login... hence my usage of su, if that makes sense. What I'm literally trying to do is type su into a shell. But I presume the answer to my question is independent of whether I su or sudo!

Problem: cat /etc/sudoers gives Permission Denied - Catch 22!
 
Z

zero17

Guest
thermidor said:
I feel so stupid asking this... but...

I have 2 accounts set up on my Powerbook (one for me, one for my wife). My account is the first account which was set up and has a password.

However, when I try to su from a shell, this password doesn't work. What password am I being asked for when I su?

I don't remember setting up any other passwords when I first set up the machine other than the account password for my account.

Any help appreciated... I'm sure the answer will make me groan!

I used to have the same problem, because of apple is not make root account set up on every account (different w/ linux). I forgot how I did it, but basically you have to set up your root password first if you haven't create one. and after you set it up, you would be able to login as a root with "su" on the terminal.

I found this on the net, and hopefully help:

First thing - enable the root account

For some reason... Apple doesn't make the root account setup part of the installation - so you'll probably realize you can't use the account the first time you have the need.

Quickest fix... just do a 'sudo passwd root' and run through the passwd prompts to establish your new root password.

There are other indirect ways to accomplish the same thing... but chances are you're already in a terminal.

or check this out for enabling root on mac os x
http://noether.vassar.edu/~myers/help/apple/EnableRoot.html

hopefully help..
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
There's a good reason Apple didn't enable root. What are you trying to do that you can't use sudo?
 
Joined
Mar 9, 2004
Messages
2,860
Reaction score
21
Points
38
Location
Miami FL
Your Mac's Specs
G4 1Ghz OS X 10.4.7
SUDO = super user do operation SU = switch user need user switch to name to procede SU:
NAME
su - substitute user identity

SYNOPSIS
su [-flm] [login] [-c shell arguments]

DESCRIPTION
su requests the password for login and switches to that user and group ID
after obtaining proper authentication. A shell is then executed, and any
additional shell arguments after the login name are passed to the shell.
If su is executed by root, no password is requested and a shell with the
appropriate user ID is executed.

The options are as follows:

-c Invoke the following command in a subshell as the specified user.

-f If the invoked shell is csh(1), this option prevents it from
reading the ``.cshrc'' file.

-l Simulate a full login. The environment is discarded except for
:
 
OP
T
Joined
Feb 28, 2005
Messages
198
Reaction score
7
Points
18
Location
Bagshot, Surrey, UK
Your Mac's Specs
Powerbook 17" 1.5GHz, 2GB, 160GB Momentus; iMac 24" 3.06GHz, 2GB; iPhone 2.5G 8GB; iPod 5G 60GB
cradom said:
There's a good reason Apple didn't enable root. What are you trying to do that you can't use sudo?

I can't use sudo because it won't accept my normal login password... zero17 was telling me how to set up the root account so I can use the root password for sudo. Is there another way?
 
Joined
Apr 25, 2003
Messages
1,301
Reaction score
62
Points
48
Location
The home of the free and the land that did for Bra
Your Mac's Specs
24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs
thermidor said:
I feel so stupid asking this... but...

I have 2 accounts set up on my Powerbook (one for me, one for my wife). My account is the first account which was set up and has a password.

However, when I try to su from a shell, this password doesn't work. What password am I being asked for when I su?

I don't remember setting up any other passwords when I first set up the machine other than the account password for my account.

Any help appreciated... I'm sure the answer will make me groan!

If you just type su without an account name it will default to root which probably doesn't exist, you have to type su <username>.

Of courese if that is what you are doing I would say check that you are using the correct case for both username and password as unix is case sensitive.

i.e if you used the username Chris and you are trying to su chris it won't work.

Amen-Moses
 
Z

zero17

Guest
I don't know if this will help, I found it few weeks ago:

File and Folder Ownership

Again, here is an item which I experienced, but you might not. In case you do, though, you'll have a fix at hand. For reasons that had more to do with a broken NetInfo database than anything else, Jaguar didn't recognize me as me. I might as well have been somebody else, and to Jaguar I was. The solution was to take ownership of my original Home folder and its tree. There are two ways. The Mac way is to press Cmd-I while Home is highlighted in a Finder window, and make yourself the owner of this folder and all of its contents. The unix way is to pop a Terminal window and type the following:


% man chown Check manual before starting (spacebar through)
% pwd Verify present working directory
% cd .. Move up one level above Home folder
% ls List contents
% sudo chown -R damien damien Take ownership of Home tree
% cd / Move into root folder
% sudo chown -R damien Applications Take ownership of Applications
% exit

Now, it's obvious enough why you should take ownership of your own stuff, but why Applications? Because you want to be able to add and remove items from it. Now the test is whether or not you are free to do this now. If you are, then leave it alone. But if it's a problem, you will know what to do.

If things get really nasty, you may have to set file permissions also. I don't recommend this lightly, because certain files and folders have tighter security than others for a reason. But if you have to, here is how to set permissions on all of the files in your Home folder:


% man chmod Check manual before starting (spacebar through)
% pwd Verify present working directory
% cd .. Move up one level above Home folder
% ls List contents
% sudo chmod -R 640 damien Set permissions in Home tree
% cd / Move into root folder
% sudo chmod -R 755 Applications Set permissions in Applications
% exit

If you absolutely have to set permissions on your Home folder, then also set tighter permissions on private files and folders. The code 740 makes a file usable by you, readable by other group members, and off-limits to anybody else. The code 600 sets it to read/write by you alone. The -R switch sets the recursive bit, so that all contained files and folders also get set. If you happen to use public and private keys, I recommend you create new key pairs after monkeying with permissions in Home. In general, this is very tricky stuff. Don't leave the door open, but don't lock yourself out either. Which brings us to a related topic.
 
Joined
Feb 11, 2004
Messages
125
Reaction score
1
Points
18
Location
Orlando, Florida
Your Mac's Specs
1.6 ghz G5, Dual Monitors / 17" PowerBook 1.33 / 12" iBook
To enable the root user:
Open NetInfo Manager, located in Applications > Utilities.
Choose Security > Enable Root User and type a password for the root account. You may need to type an administrator password to make these changes.
Choose Apple menu > Log Out.
Choose Other in the Login window, type root in the Name field, and the root password in the Password field.
 
Joined
Jun 25, 2004
Messages
1,779
Reaction score
65
Points
48
Location
Luxemburg, Europe
Your Mac's Specs
PowerMac G5 Dual 2GHz (June 2004), 2.5GB, Airport, black 5G iPod 30GB, white MacBook 2.0 2GB
GLJones said:
To enable the root user:
Open NetInfo Manager, located in Applications > Utilities.
Choose Security > Enable Root User and type a password for the root account. You may need to type an administrator password to make these changes.
Choose Apple menu > Log Out.
Choose Other in the Login window, type root in the Name field, and the root password in the Password field.

That's the correct way to enable the root account in OS X...
But don't forget, the root user has ABSOLUTELY NO RESTRICTION, means there is no protection whatsoever against errors. If, as root, you throw away a system related item, it will destroy your OS, and you're welcome for a new install session...

So you better know EXACTLY what you're doing.

That's why Apple by default disables the root account, it's nothing to play around with...
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top