Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git cannot be used under system account. #435

Closed
vharavy opened this issue Sep 24, 2015 · 12 comments
Closed

Git cannot be used under system account. #435

vharavy opened this issue Sep 24, 2015 · 12 comments
Labels

Comments

@vharavy
Copy link

vharavy commented Sep 24, 2015

When I attempt to run Git from Windows command line under Windows system account (e.g. psexec /s /i cmd and then git pull from command prompt) I get the following error:

C:\Projects\Test>git pull
Could not create directory '/home/SYSTEM/.ssh'

With MSYSGit run under system account all paths defaulted to C:\Program Files (x86)\Git (e.g. C:\Program Files (x86)\Git\.ssh\known_hosts).

@dscho dscho added the question label Sep 24, 2015
@dscho
Copy link
Member

dscho commented Sep 24, 2015

Does this account not have a proper %USERPROFILE%?

@vharavy
Copy link
Author

vharavy commented Sep 24, 2015

This is what I get:

C:\Windows\system32>echo %USERPROFILE%
C:\Windows\system32\config\systemprofile

C:\Windows\system32>echo %APPDATA%
C:\Windows\system32\config\systemprofile\AppData\Roaming

C:\Windows\system32>echo %LOCALAPPDATA%
C:\Windows\system32\config\systemprofile\AppData\Local

@kostix
Copy link

kostix commented Sep 24, 2015

On a side note, running Git under the system account is really ill-considered. @vharavy, consider creating a dedicated regular local user account for this task or at least using LOCAL SERVICE account rather than LOCAL SYSTEM.

@dscho
Copy link
Member

dscho commented Sep 24, 2015

Not that I think it is a good idea, but now I am curious to know just how you get to run Git Bash as SYSTEM?

@kostix
Copy link

kostix commented Sep 24, 2015

@dscho, psexec is a tool from the (must-have IMO) suite called Sysinternals.

When run with the -s command-line option and without the remote host to connect to, it spawns the specified command locally using the system account.

You must be an administrator, of course.

@dscho
Copy link
Member

dscho commented Sep 24, 2015

Thanks @kostix; I knew about the Sysinternals tools, of course (I use them extensively when debugging Git for Windows issues), but somehow I doubt that @vharavy used psexec.

@kostix
Copy link

kostix commented Sep 24, 2015

@dscho, surely they did -- re-read the original bug report ;-)

@dscho
Copy link
Member

dscho commented Sep 24, 2015

Whoops, you're correct. Somehow it did not register that the PSTools were used. FWIW this is what I get:

me@work $ whoami
SYSTEM
me@work $ cd
me@work $ pwd -W
C:/windows/system32/config/systemprofile
me@work $

@dscho
Copy link
Member

dscho commented Sep 24, 2015

Ah, but ssh sees the wrong home directory:

me@work $ ssh [email protected]
Could not create directory '/home/SYSTEM/.ssh'.
The authenticity of host 'bitbucket.org (131.103.20.168)' can't be established.
RSA key fingerprint is SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A.
Are you sure you want to continue connecting (yes/no)?

@vharavy
Copy link
Author

vharavy commented Sep 24, 2015

Originally the problem was encountered when I tried to upgrade Git on Windows machine running Jenkins Slave installed as a service under local system account.

@dscho
Copy link
Member

dscho commented Sep 24, 2015

Ah, now that makes sense! Thanks for that information!

FWIW I am in the middle of debugging why the home directory is wrong (as far as ssh is concerned, as I demonstrated $HOME is fine).

@dscho
Copy link
Member

dscho commented Sep 24, 2015

BTW please feel generous about providing such background information in future bug reports. It really helps assess the priorities.

dscho added a commit to dscho/msys2-runtime that referenced this issue Nov 25, 2015
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Dec 17, 2015
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Jan 7, 2016
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Jan 15, 2016
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Mar 14, 2016
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Mar 20, 2016
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Apr 5, 2016
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Apr 5, 2016
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Sep 9, 2016
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Jan 5, 2017
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Jan 6, 2017
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Feb 14, 2017
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Mar 21, 2017
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Apr 2, 2017
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/msys2-runtime that referenced this issue Mar 5, 2019
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/msys2-runtime that referenced this issue Mar 9, 2019
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/msys2-runtime that referenced this issue Mar 16, 2019
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/msys2-runtime that referenced this issue Mar 31, 2019
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/msys2-runtime that referenced this issue Apr 6, 2019
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Apr 15, 2019
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/msys2-runtime that referenced this issue Apr 30, 2019
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Dec 17, 2019
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Apr 27, 2020
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Jun 4, 2020
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/msys2-runtime that referenced this issue Jul 9, 2020
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Aug 14, 2020
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Aug 24, 2020
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Mar 30, 2021
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Apr 8, 2021
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Nov 11, 2021
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Dec 3, 2021
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Feb 1, 2022
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue May 3, 2022
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue May 6, 2022
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue May 8, 2022
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue May 8, 2022
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue May 13, 2022
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Sep 5, 2022
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue May 12, 2023
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Jun 16, 2023
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Jun 19, 2023
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Sep 6, 2023
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/msys2-runtime that referenced this issue Nov 29, 2023
We should not blindly set the home directory of the SYSTEM account to
/home/SYSTEM, especially not when that value disagrees with what is
configured via the `db_home` line in the `/etc/nsswitch.conf` file.

This fixes git-for-windows/git#435

Signed-off-by: Johannes Schindelin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants