Reboot/shutdown Without Login

Home » CentOS » Reboot/shutdown Without Login
CentOS 9 Comments

I installed CentOS 8 on a Dell server and it’s been running fine as a headless system, admin’d remotely by ssh. Now I’d like to allow someone to shut it down at the console without logging in. Is there a way to do that?
Or do I need to get the GUI working?

I tried switching it into graphical mode (“systemctl isolate graphical”)
and the console freezes with nothing but a non-blinking text cursor at top left. The usual virtual console switching hotkeys (ctrl-alt F1-F7) don’t do anything when it’s hung like this. The system is still responsive in my SSH
session. It doesn’t recover if I switch back to multi-user target so I have to reboot it to make the console useful again. I’m guessing I’m lacking a good video driver. (It’s an R720xd I inherited and the latest drivers on Dell’s site are for RHEL 7.)

9 thoughts on - Reboot/shutdown Without Login

  • How do you want the person to shut it down without logging in? Some computers have a “smart” power switch pushbutton that you can program to do a shutdown or a reboot depending on how long you hold the button down. Otherwise you’ll need at least a keyboard, or possibly something like a joystick or a mouse button?

  • Hello,

    I had this problem on a Dell T7600 running CentOS 7.6 and 8.2.

    The Dell does not have an embedded GPU so a PCIe one is used, typically Nvidia.

    The standard CentOS Nvidia driver does not work on a Dell T7***.

    You need to apply the Nvidia driver from their web site.

    Below are the detailed instructions for CentOS 7.6

    Installation of Dell T7600 CentOS 7.6 Nvidia GPU Driver

    Make sure that the Dell T7600 is attached to a network.

    Install OS if required: Boot USB CentOS 7.6 distribution
    Use arrow keys to position to ‘Install CentOS 7’
    Enter
    Use arrow keys to insert at the end of boot command line: nouveau.modeset=0
    Build CentOS 7.6 making sure that the network is enabled during the configuration phase
    Reboot making sure that the USB CentOS 7.6
    distribution is removed

    Common procedure: At CentOS boot prompt enter
    Use arrow keys to insert at end of line starting
    ‘linux16’: nouveau.modeset=0
    Enter
    Log in, start a terminal window and become superuser
    Enter: yum -y update kernel-3.10.0-1160.11.1.el7.x86_64
    Enter: cd /etc/default then edit the file grub
    Change: GRUB_DEFAULT=0
    Append to GRUB_CMDLINE_LINUX before last “:
    nouveau.modeset=0
    Enter: grub2-mkconfig -o /boot/grub2/grub.cfg
    Enter: grub2-mkconfig -o
    /boot/efi/EFI/CentOS/grub.cfg
    Enter Browser and go to:
    http://www.nvidia.com/object/unix.html
    Download Nvidia Legacy Driver 390.138 and save
    *
    Reboot making sure the 1160.11 kernel is selected
    Log in, start a terminal window and become superuser
    Enter: yum -y groupinstall “Development Tools”
    Enter: yum -y install kernel-devel epel-release
    Enter: systemctl isolate multi-user.target
    Log in and become superuser
    Change directory to where the Nvidia driver was saved *
    Enter: sh NVIDIA-Linux-x86_64-* and answer Yes/Overwrite to everything
    Reboot making sure that the 1160.11 kernel is selected
    The procedure is now complete
    To check the driver is installed correctly: Log in, start a terminal window and become superuser
    Enter: lshw – numeric -C display
    The configuration line should have: driver=nvidia
    nvidia-settings can now be used to change display settings

    Regards, Mark Woolfson

    —–Original Message—

  • Keyboard. i don’t have a mouse hooked up since it’s currently running without a GUI.

    I wasn’t sure if the power switch on the R720xd is monitored that way so that hitting the front panel button would shut the system down or maybe bring up the DRAC screen.

  • The simplest would be to have a person plug in a keyboard and do a three finger salute (CNTRL-ALT-DEL) on the system. Doing it once should trigger a shutdown and reboot. [That said. I have seen some systems ignore it and others do an immediate power cycle so please test.]

    When the hardware is booted, the DRAC screen can only be brought up on the network.

  • You can configure a shutdown action for good old Ctrl-Alt-Del. That was usually configured for reboor so you can just change it to shutdown.

    Simon

  • (off topic)

    In old times I always was disabling CNTRL-ALT-DEL, and adding to level
    “S” /usr/bin/login which effectively required password when one reboots machine into single user mode. And boot from anything but system drive was disabled in BIOS, and BIOS was password protected. Not that I
    disagree with “nothing can stop a guy with the screwdriver”. But disabling easy way to tamper with the system adds to one’s ability to notice the system had been tampered with (and when). Not doing it anymore…

    Valeri

  • That makes perfect sense in a company data room. My situation is a roommate that wants to power if off to sleep and I’ve left for an emergency and didn’t have time to power it down myself.