cool new unix thing i found!!

solrac

Mac Ninja
PID 1 is init (the boot process)

init 0 should stop it, but you get an error "already running"

so I tried the command:

kill 1

It halted the GUI, and kicked me out to some UNIX shell!! I never saw this trick posted anywhere yet!! It is really cool. It's like I was in the true BSD shell. I could even use the command ls and it listed my shit.

Anyone can tell me what exactly this all is? Or its significance?? Thanks
 
You just dropped back into single-user mode. Should be almost identical to holding Cmd-S when booting up; the only differences being potential processes still running and the filesystems may be mounted read/write.
 
so what is single user mode anyway?
Is it run as the user I was logged in as?
Or is it some root level?

Is there any significance to it?

-Carlos-
 
The question you should be asking yourself right now is: Will this hurt my computer (OS)? Do I know enough about UNIX to experiment on my computer to retreive what ever I can potentially lose? I cannot say that I know much about UNIX and elect not to try anything "NEW" without hearing first from a UNIX head how safe a particular command/action is.
 
Dude don't worry about me.
First of all, I back up all my data. I could incinerate my computer right now and not lose any data.

Second, I know enough about UNIX to know that kill 1 is simply killing a process and not deleting any files or changing the system.

So please do not be "captain-save-a-unix-n00b"

I do thank you for your concern, but I'm just looking for info not warnings (unless they apply to the UNIX commands)

Thank you,
-Carlos-
 
This is weird; you should not have been able to kill init, unless you did that as root. Are you/were you running as root at that time? if not, this is very much a locally exploitable security hole (standalone mode gives root privileges to person at the console).
 
yeah I always run as root. I've been running as root since the first day I learned how to unlock root during the public beta days of OS X.

For a year, all UNIX geeks AND Apple-bitches have been telling me not to run as root but as far as I see it they can all go screw themselves because I've never had a problem.

And I just can't stand trying to move a file to another folder and getting "you do not have priveledges".

but anyway, does that mean that no matter what user you were running as, doing a kill 1 would bump you to root? (of course if you were not root you'd have to do a sudo root command anyway so I guess that makes sense)

-Carlos-
 
Once I had OS X crash, but I was able to somehow kill 1 or kill 0 or whatever. I went all the way back to a blank screen and blinking cursor like you described.

I think I typed something like /etc/rc.d or one of those and I "rebooted" except that it didn't reset my uptime clock! If you could keep that up, you could "reboot" when you needed to without resetting your uptime.

-Rob
 
The problem with running as root has to do with issuing commands that you didn't mean.

There's another thread which talks about the batchchmod -- change permissions on a lot o files. Then you can do things like set your /dev directory to 000 without getting permissions errors.

I personally couldn't care less if you run as root -- it's not my machine. :rolleyes: But I am also hoping that you're aware of the security holes by even enabling root login.

You may never have had a problem as running as root -- and you might never have one. As long as you're careful about what you do it only comes down to system security, as I mentioned already.

And finally (I promise :) ) if you don't know what single-user mode is, don't be surprised when people assume that you know little-to-nothing about *nix.

Sorry if this sounded like a lecture -- I'm not trying for it...
 
> And finally (I promise ) if you don't know what single-user mode is, don't
> be surprised when people assume that you know little-to-nothing about
> *nix.

Wait... I DO know little-to-nothing about UNIX!!! Who said otherwise? Well I know enough to know what terminal is, and ls, and cd, and cp, and some other commands like ps and ps -aux, and kill pid, and chmod 755 to run downloaded binaries, and make compiles code, and such things. But that's about it. Now I know that screen is called single user mode. But that's like the extent of my UNIX knowledge, all thanks to mac os x. Oh, and I also know the banner command!! Heheheh.

> You may never have had a problem as running as root -- and you might
> never have one. As long as you're careful about what you do it only comes
> down to system security, as I mentioned already. But I am also hoping
> that you're aware of the security holes by even enabling root login.

No I am not aware of the security holes. Please tell me, or point me to a thread that discusses this. How is it a hole even ENABLING the log in? I don't really care because it's just my laptop that I develop on and not a server or anything.

> There's another thread which talks about the batchchmod -- change
> permissions on a lot o files. Then you can do things like set your /dev
> directory to 000 without getting permissions errors.

Nah I ain't doing this crap, lol. Basically, using root got rid of all those errors and gave me back the macintosh experience I wanted. And I don't want to "learn UNIX" on this computer, setting and changing stuff. I only do simple UNIX tricks that don't do anything much. I did install MySQL, though! That was cool.

And I don't mean to sound belligerent when it comes to people warning me about logging in as root. I'm just SOOO TIRED of it. And no one ever mentioned security holes about it, only the ability to delete system files. But as I see it, in OS 9, any dumbass can drag their System Folder to the trash.

-Carlos-
 
Let me put it this way - if you're running your system as root and a hacker gets any access at all, then you are his b*tch forever!
:rolleyes:
 
ha ha true

but even if I run as a normal user, the hacker that would make me his bitch would still get in as root somehow

I just surf the web and upload stuff to FTP servers. I'm not worried about hackers.
 
So please do not be "captain-save-a-unix-n00b"
This is what made me think you were saying you knew Unix.

If root login is enabled, then someone can potentially hack into your box -- all they need is a password to be god on your machine. If root is not an option, the most they can do is what your user account can do. If root login is disabled, I really don't see how any hacker can gain those privileges. But one of the major reasons that I know of for disabling root login is security -- not trashing system files. I, of course, am no expert on security.

My personal computer's security is pretty guaranteed. How do I know this? I connect via dial-up connection. I can pretty much guarantee that no one in their right mind will try to use my computer for a DOS attack. :) And since I keep no sensitive data on my computer (all personal info, like financial stuff, is kept on offline media -- so they'd have to break into my house to get the info, and if that's the case I'm screwed anyway), I'm not too worried about people poking through my HD. Heck, even if they did find something that they wanted (probably software) it'd take them at least 24 hours to upload it somewhere else. :D And I don't leave my connection on that long...

Hmm -- can't really point you to a thread, since I'm not on any Unix fora currently. Maybe a search on google might turn up some articles.

Since I am a new Mac user (last experience was with System 6!), I'm not sure about the System Folder thing. Won't the OS prevent you from moving the system files?? I know that it won't let you do stoopid stuff like partition your boot drive, so I assumed that it would have the same protection for the System Folder.
 
Originally posted by nkuvu

This is what made me think you were saying you knew Unix.


no I was the Unix-n00b in question! (n00b means newbie which is me)

As for the System Folder in OS 9, sure you can move it to the trash. You can't empty the whole trash cuz some files are in use by the system but when you try to restart the computer then u die.
 
While I'm not a total UNIX geek, I have taken a course in UNIX simply to get me used to the Terminal in OS X, and I have done a number of things with the command line, so I'd like to say that I'm "well-versed" in UNIX to an extent.

From what I see, the only threat that enabling root user poses is that the hacker already knows your login. The user "root" is standard on all UNIXen, so any hacker who knows the first thing about UNIX would try to hack in via root, and as was mentioned, if you know the password, then you can do anything you want to the comp.

The point about not being able to do much if logged in as a regular user seems flawed to me. If you login as an administrator, it seems to me that if a hacker finds out your login and password, he can still do anything he wants even if root user login is not enabled, because of the "sudo" command in the Terminal. Likewise, you can force an app to launch with root privileges if you use a program called "Pseudo" (or is it "Psuedo"...?) if you're an administrator.

If you're a regular user and don't login as administrator, then yes, the hacker can only do what you can do. This is because only administrators have the ability to run as root, so if you're a normal user, you can probably not install software or run commands as root. There is usually always one administrator on an OS X machine for this precise reason.

So it seems to me that enabling the root user only allows the hacker to bypass the step of searching for a valid login.

If anybody can correct me, I'd love to listen.
 
Hmm. Strange. I think that without root being able to log in, su and sudo won't work. Maybe it's just su. Maybe I'm completely wrong -- but I think I couldn't do a sudo without enabling root login. Never encountered "Pseudo".

solrac: I know n00b means newbie -- basically I interpreted it as "Don't go telling me unix newbie stuff 'cuz I already know it" Not a big deal, and not worth discussing really -- I misinterpreted, no harm done, etc etc ad nauseum. :)
 
No, you can use the "sudo" command even with the root user disabled. That's the recommended way of doing things as the root user without posing a security hole.

It's the command "su" that you can't do without root user enabled. (Well, you can still use the "su" command if you change to a different user instead of the root user.) The "su" command actually stands for "switch user", I believe, so if you do the command "su someusername", you can switch to that user with the correct password.
 
Back
Top