Announcement

Collapse
No announcement yet.

how-to shutdown linux remotly over lan??? (partialy solved-more stuff to come)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how-to shutdown linux remotly over lan??? (partialy solved-more stuff to come)

    well the topic name says it all...

    i googled for answers but the solution are to advanced for my linux knowledge...

    like this topic here:
    http://forums.overclockers.com.au/sh...d.php?t=667061

    is there an easier way or another? any help apretiated

    #2
    Re: how-to shutdown linux remotly over lan

    If you are the administrator (root user) of the box you want to shutdown, open a ssh (secure shell) from the PC you are on, to the PC you want to manage, and issue the sudo shutdown -h now command.
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: how-to shutdown linux remotly over lan

      sudo init 0
      # make install --not-war

      Comment


        #4
        Re: how-to shutdown linux remotly over lan

        1/ Do you want to do it automatically such as discussed in your link?
        2/ Do you want to also remotely turn it back on?

        Comment


          #5
          Re: how-to shutdown linux remotly over lan

          now that i have investigated some more... no not like the topic... simple control over the linux box from a win mashine over lan... any mashine from the lan actualy...

          im trying to set up a filetransfer, music, video, etc. server over lan n the best way is a linux box

          but i actully dont know how... transfering files, music video to win boxes is easy using samba...
          but how do i tell kubu to do stuff
          download a specific file from the net, execute a prorgam, shutdown, reboot, so thats the issue!!!

          thks for the fast replys

          Comment


            #6
            Re: how-to shutdown linux remotly over lan

            ssh will allow you to run commands on another machine - it is commandline, though.

            vnc will allow you to actually access the other desktop graphically

            Comment


              #7
              Re: how-to shutdown linux remotly over lan

              Nakrull: im trying to set up a filetransfer, music, video, etc. server over lan n the best way is a linux box Grin
              I have a box like that. I don't know anything about fancy stuff like samba so I just use the good old fashioned protocols like FTP and Telnet or SSH. That is all that is required. Telnet and SSH allow you to use the server like you were actually there, and FTP basically mounts the server's hard drive on whatever file system you're on - ie the client. I use a mixture of DOS and Linux boxen, but this system should work on any OS written since 1980 ie. anything with TCP/IP.

              To be able to turn the server on and off remotely:
              The server needs to have wake-on-lan enabled in the BIOS.
              You need to use ethtool to set the NIC to be wakeable and to make that change permanent. Go to this page for a short description of the couple of lines you need to type:
              http://www.tjansson.dk/?p=83
              Next, you need to install some kind of program to send the "magic packet" (as it is called) to the server so that it can be woken up. In Linux, I installed a little utility called "wakeonlan" and then I just have to type "wakeonlan macaddress servername". To make that easier one can put the mac address in a file and call it that way. In my case I type "wakeonlan -f ccb". The -f switch says the number is in a file called ccb. Pretty simple really.

              Having done all that you should be good to go. To turn the machine off you do as directed in the other posts above.

              Now, you want to remotely control your server:
              To access the machine, you need Telnet or SSH. I use a combination because SSH is not available on all operating systems. Kubunty has a lot of choices and they're (as you know) only a click away when you use the repositories. I chose telnetd-ssh for the server because that incorporates both. The sucurity of SSH is not really needed if you are running on a lan behind a firewall, but it doesn't hurt to get used to it.

              Next, you need to be able to move files back and forth:
              FTP clients are standard on a basic intall anyway, and you can use drag and drop in Konquror or if you want to make it really easy, you can use the command line version of FTP. I choose to use a slightly better version called lftp. Your MS systems will also have the same functionality built in. Even the simple commandline FTP is standard under MS-Windows. Now, on the server side you need an FTP server. I use proftpd which is really easy to install - just remember to choose "server type: standalone" when it asks you. That way you won't have to do any configuring. If you do want to tweak things though, a quick google will give you the answer in a blink, because proftpd is used by so many individuals and ISPs. The configuration file is /etc/proftpd/proftpd.conf.

              BTW: don't worry if you are not used to FTP, the commands are really simple and intuitive. The usual rules apply regarding permissions. You can change them or sometimes you have to sudo such as when turning the machine off. You type "get filename" to get a file and "put filename" to go the other way. There is also "mput" and "mget" for doing multiple files such as "mget *.zip" for example. To see all the commands just type "?" - now does it get any easier? OK, maybe drag and drop is easier for a few people - suit yourself!

              To sum up:
              1 - Enable wakeonlan in server BIOS
              2 - Tell server to be ready for a wakeonlan "magic packet" on the next power up
              3 - Install some wakeonlan magic packet sender on the client(s)
              4 - Install SSH/Telnet server on server
              5 - Install FTP server on server
              6 - Profit!



              Comment


                #8
                Re: how-to shutdown linux remotly over lan

                thks for the fast replys

                i ussed openssh since its one click away in linux n is the most common n gui-less ssh prog i know

                setup resume
                1 downloaded openssh on both
                2 installed n used default config on both
                3 since it starts from boot i didnt edit any initd files
                4 logged on to the linux from win (worked out of the box)
                5 shutdown as a test n it worked

                dind setup the wakeonlan just jet...i still have the powerbutton to turn i back on n the pc is in my room but since i dont have a monitor for it...
                since the proftpd would only be usable by myself (mom n dad want the files too lol) so i just tried it out but cant figure how to set it up correctly... i get some errors i cant understand... will post it later if u wish

                Some questions:
                1 how do i make it more secure? so the server only acceps my lan-ips?
                2 where do i get a cool lightweight buntu with no need for a gui?
                3 how do i config the ssh so i can use the vnc? if i have a gui and use vnc then optimize it for a 100mb lan conexion?

                nakrull

                Comment


                  #9
                  Re: how-to shutdown linux remotly over lan (solved- nice how-to)

                  probably more to come
                  thaks to claydoh and spetialy Ole juul for taking the time writing that post there..
                  snowhog thks to you too since its that simple lol

                  Comment


                    #10
                    Re: how-to shutdown linux remotly over lan (solved- nice how-to)

                    Some questions:
                    1 how do i make it more secure? so the server only acceps my lan-ips?
                    2 where do i get a cool lightweight buntu with no need for a gui?
                    3 how do i config the ssh so i can use the vnc? if i have a gui and use vnc then optimize it for a 100mb lan conexion?
                    1/ I think it is already secure because you need a password to log in don't you? Also the server will not be visible outside of your lan - you do have a router with a firewall don't you? The router should not allow any calls to the local IP range unless it is using some forwarding. I am not a security expert so perhaps someone can chime in here, but I believe you should be OK.

                    2/ A cool lightweight buntu? That would be the unbutu server edition. I like it and I recommend it. When you install, it gives you options for several kinds of servers, but you can choose none if you wish. The servers don't get in the way for doing other things anyway and they work right out of the box. This is an easy way to set up apache for home (or other) use. If you want to add some kind of GUI later, it is as easy as "apt-get install kubuntu-desktop" or something else if you wish. BTW, if you do this and choose an FTP server too, remember to choose the "server type: standalone" like I mentioned before.

                    Could this last statement be related to the problem you mention with error messages? That happened to me a couple of times until I figured it out - hence my warning.

                    3/ You will have to get help from someone else regarding the VNC, I've only tried it once and didn't like it.

                    Regarding your parents using the files as well: don't forget that FTP works just fine in a GUI, but there are probably some much easier options for sharing media files. I guess it's your job to get that set up for them. I've seen some very fancy servers for radio station use, but there are probably some much simpler things right in the repositories. Again, I'll have to bow out and hope that some real expert steps up here.

                    Since this project could easily spread out considerably, perhaps it needs to be broken down a bit. Anyway, I'll help you with the stuff that I know about (which isn't much) here.

                    Cheers,
                    Ole

                    Comment


                      #11
                      Re: how-to shutdown linux remotly over lan (partialy solved)

                      yesterday at 4:20am i figured the ftp usage out... (some spelling errors on the faq page lol)

                      the proftpd server:standalone works great out of the box had no issues there... just in the client parts jajaja

                      for the lan mp3/video shares vlc player is the easiest i know lol... it supports ftp connections...

                      jea got a d-link dsl-500b router with NAT n firewall

                      i think someone should make a how-to out of this topic... i would but dont have the time... (geologie exams at the university)
                      the great thing is that im learning and will be able to setup a small server for geological stuff at the uni

                      tried vnc it its crapy slow even over lan so i wont use it (unless... )

                      i changed to Putty as ssh and ftp clients on the win boxes
                      Putty has pterm (x emulator) but i cant figure out how install it!!

                      more questions
                      1 would it be possible to remote connect to the x-server of the linux and use it on another pc?
                      2 or to emulate a x-server on a win?
                      3 still need a gui-less samba-thingy or any other gui-less-sharing-whit-win-thingy.. how and where?

                      thks ole for the fast reply and lets see if we can get someone to make it a how-to
                      cheers nakrull

                      Comment


                        #12
                        Re: how-to shutdown linux remotly over lan (partialy solved-more stuff to come)

                        yesterday at 4:20am i figured the ftp usage out...
                        W00t! Perhaps I should have given some details so you could have gotten to bed earlier. Sorry...
                        tried vnc it its crapy slow even over lan so i wont use it
                        That's what I found. I can't stand things that aren't instant. (I'm from the old analogue world where everything was real time.) lol Computers are sooooo slooooow.

                        I don't know what you mean by "remote connect to the x-server". Isn't that what VNC is supposed to do? (I could just be ignorant )

                        I'm also not sure what you mean by sharing. To me if you have permission to r-w-x a file then you essentially own it - you can do what you want with it. What exactly did you have in mind?

                        Comment


                          #13
                          Re: how-to shutdown linux remotly over lan (partialy solved-more stuff to come)

                          dont worry i dint stay up late just because of the ftp jajaja
                          i had to copy a bunch of files from pc to pc and it took soooooooooooooooooooooooooooooooooo long
                          since i had nothing to do while it finished and i wouldn't go to sleep until it did i mesed whit ftp until it worked and so i found some other useful stuff but nothing to do whit the topic no worries here

                          i think i explained myself badly

                          if i run a command like kate from ssh it gives an error

                          kate: cannot connect to x server

                          so i tought one could run a X and connct to it from a pc over lan

                          in example: (in win just read, kill me later )
                          u run a game/program from the folder in another pc over lan
                          like this
                          open the containing folder over lan, find the exe and execute it, it will copy all nessesary files to temp and run on the pc u opened it

                          i figure it cant be that different for linux (the idea not the code ) just that i dont have X on a win... hence there is the problem

                          so any ideas

                          Comment


                            #14
                            Re: how-to shutdown linux remotly over lan (partialy solved-more stuff to come)

                            found it
                            http://www.ee.columbia.edu/misc-pages/x11.html

                            any recommends

                            ahh and what do u think about this prog?

                            http://www.cygwin.com/

                            thks n cheers nakrull

                            Comment


                              #15
                              Re: how-to shutdown linux remotly over lan (partialy solved-more stuff to come)

                              woa cygwin... where do i start.... heeeeellllllppp!!!

                              Comment

                              Working...
                              X