Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Sending Windows Command in SSH from Unix |
|---|---|
| Date: | Wed, 30 May 2007 15:46:05 +0800 |
Hi
My SSH Version - OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004.
I am trying to rename a file in windows by sending the rename command
from a unix machine through ssh. However, I am not able to rename the
file. If I use / in the command it gives syntax error. And if I use \
without quotes, its ignored and if I use \ with double quotes it adds
one more \ to the command.
Can anyone help me with the proper syntax to send the rename command ?
Thanks.
And following is my command and the verbose log.
$ ssh -i /mrs/home/mrsop/.ssh/zmis_rsa -v ssh@windowsbox cmd /C rename
C:/ssh/first.txt second.txt
========================================================================
==========================================
OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /usr/local/openssh/etc/ssh_config
debug1: Connecting to windowsbox [windowsboxip] port 22.
debug1: Connection established.
debug1: identity file /mrs/home/mrsop/.ssh/zmis_rsa type 1
debug1: Remote protocol version 2.0, remote software version 5.1.3.8 SSH
Tectia Server
debug1: no match: 5.1.3.8 SSH Tectia Server
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host 'windowsboxip' is known and matches the RSA host key.
debug1: Found key in /mrs/home/mrsop/.ssh/known_hosts:8
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue:
gssapi-with-mic,password,publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /mrs/home/mrsop/.ssh/zmis_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 149
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: cmd /C rename C:/ssh/first.txt second.txt
The syntax of the command is incorrect.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.5 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status
1=======================================================================
===========================================
Regards
Sankar.
This email is confidential. If you are not the addressee tell the sender
immediately and destroy this email without using, sending or storing it. Emails
are not secure and may suffer errors, viruses, delay, interception and
amendment. Standard Chartered PLC and subsidiaries ("SCGroup") do not accept
liability for damage caused by this email and may monitor email traffic.
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Syslog Problems on Red Hat Enterprise 4 (RHEL4), Garance A Drosihn |
|---|---|
| Previous by Thread: | Syslog Problems on Red Hat Enterprise 4 (RHEL4), Tony Perrie |
| Indexes: | [Date] [Thread] [Top] [All Lists] |