delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/09/09/15:44:02

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <ADeFaria AT Salira DOT com>
Subject: Re: Need help: cron jobs can't access network drives.
Date: Tue, 09 Sep 2003 12:44:43 -0700
Lines: 71
Message-ID: <bjlaha$rs4$1@sea.gmane.org>
References: <3F556B19 DOT 8020303 AT acm DOT org> <Pine DOT LNX DOT 4 DOT 44 DOT 0309091246140 DOT 27357-100000 AT vor DOT iro DOT umontreal DOT ca>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en, zh
In-Reply-To: <Pine.LNX.4.44.0309091246140.27357-100000@vor.iro.umontreal.ca>

Louis-Luc Le Guerrier wrote:

> The target (sharing) machine has Windows XP, and I have not yet found 
> how to change the share permission to "everyone". I remember that in 
> previous Windows versions, but Microsoft seems to have moved options 
> all around, and just this straight forward task seems complicated now.

Let's say you are sharing C:\Cygwin\tmp on the XP box. Open up an 
Explorer and go to C:\Cygwin. Right click on tmp and select Properties. 
Select the Sharing tab then click on the Permissions button. You should 
see Everyone there with Full Control set to allow. If not then change it.

> I have been able to log in on the target machine as Administrator, 
> with the same password, and made the share again. 

Once you login with a password the password is available to authenticate 
your access to the share.

> On the server (source machine) I also tried to create a SYSTEM account 
> since none is in the user account list, 

Which user account list?

> but it refuses to create it saying one already exists. In any of these 
> cases, nothing works, and I'm still unable to access the network drive 
> with 'cron'.
>
> On UNIX (cygwin) side, how can I tell 'cron' to execute with a 
> different user than "Administrator"? 

Cron runs as the user SYSTEM. crontabs (created by crontab) are made on 
a per user basis. When cron (the service running as SYSTEM)  needs to 
execute a cronjob of a user it will switch user to that user. So user 
joe can create a crontab and when cron runs it it will switch user to 
joe. User Administrator can also create a crontab and when cron runs it 
ti will switch user to Administrator.

This switch user is a "passwordless" login. As such no password is 
available to authenticate the user to network shares (like network drive 
mapping). Thus such attempted access fails.

However, you should be able to access things via a UNC path if that 
share has everyone set to full control. So try

0 * * * ls //<server>/<share> > /tmp/debug.log

You may want to change the 0 and the * to a more appropriate and 
immediate time. Also change <server> and <share> their appropriate 
names. Then check /tmp/debug.log. What did it list?

> Maybe this will work. How do I provide the password, then?

You don't. See above.

> Our server has become a "Domain Server", so it might be the problem. 
> I'm not that familiar with domain accounts.

Have your /etc/passwd and /etc/group files been generated with mkpasswd 
-d for domains? Or are you using local accounts? If you are, say, using 
the local Administrator account and trying to access a share on the 
domain then beware that local Administrator != the domain's 
Administrator account. Why don't you stick to your domain username for now.

> How can I determine what user 'cron' runs under? If I schedule an 'id' 
> command through cron, 'id' shows user is Administrator, but does it 
> mean it is the user? 

Not sure what "schedule and 'id' command" means. Do you mean that (being 
logged in as Administrator) you did a crontab -e and added a line to 
execut the id command?



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019