AW: [suse-security] secure login & shutdown with cron
![](https://seccdn.libravatar.org/avatar/f885c07e4b47167c36d7947223ce962c.jpg?s=120&d=mm&r=g)
Hello Philippe,
Is it possible to login with ssh, start a script and log out? Yes, it is. But you needn't even do this, the solution is still easier.
I got a APC with only one USV cable and no additional module for serial-connectors (smart ups 700). Powerchute cannot stop this machine from remote without a cable or a network module, can it? Afaik, yes. The UPS 700 is only a small one. We have the UPS 5000 with a built-in NIC, so we use PowerChute network shutdown. But still we have the same problem as you for our machines in the DMZ.
I want to shutdown a second machine remotely. I solved this problem by running a script on the machine connected to the UPS with this simple line: "ssh <remote-machine> shutdown -h now"
This runs before shutdown of local machine runs with a dalay. Is it possible to login as user with ssh and authentification via keyfile? Yes, of course.
What is to be set in the /etc/ssh/sshd_config? Nothing special, afaik. Good luck Uli -- Ulrich Roth IMPACT Business & Technology Consulting GmbH Im Mediapark 8 / KölnTurm D-50670 Koeln Phone +49-221-93 70 80-29 Fax +49-221-93 70 80-15 E-Mail: roth@impact.de
![](https://seccdn.libravatar.org/avatar/3930549650aca5f71fcb2f94a038bbcb.jpg?s=120&d=mm&r=g)
Thank you all for the help! I got the "linux-magazine" from my neighbour.
Afaik, yes. The UPS 700 is only a small one. We have the UPS 5000 with a built-in NIC, so we use PowerChute network shutdown. But still we have the same problem as you for our machines in the DMZ.
I only have two servers on the USV. 700VA/450 W is mainly enough (17 - 20% UPS-Load = 30 - 40 min. standby). We got a factory-park near our serverlocation and there were several long powerbreaks in the past! Someone overloaded the main power line and powered down the whole city-part two times for several hours. I hope it never happens again.
I want to shutdown a second machine remotely. I solved this problem by running a script on the machine connected to the UPS with this simple line: "ssh <remote-machine> shutdown -h now"
Good tip! I got it running now with this command, but instead I use PermitRootLogin = no I use sudo and "ssh me@remote sudo /sbin/shutdown -h now". User "me" is only allowed to shutdown from the remote machine. Firewall only allows ssh from my USV-system and my station. Now I will perform a test shutdown with the powerchute software.
What is to be set in the /etc/ssh/sshd_config? Nothing special, afaik.
You have to set PasswordAuthentification yes was to read in the german "linux-magazin" of 09/'02. Philippe
participants (2)
-
Philippe Vogel
-
Ulrich Roth