public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrew DeFaria <ADeFaria@Salira.com>
To: cygwin@cygwin.com
Subject: Re: Need help: cron jobs can't access network drives.
Date: Tue, 09 Sep 2003 19:43:00 -0000	[thread overview]
Message-ID: <bjlaha$rs4$1@sea.gmane.org> (raw)
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/

      parent reply	other threads:[~2003-09-09 19:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-02 14:48 Louis-Luc Le Guerrier
2003-09-03  4:16 ` David Rothenberger
2003-09-09 18:38   ` Louis-Luc Le Guerrier
2003-09-09 19:24     ` David Rothenberger
2003-09-09 19:43     ` Andrew DeFaria [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='bjlaha$rs4$1@sea.gmane.org' \
    --to=adefaria@salira.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).