How to shut down a computer having a particular IP address?
Solution 1
Just to give you an answer based on your question: "Shutting down a pc based on just the ip address is impossible"
You can make it possible by making their desktops or shells available over the network. RDP(windows) / SSH or VNC (linux) will do.
Solution 2
Use out-of-band cards (if the computers don't already have them).
They're not cheap cards, but you assign an IP address to each card and you can remotely power cycle/connect/kvm anything really.
Solution 3
Windows has the shutdown /m \\computername
command built in, but for Linux you probably would have to install ssh and use ssh root@computername /sbin/shutdown
. Why wouldn't a Linux box have SSH installed, anyway?
Solution 4
A little more context to your problem would be helpful. In general, the answer is 'no'.
Remotely shutting down any random computer is not usually a good thing to be able to do, so most are set up to protect from that happening. If sshd access is blocked, either by being disabled or firewalled, then that computer is even more protected, as it should be, and having root won't do you any good unless you're standing in front of that computer.
On the other hand, there are some compute centers that use management systems to do just what you're thinking. These are often supported either by a special daemon running on the computer, listening on a different network port than sshd, or by using low-level firmware utilities built into the network card. These scenarios require a little planning and won't help you if you've suddenly got a problem now.
Depending upon the age of the computer and the OS, there may be known attack vectors that might get you root access using cracking software. I don't recommend this route, but it exists.
One last idea - there are remotely operated power strips that could be used. If you know which computer it is and which power strip and which plug it is plugged into, you could simply turn off power to that plug. Again, this requires some preplanning, and you want to make sure someone hasn't plug their ventilator into that outlet.
Solution 5
- Type
shutdown -i
in the run window. - Click the "Add" button and type the name of the computer you want to shutdown or its IP address.
- You can select what you want the computer to do.
- In this mode, it's necessary to add a comment. Do so.
- Press OK.
Related videos on Youtube
Rohit Banga
Software Development Engineer, AWS X-Ray, AWS Elastic Beanstalk MS CS from Georgia Tech. At Georgia Tech worked on Vein-to-Vein https://github.com/C4G/V2V https://github.com/jembi/bsis Video: http://www.youtube.com/watch?v=O_zIIXepPHc Personal Website: http://iamrohitbanga.com
Updated on September 17, 2022Comments
-
Rohit Banga over 1 year
If we have a collection of Windows and Linux computers on a LAN, is it possible to shutdown a computer having a specific IP address, using the Linux shell?
Assume that I do not have ssh or telnet running on the PCs. I have the root password for all the computers.
-
polson136 over 14 yearsroot SSH access is the last thing I will tell people to do!
-
Rohit Banga over 14 yearsservice sshd has been stopped for some reason. is there no other way to shutdown the pc. i don't want to login. just have to shut it down.
-
Rohit Banga over 14 yearscracking software. i want to know more about this. it is just an experiment that i want to do in my controlled lab environment.
-
Arjan over 14 yearsWindows-only, right? (Just like @Hirvox answered?)
-
Rohit Banga over 14 yearsdoes this work on linux
-
Arjan about 14 yearsAs for the root password: see also "Shutdown without sudo user password in Ubuntu" at superuser.com/questions/92925/…
-
Arjan about 14 yearsAs for the root password: see also "Shutdown without sudo user password in Ubuntu" at superuser.com/questions/92925/…
-
mpez0 about 14 years
shutdown
works on Unix (including most linuxes), but the options are different than the Windows version. For Unix, there's alsotelinit 0
,init 0
, delays viaat
orcron
, etc. But for the original question, you need to login to the host over the network.SSH
,rsh/rlogin
,telnet
, etc. can all do it (with appropriate user permissions), but you need at least one of them available. -
MattDMo almost 11 yearsWelcome to superuser. In order for your answer to be relevant, please include a link to the program you're describing, and perhaps be slightly more definitive about how it works, what its features are, etc.