delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/02/19/14:16:00

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=uYjKhE1
o2lqAt6xZjGIgQ8hK6nYd7oSmRblRls6Ox/CCY9tQ8pvXfs2oxx8iNwPsQhpoOXG
GbATU5nlHK2nZxNBYP3ysbP20+8iweKzl+ulUAUtZ6WXDJLgorMRcjjLNZa0g9a9
ZuzGTKFw5t9w0jmiY3nlKXlHeAern2fWl3+k=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; s=default; bh=GbT6ZexdcrDZ9
1gfWVOoH8PjVNE=; b=KVK4GB6BDtoSkzRYVMhvJbUD0d4Cuoic0eJhtREJMyGzq
+n989uKRnwzEJUZ2ZC090BH536zwjJhmDuIEC1y9/KxKpLBEhcLa1evUDVOaBFBg
i/Jo1oRdTSIBlAJtYtPTaXXVCDMiVHeE8cPgEiiUi7Bj0fEhsucqsDO7CZeQsU=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1479, remotely, desktop, password
X-HELO: mout.gmx.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.com; s=dbd5af2cbaf7; t=1550603731; bh=E4wW1lsNiQj+LFes5eh55KYgr45btc+DEFi9SNQJzYQ=; h=X-UI-Sender-Class:References:In-Reply-To:From:Date:Subject:To; b=d1WNVfLKS1lKm97Nztd9tKF5Ak3M0swmCUyppHz/v7WY2kZLoFwVaAux2q50oXTaJ 47E15nPBaCzIxlpq6ksTY1vF9BcGzHiXjmnfJcetsWPBn+wOmz0t405SPCteaz7WZX hku55SHGIrzKdkIdoZgrjR17NHjvPqq8eRxDtRE8=
X-UI-Sender-Class: 214d933f-fd2f-45c7-a636-f5d79ae31a79
MIME-Version: 1.0
References: <MN2PR15MB2718FCE1C1D389D6AC0AC4E0BC7C0 AT MN2PR15MB2718 DOT namprd15 DOT prod DOT outlook DOT com>
In-Reply-To: <MN2PR15MB2718FCE1C1D389D6AC0AC4E0BC7C0@MN2PR15MB2718.namprd15.prod.outlook.com>
From: Bill Stewart <bstewart AT iname DOT com>
Date: Tue, 19 Feb 2019 12:15:16 -0700
Message-ID: <CANV9t=TkREdgshZ9LZpsC8KWOBcQP2Sne8dvhpSR0oSzWdDvDg@mail.gmail.com>
Subject: Re: Can't create scheduled task over ssh as current user
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

On Tue, Feb 19, 2019 at 12:02 PM John Oxley wrote:

> I'm running a Windows 10 VM with a fairly recent installation of Cygwin (last month or so).
>
> If I ssh into the box as the user "foo", I cannot create a scheduled task for the user:
>
> foo AT host $ schtasks /create /ru foo /rp fooPassword /sc HOURLY /tn foobar /tr 'echo foo'
> ERROR: The user name or password is incorrect.
>
> If on the otherhand I log in as the user "bar" and run exactly the same command, the scheduled task is created
>
> bar AT host $ schtasks /create /ru foo /rp fooPassword /sc HOURLY /tn foobar4 /tr 'echo foo'
> SUCCESS: The scheduled task "foobar4" has successfully been created.
>
> If I log into the VM with remote desktop as the user foo, I can create the task.
>
> I have tried substituting /ru and /rp with /u and /p but get the error
> ERROR: User credentials are not allowed on the local machine.
>
> I am not sure what is going on and would love some help.

Regarding schtasks:

The /u and /p parameters mean "credentials for the user that has
permission to create a task," not "credentials for the task itself"
(credentials for the task itself are /ru and /rp). They only work for
a remote machine (/s parameter).

With that said: Why do you need to ssh to the machine to create a
task? Just create the task remotely from the machine you're on.

I'd recommend PowerShell anyway for more flexibility (New-ScheduledTask, etc.).

Bill

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

- Raw text -


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