Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Send a DOS command to another host

  1. #1

    Default Send a DOS command to another host

    Hi there!
    I need to send a DOS command, like 'shutdown ...', to another host in the LAN.
    From a host runnig DOS (Windows), I'd use:

    Code:
    netuse \\[ip address] /user:[username] [password]
    shutdown -r -f -t 0 -m [ip address]
    How can I do the same thing from a host running Linux?

    I was looking the 'net' command of Samba, but I can't make it work.
    Somebody can help me?

    Thank you in advance.
    [Adrián E. Córdoba]

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,819

    Default Re: Send a DOS command to another host

    Long time ago we used commands like remsh and rlogin for these sort of things. Nowadays these are (like telnet) seen as a great security risk. It seems that these, once havily used, commands are not even installed by default on openSUSE (correct IMHO).

    We use ssh for connecting to another system in CLI.
    Henk van Velden

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,350
    Blog Entries
    15

    Default Re: Send a DOS command to another host

    Quote Originally Posted by hcvv
    Long time ago we used commands like -remsh -and -rlogin -for these sort
    of things. Nowadays these are (like -telnet-) seen as a great security
    risk. It seems that these, once havily used, commands are not even
    installed by default on openSUSE (correct IMHO).

    We use -ssh -for connecting to another system in CLI.
    Hi
    Telnet command is still there, just not the service (can be installed
    though).

    @aecordoba I would imagine you would need to activate the telnet
    service on the remote machine and use that instead. If you could
    install a shh server that would be better.

    --
    Cheers Malcolm (Linux Counter #276890)
    SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.29-0.1-default
    up 3 days 8:46, 2 users, load average: 0.76, 0.58, 0.38
    GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18


  4. #4
    Join Date
    Jun 2008
    Location
    Frisco, TX
    Posts
    1,235

    Default Re: Send a DOS command to another host

    On Tue, 2009-10-06 at 19:36 +0000, aecordoba wrote:
    > Hi there!
    > I need to send a DOS command, like 'shutdown ...', to another host in
    > the LAN.
    > From a host runnig DOS (Windows), I'd use:
    >
    >
    > Code:
    > --------------------
    > netuse \\[ip address] /user:[username] [password]
    > shutdown -r -f -t 0 -m [ip address]
    > --------------------
    >
    >
    > How can I do the same thing from a host running Linux?
    >
    > I was looking the 'net' command of Samba, but I can't make it work.
    > Somebody can help me?


    Technically, you'd probably use a wmi command nowadays in
    Windows... but for what you're talking about, one way to
    do an arbitrary command on the remote host is via ssh.

    ssh root@remotehost reboot

    (for example)

    You can make that password-less using keys assuming the
    private key for the user invoking is enabled on the calling side
    and the public key is known on the remote side by the root user.

    e.g.
    ssh-keygen -b 1024 -t rsa
    # this generates a public/private set of keys
    # If you enable a passphrase, you'll need to
    # type it in to enable the use of your private
    # key (it'll feel like you're doing a password,
    # but it all takes place on the local side).

    ssh root@remote host "mkdir .ssh;chmod 700 .ssh;cat
    >>.ssh/authorized_keys2" <.ssh/id_rsa.pub

    # that was a one liner... just fyi
    # Basically you need the contents of your id_rsa.pub
    # concatenated onto the end of root's .ssh/authorized_keys2 file.

    You may have to edit /etc/ssh/sshd_config on the remote side
    to allow root to login without-password (man sshd_config look
    for PermitRootLogin without-password or forced-commands-only).
    Restart sshd after making any changes on the remote side...
    e.g. rcsshd restart

    HTH,
    Chris









  5. #5

    Default Re: Send a DOS command to another host

    I will learn about ssh, but could I send a DOS command (like shutdown) to a Windows machine by mean 'ssh'? (I can't install anything in remote host, and telnet is unavailable.)
    Thank you for your answers.
    [Adrián E. Córdoba]

  6. #6

    Default Re: Send a DOS command to another host

    Quote Originally Posted by aecordoba View Post
    I will learn about ssh, but could I send a DOS command (like shutdown) to a Windows machine by mean 'ssh'?
    No, at least as long as there is no SSH-server installed and running on the windows box (which is available but not "standard stuff" for windows).

    For the record (and I would be kicking myself, if I would not write this here).

    NEVER use telnet for remote management, especially not for remote connections from the outside.

    Telnet is completely insecure as _everything_ will be sent unencrypted.

  7. #7

    Default Re: Send a DOS command to another host

    Quote Originally Posted by Akoellh View Post
    No, at least as long as there is no SSH-server installed and running on the windows box (which is available but not "standard stuff" for windows).

    For the record (and I would be kicking myself, if I would not write this here).

    NEVER use telnet for remote management, especially not for remote connections from the outside.

    Telnet is completely insecure as _everything_ will be sent unencrypted.

    Thank you, for your time!
    [Adrián E. Córdoba]

  8. #8

    Default Re: Send a DOS command to another host

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    If you want a system to send commands to another system you're trying to
    use the wrong OS (windows) but you're in the right forum to get to the
    right OS (Linux).

    Good luck.




    aecordoba wrote:
    > Akoellh;2048098 Wrote:
    >> No, at least as long as there is no SSH-server installed and running on
    >> the windows box (which is available but not "standard stuff" for
    >> windows).
    >>
    >> For the record (and I would be kicking myself, if I would not write
    >> this here).
    >>
    >> NEVER use telnet for remote management, especially not for remote
    >> connections from the outside.
    >>
    >> Telnet is completely insecure as _everything_ will be sent unencrypted.

    >
    >
    > Thank you, for your time!
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQIcBAEBAgAGBQJKy/h2AAoJEF+XTK08PnB5rDsP/RT9LpasP/2W+ndIxP3kE6oC
    6K5NPr+sX3c6l2T9llbLptH7QjJ1DIcWntJh5gPaI6O/HTMAqWnQm8Z8ePVGTLgt
    Tpnyc8tTaSTeRS2EH3Ik9cBVrTf8Nzsi/mUS9zxentL3Az+Q1FHfcOO+jQ83y30a
    uqV+VQrp/retPLqrT29i57TqNJ1ipw/lXU76XyT5mqe4WwnSx5Q6SNcvAjqONbNr
    drSIQivKX0ccW9tdb4DIfrT9RNCoBuDatEKr2YVCXQFuLWPyBXpIvbKOLs5l4exB
    qrY1uO1HDEs+zZyQUOgVinKs2qU+QjHDl72YX2wB2bVbZRB8CkP/5DJD73v6MwLU
    OSmVHTJhmX7PS94vH4C9VpE0hurYJDZ3CDaiGNbgB1ou+EgmvQxUILLbGTPpE8Ac
    8kVLghHvqDek0VpHDBNiuYaZl179ymsYYCr1GKqZE/HruinA+2o24Id5qSyxZ8l1
    3Fi4H/1llTfME/EtXty29a4JusigmOu6wnRmFg2pk1mcOYd0himR4oxj1FiC1cnE
    h//o5P9Ixolo4XjCbBdw/RbOHpbcIqIZWnBfjj7iZUqvbEPdWjBf6kLpHg4DywV3
    O2DbRiEmkmH4s44mVTZkxIXoC3tdfI9Zb5OnWlXHw28lj/5mYjKbB5nuSW0jBEuA
    mm7RswQLrQQkA8Ov2+ag
    =lc3g
    -----END PGP SIGNATURE-----

  9. #9

    Default Re: Send a DOS command to another host


  10. #10
    Join Date
    Jun 2008
    Location
    Frisco, TX
    Posts
    1,235

    Default Re: Send a DOS command to another host

    aecordoba wrote:
    > I will learn about ssh, but could I send a DOS command (like shutdown)
    > to a Windows machine by mean 'ssh'? (I can't install anything in remote
    > host, and telnet is unavailable.)
    > Thank you for your answers.
    >
    >


    You can do this using WMI (as mentioned earlier). You'll need a domain
    admin credential (or something that can do the operation you're wanting
    to do). You can get the eval version of Zenoss and just keep
    the wmic (and there's one other command too... slips my mind right now)
    and delete the rest (unless you want to mess around with Zenoss).

    Then you can do wmi Win32 calls to your windows boxes... including
    things like shutdown/restart, etc (if you use an account with privs).

    WMI is the big backdoor on Windows.

    You can view files, etc... even if nothing is being shared out.


Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •