Cannot perform ssh public key authentication from codeserver terminal.
See original GitHub issueOS/Web Information
- Web Browser:Google Chrome 90.0.4430.85(Official Build)
- Local OS: Windows10 20H2 (19042.928)
- Remote OS: Debian GNU/Linux 10 (buster)
- Remote Architecture: Linux server1 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
code-server --version
: 3.9.3 fe2dc2deb08e378069891b622bb62ad1d261d1b1
Steps to Reproduce
1.Execute ssh -T github
.
2.An error will be displayed.
sign_and_send_pubkey: signing failed: agent refused operation
git@github.com: Permission denied (publickey).
Expected
Expect to get a response like ssh or COCKPIT(WEBSHELL) as follows
Enter passphrase for key '/home/server/.ssh/id_rsa':
Hi penM000! You've successfully authenticated, but GitHub does not provide shell access.
Solution
It works properly by discarding the environment variables as follows.
server@server1:~$ ssh -T github
sign_and_send_pubkey: signing failed: agent refused operation
git@github.com: Permission denied (publickey).
server@server1:~$ sudo -E -u `whoami` ssh -T github
sign_and_send_pubkey: signing failed: agent refused operation
git@github.com: Permission denied (publickey).
server@server1:~$ sudo -u `whoami` ssh -T github
Enter passphrase for key '/home/server/.ssh/id_rsa':
Hi penM000! You've successfully authenticated, but GitHub does not provide shell access.
or
server@server1:~$ sudo su root
root@server1:/home/server# su server
server@server1:~$ ssh -T github
Enter passphrase for key '/home/server/.ssh/id_rsa':
Hi penM000! You've successfully authenticated, but GitHub does not provide shell access.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Cannot perform ssh public key authentication from codeserver ...
Open terminal; Run ssh-keygen and enter a password; Add key to github.com; ssh -T git@github.com ...
Read more >Remote Development Tips and Tricks - Visual Studio Code
Quick start: Using SSH keys. To set up SSH key based authentication for your remote host. First we'll create a key pair and...
Read more >Trying to do ssh authentication with key files: server refused ...
load the private key in the PuTTY profile; enter the public key in ~/.ssh/authorized_keys in one line ( ssh-rsa {your_public_key} with no more...
Read more >Usage - code-server v4.8.0 docs - Coder
SSH into your instance and edit the code-server config file to disable password authentication: · Restart code-server: · Forward local port 8080 to...
Read more >VS Code SSH Remote Connection issues - Stack Overflow
The key info is provided at the line. [17:09:22.713] > Acquiring lock on ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As you mentioned, I made sure that the ssh-agent command was available. I also confirmed that SSH_AUTH_SOCK exists only on codeserver, as shown below.
ssh shell
code server shell
By deleting SSH_AUTH_SOCK in codeserver’s shell, it worked fine. I wrote unset in the bashrc, and the codeserver shell was restored. Thank you very much for your advice!
Are you using ssh-agent? If the
SSH_AUTH_SOCK
environment variable exists then unsetting it might cause it to ask for the password normally. Something like:If that doesn’t help then using
ssh -vvv
might reveal more information.