public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Can cron run ssh commands?
@ 2002-11-05 12:09 Nathan Barham
  0 siblings, 0 replies; 4+ messages in thread
From: Nathan Barham @ 2002-11-05 12:09 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

Hello all,

I'm trying to use Cygwin to rsync between an NT 4 server and a Win2K server, 
using the "-e ssh" option to rsync.  It works beautifully at the command line 
like this:

rsync -e ssh -trzv --delete /d/winapps/ Administrator@baby:/c/winapps

My problem is that this won't work from cron, nor will any of the other Openssh 
tools (scp, ssh etc).  I have Cygwin sshd running as Administrator on the remote 
W2K box, i.e.*without* privsep.  I have Cygwin cron running as SYSTEM on the 
local NT 4 box.  I've tested cron and it works except for ssh stuff.  I also 
have ssh-agent loaded on the local box (via keychain), and I can ssh to the 
remote box as Administrator without typing a passphrase.

I'm pretty sure my problem is related to permissions of the SYSTEM user and/or 
the switching of user context, but I can't figure out what to change.  I've read 
the user guide and FAQ, googled, and searched the mail archives, but if it's 
there I'm missing it.  Has anyone out there managed to automate ssh commands 
from cron?  If so can you please enlighten me, or at least kick me in the 
direction of self-enlightment?

cygcheck stuff for each machine is attached.

Thanks tons for any help.

Nathan Barham

[-- Attachment #2: cygcheck-NT.txt --]
[-- Type: text/plain, Size: 10742 bytes --]


Cygwin Win95/NT Configuration Diagnostics
Current System Time: Tue Nov 05 11:48:52 2002

Windows NT Ver 4.0 Build 1381 Service Pack 6

Path:	D:\cygwin\usr\local\bin
	D:\cygwin\bin
	D:\cygwin\usr\sbin
	c:\WINNT\system32
	c:\WINNT
	c:\NTRESKIT
	c:\NTRESKIT\Perl
	c:\Program Files\Common Files\Network Associates\VirusScan Engine\4.0.xx\
	d:\WINAPPS\Network Associates\ePO\MSSQL7\BINN
	D:\cygwin\bin

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

CYGWIN = `binmode ntsec tty'
HOME = `D:\cygwin\home\Administrator'
MAKE_MODE = `unix'
PWD = `/home/Administrator/bin'
USER = `Administrator'

COMPUTERNAME = `MERLIN'
COMSPEC = `C:\WINNT\system32\cmd.exe'
HOMEDRIVE = `D:'
HOMEPATH = `\cygwin\home\Administrator'
LOGNAME = `Administrator'
LOGONSERVER = `\\MERLIN'
MAIL = `/var/spool/mail/Administrator'
MANPATH = `:/usr/ssl/man'
NTRESKIT = `C:\NTRESKIT'
NUMBER_OF_PROCESSORS = `2'
OLDPWD = `/home/Administrator/.ssh'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
OS = `Windows_NT'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 7 Stepping 3, GenuineIntel'
PROCESSOR_LEVEL = `6'
PROCESSOR_REVISION = `0703'
PS1 = `\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ '
SHELL = `/bin/bash'
SHLVL = `1'
SSH_AGENT_PID = `467'
SSH_AUTH_SOCK = `/tmp/ssh-kYJsW293/agent.293'
SSH_CLIENT = `192.168.100.11 3167 22'
SSH_TTY = `/dev/tty2'
SYSTEMDRIVE = `C:'
SYSTEMROOT = `C:\WINNT'
TERM = `xterm'
TZ = `PST8PDT7,M4.1.0/2,M10.5.0/2'
USERDOMAIN = `BBH'
USERNAME = `Administrator'
WINDIR = `C:\WINNT'
_ = `/usr/bin/cygcheck'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000022
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `D:\cygwin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/c
  (default) = `c:'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/d
  (default) = `d:'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/e
  (default) = `e:'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `D:\cygwin/bin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `D:\cygwin/lib'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

a:  fd           N/A    N/A                    
c:  hd  NTFS    2047Mb  57% CP CS UN PA FC     Admin
d:  hd  NTFS   14496Mb  15% CP CS UN PA FC     Apps
e:  hd  NTFS    2996Mb  96% CP CS UN PA FC     Share
f:  cd           N/A    N/A                    

D:\cygwin      /          system  binmode
c:             /c         system  binmode
d:             /d         system  binmode
e:             /e         system  binmode
D:\cygwin/bin  /usr/bin   system  binmode
D:\cygwin/lib  /usr/lib   system  binmode
.              /cygdrive  user    binmode,cygdrive

Found: D:\cygwin\bin\bash.exe
Found: D:\cygwin\bin\cat.exe
Found: c:\NTRESKIT\cat.exe
Warning: D:\cygwin\bin\cat.exe hides c:\NTRESKIT\cat.exe
Not Found: cpp (good!)
Found: D:\cygwin\bin\find.exe
Not Found: gcc
Not Found: gdb
Not Found: ld
Found: D:\cygwin\bin\ls.exe
Found: c:\NTRESKIT\ls.exe
Warning: D:\cygwin\bin\ls.exe hides c:\NTRESKIT\ls.exe
Not Found: make
Found: D:\cygwin\bin\sh.exe

   58k 2002/05/07 D:\cygwin\bin\cygbz2-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz2-1.dll" v0.0 ts=2002/5/6 23:33
  625k 2002/08/09 D:\cygwin\bin\cygcrypto.dll - os=4.0 img=1.0 sys=4.0
                  "cygcrypto.dll" v0.0 ts=2002/8/9 13:20
   45k 2001/04/25 D:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                  "cygform5.dll" v0.0 ts=2001/4/24 22:28
   35k 2002/01/09 D:\cygwin\bin\cygform6.dll - os=4.0 img=1.0 sys=4.0
                  "cygform6.dll" v0.0 ts=2002/1/8 22:03
   19k 2002/02/20 D:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm.dll" v0.0 ts=2002/2/19 19:05
   17k 2001/06/28 D:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory4.dll" v0.0 ts=2001/1/6 20:34
   20k 2002/10/10 D:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory5.dll" v0.0 ts=2002/10/10 10:28
  929k 2002/06/24 D:\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygiconv-2.dll" v0.0 ts=2002/6/24 11:24
   22k 2001/12/13 D:\cygwin\bin\cygintl-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-1.dll" v0.0 ts=2001/12/13 1:28
   28k 2002/09/20 D:\cygwin\bin\cygintl-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-2.dll" v0.0 ts=2002/9/19 20:13
   26k 2001/04/25 D:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu5.dll" v0.0 ts=2001/4/24 22:27
   20k 2002/01/09 D:\cygwin\bin\cygmenu6.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu6.dll" v0.0 ts=2002/1/8 22:03
  156k 2001/04/25 D:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++5.dll" v0.0 ts=2001/4/24 22:29
  175k 2002/01/09 D:\cygwin\bin\cygncurses++6.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++6.dll" v0.0 ts=2002/1/8 22:03
  226k 2001/04/25 D:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses5.dll" v0.0 ts=2001/4/24 22:17
  202k 2002/01/09 D:\cygwin\bin\cygncurses6.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses6.dll" v0.0 ts=2002/1/8 22:03
   15k 2001/04/25 D:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel5.dll" v0.0 ts=2001/4/24 22:27
   12k 2002/01/09 D:\cygwin\bin\cygpanel6.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel6.dll" v0.0 ts=2002/1/8 22:03
   40k 2001/11/21 D:\cygwin\bin\cygpcre.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcre.dll" v0.0 ts=2001/11/21 14:15
   39k 2001/11/21 D:\cygwin\bin\cygpcreposix.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcreposix.dll" v0.0 ts=2001/11/21 14:15
   22k 2002/06/09 D:\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpopt-0.dll" v0.0 ts=2002/6/8 22:45
  108k 2001/06/28 D:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline4.dll" v0.0 ts=2001/1/6 20:34
  127k 2002/10/10 D:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline5.dll" v0.0 ts=2002/10/10 10:28
  159k 2002/08/09 D:\cygwin\bin\cygssl.dll - os=4.0 img=1.0 sys=4.0
                  "cygssl.dll" v0.0 ts=2002/8/9 13:20
   50k 2002/03/12 D:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2002/3/11 20:38
  904k 2002/10/14 D:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2002/10/13 20:15
    Cygwin DLL version info:
        DLL version: 1.3.13
        DLL epoch: 19
        DLL bad signal mask: 19005
        DLL old termios: 5
        DLL malloc env: 28
        API major: 0
        API minor: 62
        Shared data: 3
        DLL identifier: cygwin1
        Mount registry: 2
        Cygnus registry name: Cygnus Solutions
        Cygwin registry name: Cygwin
        Program options name: Program Options
        Cygwin mount registry name: mounts v2
        Cygdrive flags: cygdrive flags
        Cygdrive prefix: cygdrive prefix
        Cygdrive default prefix: 
        Build date: Sun Oct 13 23:15:34 EDT 2002
        CVS tag: cygwin-1-3-13-1
        Shared id: cygwin1S3


Cygwin Package Information
Last downloaded files to: E:\SHARE\Nathan\Cygwin
Last downloaded files from: ftp://archive.progeny.com/cygwin

Package             Version             
_update-info-dir    00076-1             
ash                 20020731-1          
base-files          1.0-1               
base-passwd         1.0-1               
bash                2.05b-5             
bzip2               1.0.2-2             
clear               1.0-1               
cron                3.0.1-7             
ctags               5.2-1               
cygrunsrv           0.95-1              
cygutils            1.1.2-1             
cygwin              1.3.13-2            
cygwin-doc          1.2-1               
diff                1.0-1               
diffutils           2.8.1-1             
emacs               21.2-8              
fileutils           4.1-1               
findutils           4.1.7-4             
gawk                3.1.1-5             
gdbm                1.8.0-4             
grep                2.5-1               
groff               1.17.2-1            
gzip                1.3.3-4             
inetutils           1.3.2-19            
irc                 20010101-1          
keychain            1.9-1               
less                374-1               
libbz2_1            1.0.2-2             
libiconv2           1.8-2               
libintl1            0.10.40-1           
libintl2            0.11.5-1            
libncurses5         5.2-1               
libncurses6         5.2-8               
libpopt0            1.6.4-4             
libreadline4        4.1-2               
libreadline5        4.3-2               
login               1.4-4               
man                 1.5g-2              
nano                1.1.10-1            
ncftp               3.1.4-1             
ncurses             5.2-8               
newlib-man          20020801            
openssh             3.4p1-5             
openssl             0.9.6g-1            
patch               2.5-3               
pcre                3.7-1               
procps              010801-2            
readline            4.3-2               
rsync               2.5.5-1             
sed                 3.02-1              
sh-utils            2.0-2               
shutdown            1.2-2               
ssmtp               2.38.7-3            
tar                 1.13.25-1           
tcp_wrappers        7.6-1               
termcap             20020930-1          
terminfo            5.2-3               
texinfo             4.2-4               
textutils           2.0.21-1            
time                1.7-1               
ttcp                19980512-1          
unzip               5.50-1              
vim                 6.1-2               
which               1.5-1               
whois               4.5.17-1            
zip                 2.3-2               
zlib                1.1.4-1             

Use -h to see help about each section

[-- Attachment #3: cygcheck-2K.txt --]
[-- Type: text/plain, Size: 10267 bytes --]


Cygwin Win95/NT Configuration Diagnostics
Current System Time: Tue Nov 05 11:52:06 2002

Windows 2000 Server Ver 5.0 Build 2195 Service Pack 3

Path:	C:\cygwin\usr\local\bin
	C:\cygwin\bin
	C:\cygwin\bin
	C:\cygwin\usr\sbin
	c:\WINNT\system32
	c:\WINNT
	c:\WINNT\System32\Wbem
	C:\cygwin\bin

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

CYGWIN = `binmode ntsec tty'
HOME = `C:\cygwin\home\Administrator'
MAKE_MODE = `unix'
PWD = `/home/Administrator'
USER = `Administrator'

ALLUSERSPROFILE = `C:\Documents and Settings\All Users'
COMMONPROGRAMFILES = `C:\Program Files\Common Files'
COMPUTERNAME = `BABY'
COMSPEC = `C:\WINNT\system32\cmd.exe'
HOMEDRIVE = `C:'
HOMEPATH = `\cygwin\home\Administrator'
LOGNAME = `Administrator'
LOGONSERVER = `\\BABY'
MAIL = `/var/spool/mail/Administrator'
MANPATH = `:/usr/ssl/man'
NUMBER_OF_PROCESSORS = `2'
OLDPWD = `/home/Administrator'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
OS = `Windows_NT'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 5 Model 4 Stepping 3, GenuineIntel'
PROCESSOR_LEVEL = `5'
PROCESSOR_REVISION = `0403'
PROGRAMFILES = `C:\Program Files'
PS1 = `\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ '
SHELL = `/bin/bash'
SHLVL = `1'
SSH_AGENT_PID = `1772'
SSH_AUTH_SOCK = `/tmp/ssh-WcElZ732/agent.732'
SSH_CLIENT = `192.168.100.27 4460 22'
SSH_TTY = `/dev/tty0'
SYSTEMDRIVE = `C:'
SYSTEMROOT = `C:\WINNT'
TEMP = `c:\WINNT\TEMP'
TERM = `xterm'
TMP = `c:\WINNT\TEMP'
TZ = `PST8PDT7,M4.1.0/2,M10.5.0/2'
USERDOMAIN = `SLEEPYGEEK'
USERNAME = `Administrator'
WINDIR = `C:\WINNT'
_ = `/usr/bin/cygcheck'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000022
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `C:\cygwin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/c
  (default) = `c:'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `C:\cygwin/bin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `C:\cygwin/lib'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

a:  fd           N/A    N/A                    
c:  hd  NTFS    9758Mb  45% CP CS UN PA FC     WIN2000
d:  cd  CDFS       0Mb -2147483548%    CS              Audio CD
e:  net          N/A    N/A                    

C:\cygwin      /          system  binmode
c:             /c         system  binmode
C:\cygwin/bin  /usr/bin   system  binmode
C:\cygwin/lib  /usr/lib   system  binmode
.              /cygdrive  user    binmode,cygdrive

Found: C:\cygwin\bin\bash.exe
Found: C:\cygwin\bin\cat.exe
Not Found: cpp (good!)
Found: C:\cygwin\bin\find.exe
Not Found: gcc
Not Found: gdb
Not Found: ld
Found: C:\cygwin\bin\ls.exe
Not Found: make
Found: C:\cygwin\bin\sh.exe

   58k 2002/05/07 C:\cygwin\bin\cygbz2-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz2-1.dll" v0.0 ts=2002/5/6 23:33
  625k 2002/08/09 C:\cygwin\bin\cygcrypto.dll - os=4.0 img=1.0 sys=4.0
                  "cygcrypto.dll" v0.0 ts=2002/8/9 13:20
   45k 2001/04/25 C:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                  "cygform5.dll" v0.0 ts=2001/4/24 22:28
   35k 2002/01/09 C:\cygwin\bin\cygform6.dll - os=4.0 img=1.0 sys=4.0
                  "cygform6.dll" v0.0 ts=2002/1/8 22:03
   19k 2002/02/20 C:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm.dll" v0.0 ts=2002/2/19 19:05
   17k 2001/06/28 C:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory4.dll" v0.0 ts=2001/1/6 20:34
   20k 2002/10/10 C:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory5.dll" v0.0 ts=2002/10/10 10:28
  929k 2002/06/24 C:\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygiconv-2.dll" v0.0 ts=2002/6/24 11:24
   22k 2001/12/13 C:\cygwin\bin\cygintl-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-1.dll" v0.0 ts=2001/12/13 1:28
   28k 2002/09/20 C:\cygwin\bin\cygintl-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-2.dll" v0.0 ts=2002/9/19 20:13
   26k 2001/04/25 C:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu5.dll" v0.0 ts=2001/4/24 22:27
   20k 2002/01/09 C:\cygwin\bin\cygmenu6.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu6.dll" v0.0 ts=2002/1/8 22:03
  156k 2001/04/25 C:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++5.dll" v0.0 ts=2001/4/24 22:29
  175k 2002/01/09 C:\cygwin\bin\cygncurses++6.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++6.dll" v0.0 ts=2002/1/8 22:03
  226k 2001/04/25 C:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses5.dll" v0.0 ts=2001/4/24 22:17
  202k 2002/01/09 C:\cygwin\bin\cygncurses6.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses6.dll" v0.0 ts=2002/1/8 22:03
   15k 2001/04/25 C:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel5.dll" v0.0 ts=2001/4/24 22:27
   12k 2002/01/09 C:\cygwin\bin\cygpanel6.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel6.dll" v0.0 ts=2002/1/8 22:03
   40k 2001/11/21 C:\cygwin\bin\cygpcre.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcre.dll" v0.0 ts=2001/11/21 14:15
   39k 2001/11/21 C:\cygwin\bin\cygpcreposix.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcreposix.dll" v0.0 ts=2001/11/21 14:15
   22k 2002/06/09 C:\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpopt-0.dll" v0.0 ts=2002/6/8 22:45
  108k 2001/06/28 C:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline4.dll" v0.0 ts=2001/1/6 20:34
  127k 2002/10/10 C:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline5.dll" v0.0 ts=2002/10/10 10:28
  159k 2002/08/09 C:\cygwin\bin\cygssl.dll - os=4.0 img=1.0 sys=4.0
                  "cygssl.dll" v0.0 ts=2002/8/9 13:20
   50k 2002/03/12 C:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2002/3/11 20:38
  904k 2002/10/14 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2002/10/13 20:15
    Cygwin DLL version info:
        DLL version: 1.3.13
        DLL epoch: 19
        DLL bad signal mask: 19005
        DLL old termios: 5
        DLL malloc env: 28
        API major: 0
        API minor: 62
        Shared data: 3
        DLL identifier: cygwin1
        Mount registry: 2
        Cygnus registry name: Cygnus Solutions
        Cygwin registry name: Cygwin
        Program options name: Program Options
        Cygwin mount registry name: mounts v2
        Cygdrive flags: cygdrive flags
        Cygdrive prefix: cygdrive prefix
        Cygdrive default prefix: 
        Build date: Sun Oct 13 23:15:34 EDT 2002
        CVS tag: cygwin-1-3-13-1
        Shared id: cygwin1S3


Cygwin Package Information
Last downloaded files to: C:\Share\Nathan\Downloads\Cygwin
Last downloaded files from: ftp://archive.progeny.com/cygwin

Package             Version             
_update-info-dir    00073-1             
ash                 20020731-1          
base-files          1.0-1               
base-passwd         1.0-1               
bash                2.05b-5             
bzip2               1.0.2-2             
clear               1.0-1               
cron                3.0.1-7             
ctags               5.2-1               
cygrunsrv           0.95-1              
cygutils            1.1.2-1             
cygwin              1.3.13-2            
cygwin-doc          1.1-2               
diff                1.0-1               
diffutils           2.8.1-1             
emacs               21.2-8              
fileutils           4.1-1               
findutils           4.1.7-4             
gawk                3.1.1-4             
gdbm                1.8.0-4             
grep                2.5-1               
groff               1.17.2-1            
gzip                1.3.3-4             
inetutils           1.3.2-19            
irc                 20010101-1          
keychain            1.9-1               
less                374-1               
libbz2_1            1.0.2-2             
libiconv2           1.8-2               
libintl1            0.10.40-1           
libintl2            0.11.5-1            
libncurses5         5.2-1               
libncurses6         5.2-8               
libpopt0            1.6.4-4             
libreadline4        4.1-2               
libreadline5        4.3-2               
login               1.4-4               
man                 1.5g-2              
nano                1.1.10-1            
ncftp               3.1.4-1             
ncurses             5.2-8               
newlib-man          20020801            
openssh             3.4p1-5             
openssl             0.9.6g-1            
pcre                3.7-1               
procps              010801-2            
readline            4.3-2               
rsync               2.5.5-1             
sed                 3.02-1              
sh-utils            2.0-2               
shutdown            1.2-2               
tar                 1.13.25-1           
tcp_wrappers        7.6-1               
termcap             20020930-1          
terminfo            5.2-3               
texinfo             4.2-4               
textutils           2.0.21-1            
time                1.7-1               
ttcp                19980512-1          
units               1.77-1              
unzip               5.50-1              
vim                 6.1-2               
which               1.5-1               
whois               4.5.17-1            
zip                 2.3-2               
zlib                1.1.4-1             

Use -h to see help about each section


[-- Attachment #4: Type: text/plain, Size: 214 bytes --]

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can cron run ssh commands?
  2002-11-05 12:43 Harig, Mark A.
@ 2002-11-06 12:07 ` Nathan Barham
  0 siblings, 0 replies; 4+ messages in thread
From: Nathan Barham @ 2002-11-06 12:07 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 5869 bytes --]

Thanks for the reply,

I don't have ssmtp set up yet, so I took your suggestion and tried redirecting
"env" and "ssh -v" output to a file.  Actually I did this both from the
Administrator's command line, and from the Administrator's crontab creating two
seperate files (attached) so I could compare.

  From the command line I ran these two commands:

/usr/bin/env > testcron.admin.txt
ssh -v baby ls 2>> testcron.admin.txt

  From Administrator's crontab I did this:

34 08 * * * /usr/bin/env > testcron.cron.txt
36 08 * * * ssh -v baby ls 2>> testcron.cron.txt

In comparing the output for the env command, I see that Administrator's
environment contains more environmet varibales, most notably those created by
ssh-agent, which is started by keychain in Administrator's ~/.bash_profile

SSH_AGENT_PID=517
SSH_AUTH_SOCK=/tmp/ssh-AhbAu553/agent.553

I also note that the $PATH variable for Administrator is prepended with Cygwin's
/usr/local/bin:/usr/bin:/usr/sbin: while it is *not* in the cron/system
environment. i.e.

For Administrator:
PATH=/usr/local/bin:/usr/bin:/usr/sbin:/c/WINNT/system32:/c/WINNT: etc...

For cron/system:
PATH=/c/WINNT/system32:/c/WINNT: etc ...

I'm assuming this is not the culprit however, since the ssh command *is* found
even though the full path to it is not provided in the crontab.  Is this because
the Administrator's $PATH is being used due to context switching?

In comparing the debug output from ssh -v, I see that when run from the command
line as Administrator, publickey auth succeeds, but fails when run from cron.  i.e.

# From command line:
#
debug1: authentications that can continue: publickey,password,keyboard-interactive
debug1: next auth method to try is publickey
debug1: userauth_pubkey_agent: testing agent key /home/Administrator/.ssh/id_rsa
debug1: input_userauth_pk_ok: pkalg ssh-rsa blen 149 lastkey 0x100cdae0 hint -1
debug1: ssh-userauth2 successful: method publickey
debug1: fd 6 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug1: send channel open 0
debug1: Entering interactive session.

# From cron:
#
debug1: authentications that can continue: publickey,password,keyboard-interactive
debug1: next auth method to try is publickey
debug1: try privkey: /home/Administrator/.ssh/identity
debug1: try pubkey: /home/Administrator/.ssh/id_rsa
debug1: input_userauth_pk_ok: pkalg ssh-rsa blen 149 lastkey 0x100c4548 hint 1
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>

It seems to me (in my newbie terminlogy) that either the cron/system environment
needs to become aware of and use the Administrator's public key via
Administrator's SSH_AGENT and SSH_AUTH_SOCK env variables, or that the SYSTEM
user needs to have it's own public key avalable for use.  I don't know how to
proceed along either of these paths.  Any help is much appreciated.



Harig, Mark A. wrote:
 > Of course, a simpler alternative to setting up
 > 'ssmtp' with cron would be to write your
 > cron job to redirect the output of 'ssh -v ...'
 > to a file.
 >
 >
 >>-----Original Message-----
 >>From: Harig, Mark A.
 >>Sent: Tuesday, November 05, 2002 3:40 PM
 >>To: nathan@sleepygeek.com; cygwin@cygwin.com
 >>Subject: RE: Can cron run ssh commands?
 >>
 >>
 >>
 >>Try adding '-v' to your ssh command in your cron job.
 >>This assumes that you have cron's integration with
 >>email working.  If you don't have the 'ssmtp' package
 >>installed (via setup.exe), then you'll want to do that
 >>so that any output is emailed to you.
 >>
 >>See: /usr/doc/Cygwin/
 >>                     cron.README
 >>                     ssmtp-<version>.README
 >>
 >>Of course, you should probably start with a simpler
 >>cron job, say, the output of '/usr/bin/env' so that
 >>you can see what cron thinks its environment is.
 >>
 >>
 >>
 >>>-----Original Message-----
 >>>From: Nathan Barham [mailto:nathan@sleepygeek.com]
 >>>Sent: Tuesday, November 05, 2002 3:09 PM
 >>>To: cygwin@cygwin.com
 >>>Subject: Can cron run ssh commands?
 >>>
 >>>
 >>>Hello all,
 >>>
 >>>I'm trying to use Cygwin to rsync between an NT 4 server and
 >>>a Win2K server,
 >>>using the "-e ssh" option to rsync.  It works beautifully at
 >>>the command line
 >>>like this:
 >>>
 >>>rsync -e ssh -trzv --delete /d/winapps/
 >>
 >>Administrator@baby:/c/winapps
 >>
 >>>My problem is that this won't work from cron, nor will any of
 >>>the other Openssh
 >>>tools (scp, ssh etc).  I have Cygwin sshd running as
 >>>Administrator on the remote
 >>>W2K box, i.e.*without* privsep.  I have Cygwin cron running
 >>>as SYSTEM on the
 >>>local NT 4 box.  I've tested cron and it works except for ssh
 >>>stuff.  I also
 >>>have ssh-agent loaded on the local box (via keychain), and I
 >>>can ssh to the
 >>>remote box as Administrator without typing a passphrase.
 >>>
 >>>I'm pretty sure my problem is related to permissions of the
 >>>SYSTEM user and/or
 >>>the switching of user context, but I can't figure out what to
 >>>change.  I've read
 >>>the user guide and FAQ, googled, and searched the mail
 >>>archives, but if it's
 >>>there I'm missing it.  Has anyone out there managed to
 >>>automate ssh commands
 >>>from cron?  If so can you please enlighten me, or at least
 >>>kick me in the
 >>>direction of self-enlightment?
 >>>
 >>>cygcheck stuff for each machine is attached.
 >>>
 >>>Thanks tons for any help.
 >>>
 >>>Nathan Barham
 >>>
 >>
 >>--
 >>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/
 >>
 >>
 >
 >
 > --
 > 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/
 >



[-- Attachment #2: testcron.admin.txt --]
[-- Type: text/plain, Size: 4181 bytes --]

COMPUTERNAME=MERLIN
COMSPEC=C:\WINNT\system32\cmd.exe
CYGWIN=binmode ntsec tty
HOME=/home/Administrator
HOMEDRIVE=D:
HOMEPATH=\cygwin\home\Administrator
LOGNAME=Administrator
LOGONSERVER=\\MERLIN
MAIL=/var/spool/mail/Administrator
MAKE_MODE=unix
MANPATH=:/usr/ssl/man
NTRESKIT=C:\NTRESKIT
NUMBER_OF_PROCESSORS=2
OLDPWD=/home/Administrator
OS2LIBPATH=C:\WINNT\system32\os2\dll;
OS=Windows_NT
PATH=/usr/local/bin:/usr/bin:/usr/sbin:/c/WINNT/system32:/c/WINNT:/c/NTRESKIT:/c/NTRESKIT/Perl:/c/Program Files/Common Files/Network Associates/VirusScan Engine/4.0.xx/:/d/WINAPPS/Network Associates/ePO/MSSQL7/BINN:/bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 7 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0703
PS1=\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ 
PWD=/home/Administrator
SHELL=/bin/bash
SHLVL=1
SSH_AGENT_PID=517
SSH_AUTH_SOCK=/tmp/ssh-AhbAu553/agent.553
SSH_CLIENT=192.168.100.11 3901 22
SSH_TTY=/dev/tty0
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINNT
TERM=xterm
TZ=PST8PDT7,M4.1.0/2,M10.5.0/2
USER=Administrator
USERDOMAIN=BBH
USERNAME=Administrator
WINDIR=C:\WINNT
_=/usr/bin/env
 
OpenSSH_3.4p1, SSH protocols 1.5/2.0, OpenSSL 0x0090607f
debug1: Reading configuration data /etc/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: ssh_connect: needpriv 0
debug1: Connecting to baby [192.168.90.10] port 22.
debug1: Connection established.
debug1: identity file /home/Administrator/.ssh/identity type -1
debug1: identity file /home/Administrator/.ssh/id_rsa type 1
debug1: identity file /home/Administrator/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.4p1
debug1: match: OpenSSH_3.4p1 pat OpenSSH*
Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.4p1
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: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: dh_gen_key: priv key bits set: 132/256
debug1: bits set: 1623/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'baby' is known and matches the RSA host key.
debug1: Found key in /home/Administrator/.ssh/known_hosts:2
debug1: bits set: 1558/3191
debug1: ssh_rsa_verify: signature correct
debug1: kex_derive_keys
debug1: newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: waiting for SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: service_accept: ssh-userauth
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: authentications that can continue: publickey,password,keyboard-interactive
debug1: next auth method to try is publickey
debug1: userauth_pubkey_agent: testing agent key /home/Administrator/.ssh/id_rsa
debug1: input_userauth_pk_ok: pkalg ssh-rsa blen 149 lastkey 0x100cdae0 hint -1
debug1: ssh-userauth2 successful: method publickey
debug1: fd 6 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug1: send channel open 0
debug1: Entering interactive session.
debug1: ssh_session2_setup: id 0
debug1: Sending command: ls
debug1: channel request 0: exec
debug1: channel 0: open confirm rwindow 0 rmax 32768
debug1: channel 0: rcvd eof
debug1: channel 0: output open -> drain
debug1: channel 0: obuf empty
debug1: channel 0: close_write
debug1: channel 0: output drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: rcvd close
debug1: channel 0: close_read
debug1: channel 0: input open -> closed
debug1: channel 0: almost dead
debug1: channel 0: gc: notify user
debug1: channel 0: gc: user detached
debug1: channel 0: send close
debug1: channel 0: is dead
debug1: channel 0: garbage collecting
debug1: channel_free: channel 0: client-session, nchannels 1
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 1.4 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 0


[-- Attachment #3: testcron.cron.txt --]
[-- Type: text/plain, Size: 3526 bytes --]

COMPUTERNAME=MERLIN
COMSPEC=C:\WINNT\system32\cmd.exe
CYGWIN=binmode tty ntsec
HOME=/home/Administrator
HOMEDRIVE=D:
HOMEPATH=\cygwin\home\Administrator
LOGNAME=Administrator
LOGONSERVER=\\MERLIN
NTRESKIT=C:\NTRESKIT
NUMBER_OF_PROCESSORS=2
OS2LIBPATH=C:\WINNT\system32\os2\dll;
OS=Windows_NT
PATH=/c/WINNT/system32:/c/WINNT:/c/NTRESKIT:/c/NTRESKIT/Perl:/c/Program Files/Common Files/Network Associates/VirusScan Engine/4.0.xx/:/d/WINAPPS/Network Associates/ePO/MSSQL7/BINN:/bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 7 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0703
SHELL=/bin/sh
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINNT
TERM=cygwin
TZ=PST8PDT7,M4.1.0/2,M10.5.0/2
USERDOMAIN=BBH
USERNAME=Administrator
WINDIR=C:\WINNT

OpenSSH_3.4p1, SSH protocols 1.5/2.0, OpenSSL 0x0090607f
debug1: Reading configuration data /etc/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: ssh_connect: needpriv 0
debug1: Connecting to baby [192.168.90.10] port 22.
debug1: Connection established.
debug1: identity file /home/Administrator/.ssh/identity type -1
debug1: identity file /home/Administrator/.ssh/id_rsa type 1
debug1: identity file /home/Administrator/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.4p1
debug1: match: OpenSSH_3.4p1 pat OpenSSH*
Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.4p1
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: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: dh_gen_key: priv key bits set: 123/256
debug1: bits set: 1595/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'baby' is known and matches the RSA host key.
debug1: Found key in /home/Administrator/.ssh/known_hosts:2
debug1: bits set: 1620/3191
debug1: ssh_rsa_verify: signature correct
debug1: kex_derive_keys
debug1: newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: waiting for SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: service_accept: ssh-userauth
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: authentications that can continue: publickey,password,keyboard-interactive
debug1: next auth method to try is publickey
debug1: try privkey: /home/Administrator/.ssh/identity
debug1: try pubkey: /home/Administrator/.ssh/id_rsa
debug1: input_userauth_pk_ok: pkalg ssh-rsa blen 149 lastkey 0x100c4548 hint 1
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: try privkey: /home/Administrator/.ssh/id_dsa
debug1: next auth method to try is keyboard-interactive
debug1: authentications that can continue: publickey,password,keyboard-interactive
debug1: next auth method to try is password
debug1: authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
debug1: authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
debug1: authentications that can continue: publickey,password,keyboard-interactive
debug1: no more auth methods to try
Permission denied (publickey,password,keyboard-interactive).
debug1: Calling cleanup 0x419440(0x0)




[-- Attachment #4: Type: text/plain, Size: 214 bytes --]

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Can cron run ssh commands?
@ 2002-11-05 12:43 Harig, Mark A.
  2002-11-06 12:07 ` Nathan Barham
  0 siblings, 1 reply; 4+ messages in thread
From: Harig, Mark A. @ 2002-11-05 12:43 UTC (permalink / raw)
  To: nathan, cygwin

Of course, a simpler alternative to setting up
'ssmtp' with cron would be to write your
cron job to redirect the output of 'ssh -v ...'
to a file.

> -----Original Message-----
> From: Harig, Mark A. 
> Sent: Tuesday, November 05, 2002 3:40 PM
> To: nathan@sleepygeek.com; cygwin@cygwin.com
> Subject: RE: Can cron run ssh commands?
> 
> 
> 
> Try adding '-v' to your ssh command in your cron job.
> This assumes that you have cron's integration with
> email working.  If you don't have the 'ssmtp' package
> installed (via setup.exe), then you'll want to do that
> so that any output is emailed to you.
> 
> See: /usr/doc/Cygwin/
>                      cron.README
>                      ssmtp-<version>.README
> 
> Of course, you should probably start with a simpler
> cron job, say, the output of '/usr/bin/env' so that
> you can see what cron thinks its environment is.
> 
> 
> > -----Original Message-----
> > From: Nathan Barham [mailto:nathan@sleepygeek.com]
> > Sent: Tuesday, November 05, 2002 3:09 PM
> > To: cygwin@cygwin.com
> > Subject: Can cron run ssh commands?
> > 
> > 
> > Hello all,
> > 
> > I'm trying to use Cygwin to rsync between an NT 4 server and 
> > a Win2K server, 
> > using the "-e ssh" option to rsync.  It works beautifully at 
> > the command line 
> > like this:
> > 
> > rsync -e ssh -trzv --delete /d/winapps/ 
> Administrator@baby:/c/winapps
> > 
> > My problem is that this won't work from cron, nor will any of 
> > the other Openssh 
> > tools (scp, ssh etc).  I have Cygwin sshd running as 
> > Administrator on the remote 
> > W2K box, i.e.*without* privsep.  I have Cygwin cron running 
> > as SYSTEM on the 
> > local NT 4 box.  I've tested cron and it works except for ssh 
> > stuff.  I also 
> > have ssh-agent loaded on the local box (via keychain), and I 
> > can ssh to the 
> > remote box as Administrator without typing a passphrase.
> > 
> > I'm pretty sure my problem is related to permissions of the 
> > SYSTEM user and/or 
> > the switching of user context, but I can't figure out what to 
> > change.  I've read 
> > the user guide and FAQ, googled, and searched the mail 
> > archives, but if it's 
> > there I'm missing it.  Has anyone out there managed to 
> > automate ssh commands 
> > from cron?  If so can you please enlighten me, or at least 
> > kick me in the 
> > direction of self-enlightment?
> > 
> > cygcheck stuff for each machine is attached.
> > 
> > Thanks tons for any help.
> > 
> > Nathan Barham
> > 
> 
> --
> 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/
> 
> 

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Can cron run ssh commands?
@ 2002-11-05 12:39 Harig, Mark A.
  0 siblings, 0 replies; 4+ messages in thread
From: Harig, Mark A. @ 2002-11-05 12:39 UTC (permalink / raw)
  To: nathan, cygwin


Try adding '-v' to your ssh command in your cron job.
This assumes that you have cron's integration with
email working.  If you don't have the 'ssmtp' package
installed (via setup.exe), then you'll want to do that
so that any output is emailed to you.

See: /usr/doc/Cygwin/
                     cron.README
                     ssmtp-<version>.README

Of course, you should probably start with a simpler
cron job, say, the output of '/usr/bin/env' so that
you can see what cron thinks its environment is.


> -----Original Message-----
> From: Nathan Barham [mailto:nathan@sleepygeek.com]
> Sent: Tuesday, November 05, 2002 3:09 PM
> To: cygwin@cygwin.com
> Subject: Can cron run ssh commands?
> 
> 
> Hello all,
> 
> I'm trying to use Cygwin to rsync between an NT 4 server and 
> a Win2K server, 
> using the "-e ssh" option to rsync.  It works beautifully at 
> the command line 
> like this:
> 
> rsync -e ssh -trzv --delete /d/winapps/ Administrator@baby:/c/winapps
> 
> My problem is that this won't work from cron, nor will any of 
> the other Openssh 
> tools (scp, ssh etc).  I have Cygwin sshd running as 
> Administrator on the remote 
> W2K box, i.e.*without* privsep.  I have Cygwin cron running 
> as SYSTEM on the 
> local NT 4 box.  I've tested cron and it works except for ssh 
> stuff.  I also 
> have ssh-agent loaded on the local box (via keychain), and I 
> can ssh to the 
> remote box as Administrator without typing a passphrase.
> 
> I'm pretty sure my problem is related to permissions of the 
> SYSTEM user and/or 
> the switching of user context, but I can't figure out what to 
> change.  I've read 
> the user guide and FAQ, googled, and searched the mail 
> archives, but if it's 
> there I'm missing it.  Has anyone out there managed to 
> automate ssh commands 
> from cron?  If so can you please enlighten me, or at least 
> kick me in the 
> direction of self-enlightment?
> 
> cygcheck stuff for each machine is attached.
> 
> Thanks tons for any help.
> 
> Nathan Barham
> 

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-06 20:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-05 12:09 Can cron run ssh commands? Nathan Barham
2002-11-05 12:39 Harig, Mark A.
2002-11-05 12:43 Harig, Mark A.
2002-11-06 12:07 ` Nathan Barham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).