Problems with net use statement via sshd on cygwin

Igor Pechtchanski pechtcha@cs.nyu.edu
Tue Apr 8 15:37:00 GMT 2003


On 7 Apr 2003, Eric Hanchrow wrote:

> >     18:32:07 [erich@slop erich]$ ssh alpha
> >     erich@alpha's password:
> >     Last login: Mon Apr  7 13:23:14 2003 from slop.vhcorp.com
> >     Fanfare!!!
> >     You are successfully logged in to this server!!!
> >
> >     18:32:45 [erich@alpha erich]$ net use \* \\\\10.10.89.89\\d$ /u:user "password"
> >     Drive J: is now connected to \\10.10.89.89\d$.
> >
> >     The command completed successfully.
> >
> >     18:32:52 [erich@alpha erich]$
>
> >>>>> "Igor" == Igor Pechtchanski <pechtcha@cs.nyu.edu> writes:
>
>     Igor> You need to double them if you pass the "net use" command
>     Igor> through ssh.
>
> Could you explain that further?  I've never needed to double them, as
> you can see from the example.  The only time that ssh requires me to
> type anything differently is the tilde (and then only when it's
> immediately preceded by a carriage-return, which is pretty rare) -- I
> have to type it twice.
>
> Or did you mean something like this --
>
>         unix$ ssh windoze net use j: \\\\\\\\server\\\\host /u:user password

Exactly.  Any time you have another shell parse the input, you have to
escape all the backslashes again (both the escapes and the real things).
This will also require it:

sh -c "net use j: \\\\\\\\server\\\\host /u:${user} ${password}"

Of course, single quotes are the preferred way to deal with backslashes,
but they don't get you variable expansion, e.g., as above.
Hope this helps,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list