Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > 2 Mac OS X questions from a semi-experienced unix user and mac newbie

2 Mac OS X questions from a semi-experienced unix user and mac newbie
Thread Tools
VenomSnake
Fresh-Faced Recruit
Join Date: Jun 2004
Location: USA
Status: Offline
Reply With Quote
Jun 16, 2004, 10:18 PM
 
1. Is there any way to view the contents on / (and I mean the real contents not just the 5 folders finder tells you is on the HD) in finder. I know you can open other hidden folders by just typing "open (folder name)" in a terminal window, but if you type "open /" it just opens the HD and shows you the same 5 folders.

2. How do I log in as root. If I type login in the terminal and enter root as the username with no pass, it says login incorrect. As far as I know I did not set a password for root. Is there a default password or something?

Thanks is advance.
     
Millennium
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jun 16, 2004, 10:23 PM
 
[QUOTE]Originally posted by VenomSnake:
2. How do I log in as root. If I type login in the terminal and enter root as the username with no pass, it says login incorrect. As far as I know I did not set a password for root. Is there a default password or something?
No. The root account is disabled by default in OSX; use sudo instead. You can re-enable root using the NetInfo manager, but there is no good reason to do so.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
VenomSnake  (op)
Fresh-Faced Recruit
Join Date: Jun 2004
Location: USA
Status: Offline
Reply With Quote
Jun 16, 2004, 10:29 PM
 
Millenium, can you access folders such as /var/root using sudo? Because there are certain folder that only root can access in some unix variants.
     
karbon
Dedicated MacNNer
Join Date: Aug 2001
Location: Norway
Status: Offline
Reply With Quote
Jun 16, 2004, 10:29 PM
 
Originally posted by VenomSnake:
1. Is there any way to view the contents on / (and I mean the real contents not just the 5 folders finder tells you is on the HD) in finder. I know you can open other hidden folders by just typing "open (folder name)" in a terminal window, but if you type "open /" it just opens the HD and shows you the same 5 folders.
You can use the terminal, going to a folder (cd) and then do a "ls -la" to list the actual content of the folder. If you want to see everything in the Finder (not really recommended because it'll get pretty cluttered, and what is the use?) you might want to try a program called Xupport (get it at versiontracker), it also have some other nice options to tweak the Finder.


2. How do I log in as root. If I type login in the terminal and enter root as the username with no pass, it says login incorrect. As far as I know I did not set a password for root. Is there a default password or something?
Taken from macosxhints.com:

1) Open NetInfo Manager
2) Select "Users" from the second list.
3) Select a user you created andnd know the password for!
4) Double-click on the value across from "passwd" and copy it. It is the encoded form of the password for that user.
5) Select "root" from the list of users. Find the "passwd" value (default is "*") and paste over it.
6) Exit Netinfo Manager.
7) Open the Terminal and type "su root".
8) Enter the password for the user chosen above.

More (and the risks involved in enabling root) at:
http://www.macosxhints.com/article.p...10324095804436

Hope it gets you started, and congratulations as a Mac-user
[email protected]
"In the long run we're all dead" - Keynes
     
VenomSnake  (op)
Fresh-Faced Recruit
Join Date: Jun 2004
Location: USA
Status: Offline
Reply With Quote
Jun 16, 2004, 10:38 PM
 
Thanks Karbon. Haha after I found out about that netinfo manager I figured everything out before you even posted it though (just to tell you, you can delete what is in the current password field for root and login with no pass, then change it to anything you want). And about the finder thing, thanks for pointing out that program, i'll try it.
     
chabig
Addicted to MacNN
Join Date: Jun 1999
Location: Las Vegas, NV, USA
Status: Offline
Reply With Quote
Jun 16, 2004, 10:49 PM
 
Is there any way to view the contents on /?
Another useful program is TinkerTool (http://www.bresink.com/osx/TinkerToolSys.html). It lets you turn on the display of all hidden files and folders in the Finder, but it also does much more. Many of these features are really just preferences that can be turned on and off. You can do it in the terminal, but the GUI tools are easier.

Chris
     
mitchell_pgh
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Jun 16, 2004, 10:58 PM
 
and if you are a unix user, you may want to check out terminal.

It's in your application folder, in the utilities folder.

You should feel very much at home.
     
VenomSnake  (op)
Fresh-Faced Recruit
Join Date: Jun 2004
Location: USA
Status: Offline
Reply With Quote
Jun 16, 2004, 11:00 PM
 
Haha yea thanks. Terminal was the first thing I found in OS X
I just like using GUIs because it's so much easier, but not seeing half the stuff I know is really there kinda makes me angry.
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jun 17, 2004, 03:04 AM
 
There's a file called .hidden at the root of your drive. It lists all the non-dotfiles at the root of the drive that get hidden by default. If you modify that file and then log out and back in, you can alter which files are invisible.

You don't need to do the copy/paste thing with NetInfo Manager, since it automatically prompts you for a new root password when you enable the root account. However, you really shouldn't log in as root.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 17, 2004, 06:26 AM
 
Originally posted by VenomSnake:
Millenium, can you access folders such as /var/root using sudo? Because there are certain folder that only root can access in some unix variants.
The point is that sudo is a safer way of quickly becoming root to execute a single command, then dropping back down to a (relativey) unprivileged user. That way you don't have root shells sitting around that you could accidentally hose things with.

When you run sudo, you are root:
Code:
gonzales:~ finlayd$ id uid=501(finlayd) gid=501(finlayd) groups=501(finlayd), 79(appserverusr), 80(admin), 81(appserveradm) gonzales:~ finlayd$ sudo id Password: uid=0(root) gid=0(wheel) groups=0(wheel), 1(daemon), 2(kmem), 3(sys), 4(tty), 5(operator), 20(staff), 31(guest), 80(admin)
So obviously you can access stuff such as /var/root, because you are effectively root (euid 0).

Also, please don't log in to the GUI as root. That is generally a bad idea.
     
Busemann
Mac Elite
Join Date: Feb 2003
Status: Offline
Reply With Quote
Jun 17, 2004, 07:01 AM
 
Originally posted by VenomSnake:
Haha yea thanks. Terminal was the first thing I found in OS X
I just like using GUIs because it's so much easier, but not seeing half the stuff I know is really there kinda makes me angry.

if there are certain root level files you want to see, you could just edit the .hidden file in /
     
mitchell_pgh
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Jun 17, 2004, 07:53 AM
 
Originally posted by VenomSnake:
Haha yea thanks. Terminal was the first thing I found in OS X
I just like using GUIs because it's so much easier, but not seeing half the stuff I know is really there kinda makes me angry.
As someone that is forced to answer such questions as "why isn't this program launching" I'm glad most users can't find many files. It's a pro feature that should be left to the pros.

I've heard "I deleted some files" before to the horror of our IT people who have to go back and reinstall software...
     
Gavin
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Jun 17, 2004, 08:18 AM
 
I've found there is no reason at all to activate the root user on OS X. Seems weird coming from a UNIX background but it's true.

Just use sudo in the terminal.
You can edit root owned files in bbedit. It will simply authenticate you when you save the file.

You can get to pretty much everything from the finder. You just have to tell it to show you the folder manually.

In the Go menu choose 'go to folder'

type in /var for example

it will now show up in the finder under the boot drive. You can check out your log files, etc.

As a UNIX guy you may notice /etc /tmp and /var are really in the /Private folder with aliases (symlinks) under /

A lot of the stuff you might expect to find in /etc is actually stored in NetInfo which is a database system like Active Directory or LDAP. There's a hosts file for example but it's only used when booting in single user mode. So don't be surprised if tweaking a config file or two doesn't do anything. NetInfo Manager is the key to tweaking stuff you can't get at from the control panels.

Have fun!
     
mitchell_pgh
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Jun 17, 2004, 10:59 AM
 
There are reasons, but most of them stem around installing unix software (where sudo doesn't seem to play well)
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jun 17, 2004, 12:45 PM
 
Originally posted by mitchell_pgh:
There are reasons, but most of them stem around installing unix software (where sudo doesn't seem to play well)


You mean:

.configure

make

sudo make install

doesn't work for you in some cases? Why? When you use sudo, you are root.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
CatOne
Mac Elite
Join Date: Nov 2001
Status: Offline
Reply With Quote
Jun 17, 2004, 01:12 PM
 
Originally posted by mitchell_pgh:
There are reasons, but most of them stem around installing unix software (where sudo doesn't seem to play well)
If you want an actual root shell, you can always do 'sudo -s' to get a root shell anyway. No need whatsoever to enable it from NetInfo manager.
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 18, 2004, 02:54 AM
 
Originally posted by mitchell_pgh:
There are reasons, but most of them stem around installing unix software (where sudo doesn't seem to play well)
Bzzt. Wrong. By saying this you just indicated that you are not qualified to use the root account.
     
Mr Scruff
Mac Enthusiast
Join Date: Feb 2001
Location: London, UK
Status: Offline
Reply With Quote
Jun 18, 2004, 03:32 AM
 
Originally posted by CatOne:
If you want an actual root shell, you can always do 'sudo -s' to get a root shell anyway. No need whatsoever to enable it from NetInfo manager.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:04 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,