[01] SSH Server Technical Support


For technical or licensing inquiries about Bitvise SSH Server, please open a new support case.

Change in environment variables: %username% = SYSTEM

OS: Windows Server 2008 Web Edition
WinSSHD version: 5.05
Client: WinSCP 4.1.7

Windows Server 2003:
Mount point for a Windows group (local) is D:\...\%username%. When I connect using test_user, %username% is "test_user", and the mount point becomes D:\...\test_user.

Windows Server 2008:
Mount point for a Windows group (local) is D:\...\%username%. When I connect using test_user, %username% is "SYSTEM", even though the process SftpServer.exe is running as "test_user". The mount point becomes D:\...\SYSTEM.

Is there a way to make WinSSHD on Windows Server 2008 work the same way as on Windows Server 2003?
Bjørn Vårdal Send private email
Thursday, May 14, 2009
 
 
Do you have any idea why Windows would set %USERNAME% to SYSTEM? What if you logon to test_user locally (through Windows Console), then open Command Prompt and execute "set username" (without quotes); what do you get?
Andrej Andolsek Send private email
Friday, May 15, 2009
 
 
set username in cmd gives me USERNAME=test_user. echo %username% gives me test_user.

Windows Server 2003 and 2008 run WinSSHD the same way; as the user SYSTEM. SftpServer.exe runs as the user that started the connection on both of the operating systems.
Bjørn Vårdal Send private email
Sunday, May 17, 2009
 
 
So, %USERNAME% has the right value if you login to Windows 2008 locally.

1) Could you check the %USERNAME% value in SSH terminal on Windows 2008? If you are using Tunnelier then login to WinSSHD on Windows 2008, click Open New Terminal Console and execute set USERNAME there.

2) Do you execute and programs with WinSSHD On-Logon command facility when logging on this test_user? If yes, could you please paste the On-Logon settings from WinSSHD file log?

I'm completely unable to reproduce this problem on Windows 2008 Enterprise server (x64 and x86)...
Andrej Andolsek Send private email
Monday, May 18, 2009
 
 
set username gives me test_user in terminal console, but the SFTP window that opens by default uses SYSTEM.

But I discovered something:
As long as the Tunnelier connection is open, SFTP works with both Tunnelier and WinSCP. The SFTP window that opens by default when using Tunnelier uses the wrong user (SYSTEM), but if I close it and click "Open New SFTP Window" it uses test_user.

There seems to be a problem with when WinSSH uses %USERNAME% during the startup of the connection. Do you have any more knowledge about this?
Bjørn Vårdal Send private email
Wednesday, May 20, 2009
 
 
OK, I have managed to reproduce exactly the same chain of events on x64 Windows 2008 acting as a domain controller.

What I did is open Control Panel - System - Advanced system settings and - Environment variables; here I've added System variable USERNAME=SYSTEM. Exactly as in your case, %USERNAME% was initially set to SYSTEM for the first SFTP session, but moments after it got magically reset to hold the actual username.

Oddly enough, on x86 Windows 2008 (also acting as domain controller) the manually set USERNAME=SYSTEM stayed that way for the whole SSH session duration.

Therefore, open Environment variables and check if there's a USERNAME System variable declared there. If yes, delete it. Also check User variables for test_user account as well (you will need to logon to that account to see its user's variables).
Andrej Andolsek Send private email
Wednesday, May 20, 2009
 
 
Thank you very much! I checked environment variables earlier, but I didn't know that it wasn't supposed to be there, even though I should have seen the connection when the value was SYSTEM.

It's working now! Thank you for your time!
Bjørn Vårdal Send private email
Thursday, May 21, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz