Comments (11)
The WSL extension runs WSL with its default user. See https://learn.microsoft.com/en-us/windows/wsl/basic-commands#change-the-default-user-for-a-distribution on how to change that user.
from vscode.
As i have exported and imported this distribution a couple of times there was not possible to do it by pwsh, but I could do it from wsl.conf. Now from embedded terminal in VS Code the user is correctly selected.
Thanks for your support!
from vscode.
Thank you @aeschli! @x-dean, glad to hear that everything is working as expected.
from vscode.
@x-dean, does VS Code show the quick input to enter your passphrase for other git operations?
from vscode.
@x-dean, does VS Code show the quick input to enter your passphrase for other git operations?
No, it does not show quick input in any git operation
from vscode.
@x-dean, that seems to indicate that authentication request never reaches VS Code. VS Code is last in the git authentication pipeline so I was wondering if you have anything configure in your git config to handle SSH authentication requests.
from vscode.
@x-dean, that seems to indicate that authentication request never reaches VS Code. VS Code is last in the git authentication pipeline so I was wondering if you have anything configure in your git config to handle SSH authentication requests.
Just retried so to give the correct answer.
$ eval `ssh-agent -s`
Agent pid 6853
$ ssh-add ~/.ssh/my.private
Enter passphrase for /home/sysadmin/.ssh/my.private:
Identity added: /home/sysadmin/.ssh/my.private (/home/sysadmin/.ssh/my.private)
pidof ssh-agent
6853
VS Code
After enabling ssh-agent I tried to push from VS Code and the issue persists and keep staying at this stage (it does commit):
Then from terminal:
git status
On branch branch
Your branch is ahead of 'branch' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
[sysadmin@laptop:~=$ git push
Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 8 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (15/15), 1.51 KiB | 258.00 KiB/s, done.
Total 15 (delta 5), reused 0 (delta 0), pack-reused 0
remote: Analyzing objects... (15/15) (100 ms)
remote: Validating commits... (1/1) done (0 ms)
remote: Storing packfile... done (85 ms)
remote: Storing index... done (79 ms)
from vscode.
@x-dean, thanks for the additional details. Based on the information that you have shared you have added your SSH key with the passphrase to the ssh agent so this should have worked seamlessly from VS Code. You are running version 1.86 so I was wondering if you could install the latest version? After you install the latest version, please go through these steps:
- Close all instances of VS Code
- From a command prompt window run set GIT_TRACE=1 && code
- Open the integrated terminal and run
git pull
. You should see detailed logs related to SSH auth - Click the "Sync Changes" button, or invoke the "Git: Pull" command.
- Open the https://code.visualstudio.com/docs/sourcecontrol/overview#_git-output-window and look at the logs.
We should try to compare the logs generated by step 3) and step 4). Please feel free to share them.
from vscode.
Version: 1.89.1 (user setup)
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:13:33.891Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.19045
I think i understood where the issue is!
After I tried git pull from integrated terminal it worked, also from VS Code git GUI.
git pull
Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.
Already up to date.
But the prompt is like this:
VS Code uses "root user" to perform tasks in wsl (at least in my case) and it was needed to perform any git ssh command towards repo to add IP at known_hosts and maybe start serving ssh-agent.
Can I change VS Code to use by default the user which invokes code from terminal ?
from vscode.
@x-dean, glad that you were able to get to the bottom of this. From the data that you have shown I see two different WSL users (sysadmin
, and root
). @aeschli, how does VS Code pick a user within WSL to use when connecting to WSL?
from vscode.
@lszomoru thanks for your support!
from vscode.
Related Issues (20)
- Window size becomes the size of the monitor when transferring maximized window across differently scaled monitors
- `Activating task providers npm` shows up twice? HOT 3
- Devtools error: contextKeyService.js:370 Element already has context attribute: title
- Devtools error: No registered selector for ID: ms-vscode.npm-command HOT 1
- Devtools error: Failed to fetch on Insiders startup HOT 2
- `writeTextAreaState(reason: selection changed)` keeps printing over and over to window log HOT 1
- Polyfill WebSerial from WebUSB HOT 2
- Unable to sign into sync settings since last night due to some AAD error
- Command center icon buttons have different padding on each side
- Window is often its minimum size after starting VS Code HOT 2
- opening inline chat near the top of a notebook editor will push cell content above scrollable viewport
- REPL editor - have an easy way to navigate from the input to the cells and vice versa
- REPL editor hint to open the accessibility help dialog
- test: comment thread widget accessible view
- REPL editor - add an accessibility help dialog
- REPL editor - play accessibility signals to indicate execution
- REPL editor - allow sending focus to the added cell when executing from another file
- De-duplicated settings sections
- Typing in a comment, switching editors and switching back will not restore the cursor position in the comment box
- Word highlighter error when opening accessibility help
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode.