Turn off your Windows computer remotely from Linux

just a little while ago we have seen Auto Shutdown how to turn off your computer when you finish your downloads in Firefox. Now we will see a simple trick to Windows shut down your computer remotely from Linux.

You need to have a network installed and configured Samba , which can be done with sudo apt -get install sambaThat will install the samba package and also the samba -common , which contains several commands for managing networks between Linux and Windows.

Once you have everything installed , our system will have the command net , which consists of several parameters and we use as follows :

sudo net rpc shutdown- f -I IPaddress

After running , the remote computer will request the username and password. Needless to say that it must be a user with administrative permissions, and the remote computer must have at least one folder or a shared network service .

We could simplify things by writing sudo net rpc shutdown- f -I ipaddress - U username % password not have to wait for the Windows computer requests data from the account, but then if someone reviews the history of the terminal may obtain the data , so that the latter option is only recommended if you're the only one that uses the Linux computer . Finally, if what we want is to restart the computer instead of shutting it down, just have to add the- r .