Remote reboot via SSH?

Discussion in 'macOS' started by bagleyb, Nov 16, 2006.

  1. bagleyb macrumors member

    Joined:
    Dec 14, 2005
    #1
    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?
     
  2. jhu macrumors 6502a

    jhu

    Joined:
    Apr 4, 2004
    #2
    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.
     
  3. trainguy77 macrumors 68040

    Joined:
    Nov 13, 2003
    #3
    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.
     
  4. bagleyb thread starter macrumors member

    Joined:
    Dec 14, 2005
    #4
    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.
     
  5. trainguy77 macrumors 68040

    Joined:
    Nov 13, 2003
    #5
    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
     
  6. jeremy.king macrumors 603

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
  7. jhu macrumors 6502a

    jhu

    Joined:
    Apr 4, 2004
    #7
    sounds like your account isn't an administrator account. is this your computer or a work computer?
     

Share This Page