public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* ERROR: A specified logon session does not exist. It may already have been terminated
@ 2017-10-10 14:38 Fournier, Danny G
  2017-10-10 14:48 ` Gluszczak, Glenn
  0 siblings, 1 reply; 7+ messages in thread
From: Fournier, Danny G @ 2017-10-10 14:38 UTC (permalink / raw)
  To: cygwin

We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been terminated.

We will also get the same error by simply invoking schtasks.exe without any parameters, which is supposed to list the jobs currently configured on the server.

What we have done:

-Most articles found state to change the following Local Policy to disabled (which was set already):
Network access: Do not allow storage of passwords and credentials for network authentication

-We have also added the user into the following Local Policy: Log on as a batch job and Log on as a service
-The user has permission to read and execute schtasks.exe
-We regenerated passwd and group files
-Command prompts in Windows, running as the specific user, can run schtasks.exe without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the same issue.

Dan


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

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

* RE: ERROR: A specified logon session does not exist. It may already have been terminated
  2017-10-10 14:38 ERROR: A specified logon session does not exist. It may already have been terminated Fournier, Danny G
@ 2017-10-10 14:48 ` Gluszczak, Glenn
  2017-10-10 15:03   ` Fournier, Danny G
  0 siblings, 1 reply; 7+ messages in thread
From: Gluszczak, Glenn @ 2017-10-10 14:48 UTC (permalink / raw)
  To: Fournier, Danny G, cygwin

Does schtasks.exe open a separate/new terminal session?
You could check if a command like "runas" works through ssh.

runas /noprofile /user:mymachine\administrator dir

Glenn

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


We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been terminated.

We will also get the same error by simply invoking schtasks.exe without any parameters, which is supposed to list the jobs currently configured on the server.

What we have done:

-Most articles found state to change the following Local Policy to disabled (which was set already):
Network access: Do not allow storage of passwords and credentials for network authentication

-We have also added the user into the following Local Policy: Log on as a batch job and Log on as a service -The user has permission to read and execute schtasks.exe -We regenerated passwd and group files -Command prompts in Windows, running as the specific user, can run schtasks.exe without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the same issue.

Dan


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


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

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

* RE: ERROR: A specified logon session does not exist. It may already have been terminated
  2017-10-10 14:48 ` Gluszczak, Glenn
@ 2017-10-10 15:03   ` Fournier, Danny G
  2017-10-10 15:14     ` Gluszczak, Glenn
  0 siblings, 1 reply; 7+ messages in thread
From: Fournier, Danny G @ 2017-10-10 15:03 UTC (permalink / raw)
  To: Gluszczak, Glenn, cygwin

Glenn,

I suspect that runas doesn't work through SSH. I ran it without any parameters which resulted in no output in the terminal.

However, if I run runas through the Windows Command Prompt, I clearly see output indicating that I missed required parameters.

Thanks,

Dan

-----Original Message-----
From: Gluszczak, Glenn [mailto:Glenn.Gluszczak@dell.com] 
Sent: October-10-17 11:48 AM
To: Fournier, Danny G; cygwin@cygwin.com
Subject: RE: ERROR: A specified logon session does not exist. It may already have been terminated

Does schtasks.exe open a separate/new terminal session?
You could check if a command like "runas" works through ssh.

runas /noprofile /user:mymachine\administrator dir

Glenn

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


We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been terminated.

We will also get the same error by simply invoking schtasks.exe without any parameters, which is supposed to list the jobs currently configured on the server.

What we have done:

-Most articles found state to change the following Local Policy to disabled (which was set already):
Network access: Do not allow storage of passwords and credentials for network authentication

-We have also added the user into the following Local Policy: Log on as a batch job and Log on as a service -The user has permission to read and execute schtasks.exe -We regenerated passwd and group files -Command prompts in Windows, running as the specific user, can run schtasks.exe without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the same issue.

Dan


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


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

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

* RE: ERROR: A specified logon session does not exist. It may already have been terminated
  2017-10-10 15:03   ` Fournier, Danny G
@ 2017-10-10 15:14     ` Gluszczak, Glenn
  2017-10-10 16:54       ` Fournier, Danny G
  0 siblings, 1 reply; 7+ messages in thread
From: Gluszczak, Glenn @ 2017-10-10 15:14 UTC (permalink / raw)
  To: Fournier, Danny G, cygwin

It may still work but you don't see the other terminal window unless you're on the desktop.
To prove, try this command instead.

runas /noprofile /user:orawin\administrator echo hello > a

Then look for the file "a".

I was just wondering if perhaps the issue was due to spawning a separate window.  Might be unrelated.
I've never used schtasks.

-----------------------------------------------------
Glenn,

I suspect that runas doesn't work through SSH. I ran it without any parameters which resulted in no output in the terminal.

However, if I run runas through the Windows Command Prompt, I clearly see output indicating that I missed required parameters.

Thanks,

Dan


Does schtasks.exe open a separate/new terminal session?
You could check if a command like "runas" works through ssh.

runas /noprofile /user:mymachine\administrator dir

Glenn

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


We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been terminated.

We will also get the same error by simply invoking schtasks.exe without any parameters, which is supposed to list the jobs currently configured on the server.

What we have done:

-Most articles found state to change the following Local Policy to disabled (which was set already):
Network access: Do not allow storage of passwords and credentials for network authentication

-We have also added the user into the following Local Policy: Log on as a batch job and Log on as a service -The user has permission to read and execute schtasks.exe -We regenerated passwd and group files -Command prompts in Windows, running as the specific user, can run schtasks.exe without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the same issue.

Dan


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


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


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

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

* RE: ERROR: A specified logon session does not exist. It may already have been terminated
  2017-10-10 15:14     ` Gluszczak, Glenn
@ 2017-10-10 16:54       ` Fournier, Danny G
       [not found]         ` <91DCAC3CB99C724EB365BB64677FBE7B1EFC1C9B@MX204CL04.corp.emc.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Fournier, Danny G @ 2017-10-10 16:54 UTC (permalink / raw)
  To: Gluszczak, Glenn, cygwin

Glenn,

I was able to run the command and find the file, albeit empty. Here are the commands I ran:

my_user@MY_SERVER ~
$ runas /noprofile /user:MY_SERVER\my_user echo hello > a.txt

my_user@MY_SERVER ~
$ runas /noprofile /user:MY_SERVER\administrator echo hello > b.txt

Even in the Command Prompt on the server, runas in this fashion yields an empty file. 

If I simply run echo hello > file.txt, "hello" can be seen in the file (both in the Command Prompt in Windows and via Cygwin/SSH).

Dan

-----Original Message-----
From: Gluszczak, Glenn [mailto:Glenn.Gluszczak@dell.com] 
Sent: October-10-17 12:14 PM
To: Fournier, Danny G; cygwin@cygwin.com
Subject: RE: ERROR: A specified logon session does not exist. It may already have been terminated

It may still work but you don't see the other terminal window unless you're on the desktop.
To prove, try this command instead.

runas /noprofile /user:orawin\administrator echo hello > a

Then look for the file "a".

I was just wondering if perhaps the issue was due to spawning a separate window.  Might be unrelated.
I've never used schtasks.

-----------------------------------------------------
Glenn,

I suspect that runas doesn't work through SSH. I ran it without any parameters which resulted in no output in the terminal.

However, if I run runas through the Windows Command Prompt, I clearly see output indicating that I missed required parameters.

Thanks,

Dan


Does schtasks.exe open a separate/new terminal session?
You could check if a command like "runas" works through ssh.

runas /noprofile /user:mymachine\administrator dir

Glenn

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


We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been terminated.

We will also get the same error by simply invoking schtasks.exe without any parameters, which is supposed to list the jobs currently configured on the server.

What we have done:

-Most articles found state to change the following Local Policy to disabled (which was set already):
Network access: Do not allow storage of passwords and credentials for network authentication

-We have also added the user into the following Local Policy: Log on as a batch job and Log on as a service -The user has permission to read and execute schtasks.exe -We regenerated passwd and group files -Command prompts in Windows, running as the specific user, can run schtasks.exe without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the same issue.

Dan


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


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


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

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

* RE: ERROR: A specified logon session does not exist. It may already have been terminated
       [not found]             ` <91DCAC3CB99C724EB365BB64677FBE7B1EFC501E@MX204CL04.corp.emc.com>
@ 2017-10-17 19:32               ` Fournier, Danny G
       [not found]                 ` <91DCAC3CB99C724EB365BB64677FBE7B1EFC5305@MX204CL04.corp.emc.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Fournier, Danny G @ 2017-10-17 19:32 UTC (permalink / raw)
  To: Gluszczak, Glenn, cygwin

Here's what I just did:

1. created new local administrator account
2. ran mkpasswd -l > /etc/passwd
3. removed all instances of server name in /etc/passwd (ie. MYSERVERNAME+)
4. remotely connected successfully
5. successfully ran schtasks, it listed all jobs configured 

I just retried with the other user, where I connect specifying a shared key and got the error message.

For good measure, I changed the password on the problematic user, connected directly without the key and provided the password. I then ran schtasks and it ran fine. It listed all the jobs configured.

It would seem that our issue is related to connecting over SSH using a shared key.

-----Original Message-----
From: Gluszczak, Glenn [mailto:Glenn.Gluszczak@dell.com] 
Sent: October-17-17 11:08 AM
To: Fournier, Danny G
Subject: RE: ERROR: A specified logon session does not exist. It may already have been terminated


Does ssh with Administrator and running schtasks fail as well?

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

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

* RE: ERROR: A specified logon session does not exist. It may already have been terminated
       [not found]                 ` <91DCAC3CB99C724EB365BB64677FBE7B1EFC5305@MX204CL04.corp.emc.com>
@ 2017-10-18 12:04                   ` Fournier, Danny G
  0 siblings, 0 replies; 7+ messages in thread
From: Fournier, Danny G @ 2017-10-18 12:04 UTC (permalink / raw)
  To: Gluszczak, Glenn; +Cc: cygwin

I did not add the password to the registry (not knowingly in any case). When we initially setup, we logged in by providing the password and used ssh-copy-id to setup the key.

-----Original Message-----
From: Gluszczak, Glenn [mailto:Glenn.Gluszczak@dell.com] 
Sent: October-17-17 5:11 PM
To: Fournier, Danny G
Subject: RE: ERROR: A specified logon session does not exist. It may already have been terminated

Good detective work.   I need to think about why key only authentication would cause an impact.

Did you add the password to the registry?
(Log in as the user and the run "passwd -R").

To get proper identity from a filesystem basis, a process still needs to log in.
SSH uses a behind the scene login if it finds the password.  If you log in directly, it doesn't need to access the registry one.

Glenn

-----Original Message-----
From: Fournier, Danny G [mailto:Danny.Fournier@dfo-mpo.gc.ca]
Sent: Tuesday, October 17, 2017 3:32 PM
To: Gluszczak, Glenn; cygwin@cygwin.com
Subject: RE: ERROR: A specified logon session does not exist. It may already have been terminated

Here's what I just did:

1. created new local administrator account 2. ran mkpasswd -l > /etc/passwd 3. removed all instances of server name in /etc/passwd (ie. MYSERVERNAME+) 4. remotely connected successfully 5. successfully ran schtasks, it listed all jobs configured 

I just retried with the other user, where I connect specifying a shared key and got the error message.

For good measure, I changed the password on the problematic user, connected directly without the key and provided the password. I then ran schtasks and it ran fine. It listed all the jobs configured.

It would seem that our issue is related to connecting over SSH using a shared key.

-----Original Message-----
From: Gluszczak, Glenn [mailto:Glenn.Gluszczak@dell.com]
Sent: October-17-17 11:08 AM
To: Fournier, Danny G
Subject: RE: ERROR: A specified logon session does not exist. It may already have been terminated


Does ssh with Administrator and running schtasks fail as well?

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

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

end of thread, other threads:[~2017-10-18 12:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-10 14:38 ERROR: A specified logon session does not exist. It may already have been terminated Fournier, Danny G
2017-10-10 14:48 ` Gluszczak, Glenn
2017-10-10 15:03   ` Fournier, Danny G
2017-10-10 15:14     ` Gluszczak, Glenn
2017-10-10 16:54       ` Fournier, Danny G
     [not found]         ` <91DCAC3CB99C724EB365BB64677FBE7B1EFC1C9B@MX204CL04.corp.emc.com>
     [not found]           ` <513AA0729B894545B2D793D01FFF8B6D471A0719@SVNSBIOMBX01.ENT.dfo-mpo.ca>
     [not found]             ` <91DCAC3CB99C724EB365BB64677FBE7B1EFC501E@MX204CL04.corp.emc.com>
2017-10-17 19:32               ` Fournier, Danny G
     [not found]                 ` <91DCAC3CB99C724EB365BB64677FBE7B1EFC5305@MX204CL04.corp.emc.com>
2017-10-18 12:04                   ` Fournier, Danny G

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).