View Full Version : Remote reboot via SSH?
bagleyb
Nov 16, 2006, 11:52 AM
I had a video project I was working on, and was going to VNC into my Mac from work so I could render the DVD while out.
I connected to it, but then VNC crapped out. It's not responding anymore, but I can still SSH to it. Everything is saved, so I'd like to reboot it remotely.
When I SSH to it, I login as my admin (only actually) account. I execute 'shutdown -r now' but it gives me a message that I'm not a super-user. I then executed 'su' and supply my password, and it replies with su: Sorry.
Is there another way to reboot it remotely, or restart the VNC service?
jhu
Nov 16, 2006, 12:13 PM
interesting. is the root account enabled? if not, that would explain why su isn't working. you should try 'sudo shutdown -r now' and see if that works. however, i've had the mac os gui not be able to load afterwards after executing this command (although i could still ssh into the machine). there's an applescript that reboots the computer correctly, but it's eluding me at the moment.
trainguy77
Nov 16, 2006, 12:19 PM
I don't have access to a X machine but will "init 6" work? I don't know if that would work as I have never tried it on X but thats how I restart my fedora box from home.
bagleyb
Nov 16, 2006, 12:26 PM
Unfortunately, I'm a Mac newbie, and I'm not quite sure where either of those files are located. I'm executing them from the bash I get when I ssh in.
The init command only returns a file not found error. The sudo command gives me a message about a lecture from a Sys Admin, and then the 3 things they should have told me. It then prompts me for a password, then gives me a command not found.
It's not that big of a deal, I'll just start it tonight before I go to bed.
trainguy77
Nov 16, 2006, 05:50 PM
Unfortunately, I'm a Mac newbie, and I'm not quite sure where either of those files are located. I'm executing them from the bash I get when I ssh in.
The init command only returns a file not found error. The sudo command gives me a message about a lecture from a Sys Admin, and then the 3 things they should have told me. It then prompts me for a password, then gives me a command not found.
It's not that big of a deal, I'll just start it tonight before I go to bed.
Yeah I guess init 6 does not work in mac OS X it was just a guess. But yeah you would type it in terminal if it did work. :D
jeremy.king
Nov 16, 2006, 05:55 PM
don't su...instead sudo
sudo shutdown -r now
jhu
Nov 16, 2006, 09:03 PM
Unfortunately, I'm a Mac newbie, and I'm not quite sure where either of those files are located. I'm executing them from the bash I get when I ssh in.
The init command only returns a file not found error. The sudo command gives me a message about a lecture from a Sys Admin, and then the 3 things they should have told me. It then prompts me for a password, then gives me a command not found.
It's not that big of a deal, I'll just start it tonight before I go to bed.
sounds like your account isn't an administrator account. is this your computer or a work computer?
vBulletin® v3.6.10, Copyright ©2000-2009, Jelsoft Enterprises Ltd.