The net command via remote ssh

JJ Streicher-Bremer jj@digisle.net
Sun Jan 31 23:52:00 GMT 1999


I have successfully implemented sshd on our NT systems (thanks Sergey). 
The 20.1 version is fast and stable.  One of the last things I am
running into is using the native NT command net.exe via the command
line.  In order to connect to a remote system as a different user
(something we do quite often), the command line looks like:
[jj@xena jj]$ net use '*' \\\\server\\sharename /user:DOMAIN\\USER

This command should prompt for the users password.  Unfortunately under
the remote shell it seems to pass carriage returns immediately to the
command and so it fails.  This kind of issue also holds true for
changing a users password via the net command:

[jj@xena jj]$ net USER *
should prompt for the new password for user USER.  Unfortunately it
seems to be passed carriage returns instead.  

I know that I can just put the password on the command line it's self:
[jj@xena jj]$ net use '*' \\\\server\\sharename /user:DOMAIN\\USER
PASSWORD

This works, unfortunately the password is now stored in the
.bash_history.  I can delete this file every time I logout, or make hy
HISTSIZE very small, but that defeats the purpose of having command line
history.  

I have tried setting CYGWIN to notty with no change in status.

I am wondering if anyone else has run into and/or solved this issue.  If
so could you shed some light on the subject? 

I have appended a cygcheck -s to my e-mail.

Thanks in advance

-- 
JJ Streicher-Bremer
NT Systems Administrator
Digital Island Inc.
415-228-4189

------------------------------------------------------------------------------

[jj@xena jj]$ cygcheck -s

Cygnus Win95/NT Configuration Diagnostics
Current System Time: Mon Jan 18 09:05:12 1999

WinNT Ver 4.0 build 1381 Service Pack 4

Path:   .
        /usr/bin
        /usr/local/bin
        .
        //d/apps/perl/bin
        //d/apps/4nt
        //d/apps/ntreskit
        //d/apps/ntsec
        //c/winnt/system32
        //c/winnt

SysDir: C:\WINNT\System32
WinDir: C:\WINNT

CYGWIN32 = `tty'
CYGWIN = `notty binmode title strip_title glob'
HOME = `/home/jj'
PWD = `/home/jj'
USER = `jj'

Use `-r' to scan registry

a:\ fd           N/A    N/A                    
c:\ hd  FAT     1019Mb  71% CP    UN           
d:\ hd  NTFS    3726Mb  56% CP CS UN PA FC     
e:\ net NTFS    6149Mb  86% CP CS UN PA FC     
h:\ net NTFS   15351Mb  62% CP CS UN PA FC     
u:\ net NTFS   15351Mb  62% CP CS UN PA FC     
z:\ cd  CDFS      26Mb 100%    CS              PALMPILOT

D:\apps\Unix  /         native  text=binary
\\.\a:        /dev/fd0  native  text!=binary
\\.\b:        /dev/fd1  native  text!=binary
\\.\tape0:    /dev/st0  native  text!=binary
\\.\tape1:    /dev/st1  native  text!=binary
D:\users      /home     native  text=binary

Found: D:\apps\Unix\usr\bin\bash.exe
Found: D:\apps\Unix\usr\bin\cat.exe
Not Found: cpp (good!)
Found: D:\apps\Unix\usr\bin\find.exe
Not Found: gcc
Not Found: gdb
Not Found: ld
Found: D:\apps\Unix\usr\bin\ls.exe
Not Found: make
Found: D:\apps\Unix\usr\bin\sh.exe

  446k 1998/12/15 D:\apps\Unix\usr\bin\cygwin1.dll
  446k 1998/12/15 D:\apps\Unix\usr\bin\cygwinb19.dll
Use -h to see help about each section
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list