Beginner: Python, git, bash, etc ✅

Your terminology in incorrect.

  • The 4MB you called your repo, is not your repo, its your workspace, which is a copy of the single commit you currently have checked out.
  • Your .git folder IS YOUR REPO! …in all its historical glory.

Consider a repository on a server like github, created with the following steps, pushed to the server after each step…

  1. Starting with a new empty repo
  2. Commit 1 adds a 10kB text file.
  3. Commit 2 adds a 20MB image.
  4. Commit 3 deletes that image and adds a 20kB text file.

Since on github you can browse the repo’s history, to see the deleted image in an old commit,
it should make sense that the repo on the server is 20.2MB in size, even though your latest commit deleted the image?

git clone does two thing. First it copies that entire 20.2MB remote repo into the .git folder that is you local repo. Second, it checks-out the latest commit of the default branch from the .git folder into your workspace - the live files and files you interact with.

git add followed by git commit copies files from your workspace into your .git folder (local repo).

git push copies all differences from your .git folder (your local repo) to the remote repo.

Here is a diagram to help you conceptualise…

I really recommend reading Git Internals. The way it explains how crypto-block-chain is applied to distributed source code control gives insights into a non-git stuff like bitcoin. And it provides useful background to understand: how to search for large file in git history

4 Likes

Thank you so much! Your replies are very informative and helpful!

1 Like

How to make function? or function?? to display its content in a cell output instead of a popup window in jupyter Notebook

In jupyter notebook, when you run function? like whatinside?, you get the output in a popup window like below:

In jupyterlab, you get it in a cell output as below:

How can I make Jupyter notebook to display the output of function? or function?? in a cell output instead of a popup window?

Thanks!

ssh user password forgotten, what’s the easiest option do I have?

I have been using ssh to push repo, but suddenly since yesterday, I got warning messages saying I was not using the correct access. Then following the instruction prompted in the terminal, the warning messages are gone, but I am required to type ssh user password, I only remember github user password, which does not work. So, now I can’t git push nor git clone anything in either ssh or http.

What can I do with it and what would be the simplest option?

Thanks!

1 Like

Remove your current ssh key, which is usually in your ~/.ssh folder. You can follow along this documentation and then create a brand new SSH key.

2 Likes

Thanks! I have tried it before, but still have ssh user password problem. I will do it again to see whether this time would work or not

I have gone through all the steps without problems until testing ssh connection. Either testing connection or git push/pull will prompt git@github.com’s password: , however, my correct github signin password won’t work for here.


What else can I do?

1 Like

hi @Daniel,

To get more info, try ssh -Tv git@github.com.
Here is some info to review/try:

And to clarify, SSH was working with your fastdebug repo (not different one) for a few days and then stopped working?

2 Likes

After ssh -Tv git@github.com, I have the following output

(base) 14:47 ~/Documents/fastdebug > ssh -Tv git@github.com
OpenSSH_8.6p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/Natsume/.ssh/config
debug1: /Users/Natsume/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to github.com port 22.
debug1: Connection established.
debug1: identity file /Users/Natsume/.ssh/id_ed25519 type 3
debug1: identity file /Users/Natsume/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6
debug1: compat_banner: match: OpenSSH_7.6 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug1: Authenticating to github.com:22 as 'git'
debug1: load_hostkeys: fopen /Users/Natsume/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-rsa SHA256:rEmlJenVMSL5GVemSY0Gk8WGw6B4ege4J85M+vup8R0
debug1: load_hostkeys: fopen /Users/Natsume/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Users/Natsume/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/Natsume/.ssh/id_ed25519 ED25519 SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc explicit agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/Natsume/.ssh/id_ed25519 ED25519 SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc explicit agent
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
git@github.com's password:

Well, I have tried a few things before it comes to this point (ssh password won’t work).

  1. Starting from 2 days ago, when I do git push, I got warnings saying something like being attacked, and suggest me to change or delete things in known_hosts
  2. After deleting all the items inside known_hosts, the warnings are gone, but it starts requiring ssh password which I can’t get it right
  3. Then I deleted SSH keys from github, and generated new ones and still I can’t get the password right
  4. I tried again based on @kurianbenoy suggestion above, still the same result.

I tried the solution provided by the first link you provided, but the file is read-only.

(base) 15:16 ~ > vim /etc/ssh/ssh_config

As for the second solution suggested below, I don’t know how to do the same

Fixed! The cause is dns pollution… After I modify the hosts and set a new IP for github.com, I can pass the ssh -T test.

Q.Grain

yesterday

I tried the solution provided by the first link you provided, but the file is read-only.

Use…

$ sudo vim /etc/ssh/ssh_config

As for the second solution suggested below, I don’t know how to do the same

Fixed! The cause is dns pollution… After I modify the hosts and set a new IP for github.com, I can pass the ssh -T test.

Search for: clear dns cache on YOUR_PLATFORM

I got warnings saying something like being attacked, and suggest me to change or delete things in known_hosts. After deleting all the items inside known_hosts, the warnings are gone

Sometimes the server key changes legitimately, but blindly removing the server-key from known_hosts defeats the security check. Not all services publish their server-key, but many do that you can google for. Here is github’s… “GitHub's SSH key fingerprints - GitHub Docs

I’ve copied the page here as an image in the unlikely event docs.github.com is spoofed for you.

Not to be alarmist, since its often a legitimate misconfiguration somewhere, but this possibly indicates a man-in-the-middle attack, so it may be pragmatic to change the password you’ve been typing in, maybe wherever you use it, but particularly on github.

[EDIT: It could also be that your upstream ISP has had their “DNS” servers hacked or “poisoned”.]

I’m a novice at interpretting the ssh debug output, and actually trying to learn more just now, there are suggestions more verbosity is useful using “-Tvvv”, but here goes…

debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling

I think this is okay and not relevant. From the man page… “SSH_SK_PROVIDER specifies a path to a library that will be used when loading any FIDO authenticator-hosted keys, overriding the default of using the built-in USB HID support.”

debug1: identity file /Users/Natsume/.ssh/id_ed25519 type 3
debug1: identity file /Users/Natsume/.ssh/id_ed25519-cert type -1

It found your key. Github help indicate it acceptes this type (and it was working before)

debug1: Server host key: ssh-rsa SHA256:rEmlJenVMSL5GVemSY0Gk8WGw6B4ege4J85M+vup8R0
debug1: Found key in /Users/Natsume/.ssh/known_hosts:1

This may indicate a problem/attack. The “fingerprints” link above indicates the server host key key should be:

SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8

Now compare this next bit…

debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/Natsume/.ssh/id_ed25519 ED25519 SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc explicit agent
debug1: Authentications that can continue: publickey,password,keyboard-interactive

to mine…

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/ben/.ssh/id_ecdsa ECDSA SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxx
debug1: Server accepts key: /home/ben/.ssh/id_ecdsa ECDSA SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxx
debug1: Authentication succeeded (publickey).

I’m not completely sure why I only have publickey method compared to yours.
My ssh_config file doesn’t have PasswordAuthentication no
which man ssh_config indicates it defaults to yes.

It could be because github don’t allow ssh-password authentication but you are connecting to a false MITM github server which “allows” password so you will share your password with the attacker. You can examine that by using any third-party dns lookup tool.

Like this one… Dig (DNS lookup) …which currently shows for me as 140.82.112.3. The IP address may legitimately be different to the IP address your local machine resolves github.com to, since the third-party server is in a different location around the world (indeed I resolve github.com to 20.248.137.48). The point is simply to get a second IP address to conenct directly to without DNS, and see if you now get the server-host-key specified in github docs…

$ ssh -Tv git@140.82.112.3
3 Likes

Thank you so much @bencoman for taking much time and effort to help me here!

I have changed password on github and google accounts as adviced.

Here is the output I get from terminal

(base) 20:33 ~/Documents/fastdebug > ssh -Tv git@140.82.112.3
OpenSSH_8.6p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/Natsume/.ssh/config
debug1: /Users/Natsume/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to 140.82.112.3 [140.82.112.3] port 22.
debug1: Connection established.
debug1: identity file /Users/Natsume/.ssh/id_ed25519 type 3
debug1: identity file /Users/Natsume/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.6
debug1: Remote protocol version 2.0, remote software version babeld-51712ada
debug1: compat_banner: no match: babeld-51712ada
debug1: Authenticating to 140.82.112.3:22 as 'git'
debug1: load_hostkeys: fopen /Users/Natsume/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
debug1: load_hostkeys: fopen /Users/Natsume/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: hostkeys_find_by_key_hostfile: hostkeys file /Users/Natsume/.ssh/known_hosts2 does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts2 does not exist
The authenticity of host '140.82.112.3 (140.82.112.3)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '140.82.112.3' (ED25519) to the list of known hosts.
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/Natsume/.ssh/id_ed25519 ED25519 SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc explicit agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/Natsume/.ssh/id_ed25519 ED25519 SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc explicit agent
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
git@140.82.112.3: Permission denied (publickey).
(base) 20:34 ~/Documents/fastdebug >

What should I do next? should I reinstall git?

1 Like

Here I don’t think you should be giving your github signin password. It should be probably the SSH key password.

1 Like

The problem I don’t remember the ssh password and no idea how to get it back

The server host key now seems legitimate, matching one published on “GitHub’s SSH key fingerprints - GitHub Docs

You now see “publickey” is the single authentication option, same as me, which seems more like a legitimate github server (i.e. password is not allowed). So “maybe” there is some compromised device in your upstream internet providers. You might want to consider using a VPN.

debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey

So here you can see which key its trying to authenticate with…

debug1: Offering public key: /Users/Natsume/.ssh/id_ed25519 ED25519 SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc explicit agent

but failed since you didn’t see…

debug1: Server accepts key ....................
debug1: Authentication succeeded (publickey).

So next I would look here (https://github.com/settings/keys) to just confirm you have a matching key configured. Below is a snapshot from one of my configured keys. In the red box below you should see your Key ID… SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc

image

If not, copy/paste the contents of your file /Users/Natsume/.ssh/id_ed25519.pub to github SSH keys. Actually, I’m not sure whether the key id SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc is meant to be private info or not. Once you finish troubleshooting it would probably be good to create new ssh-keys.

What should I do next? should I reinstall git?

No need to reinstall git. Thats not where the problem is. It “seems” like something is compromised upstream

  1. Double-check your public key loaded on github matches your the private key your local SSH is “offering” to authenticate with. Apart from the written instructions, maybe watch a few video tutorials.

  2. Change you DNS Resolver to use Google rather than your local ISP (and flush dns cache) in case that is where the issue is. Check using the domain name again… ssh -Tv git@github.com to see if you now get a legimitate server-host-key.

  3. Try a VPN, even if just on a trial for troubleshooting purposes. If ssh -Tv git@github.com then fails to report a legitimate server-host-key, then there may be something compromised on your local machine.

p.s. I hope you are not getting too discouraged by the issues. I think its actually SSH doing its job to keep your comms secure.

@kurianbenoy, to be specific, I think you are referring to the “SSH key passphrase” used to secure the private key, so called since you can spaces can be used for separating the words of a phrase. @Daniel, I forgot to ask if you were using this feature. fyi, I only use a passphrase to wrap a private-key stored a remote servers. Think of the passphrase similar to a password on a zipfile, that gives you access to a file (the private-key) stored inside the zip file.

2 Likes

Yeah correct I was referring to SSH key passphrase, or simply saying password you used to generate Ssh key.

Even if you don’t remember old password, create a new SSH key and use passphrase of that Ssh key.

1 Like

The password versus passphrase terminology is subtle and easy to misunderstand at first glance. Normally its not necessary to be pendantic, but since we are in the trenches troubleshooting, for reader clarity…

In the next image (copied from above), the password being asked for is for the “git” user on the “github” server - which of course, none of us know (and thats okay, we were wanting to test publickey access.)

But actually it shouldn’t be asking for a password since github have disabled password authentication, and the connected server was configured to allowed it…

  • debug1: Authentications that can continue: publickey,password,keyboard-interactive

(which is one reason to suspect a MITM, or alternatively a misconfigured github server)

Observe in the following description that the password is shared through the secure tunnel to be checked at the other end against the server’s password database. So a MITM can capture the password.

In contrast, passphrases are never sent over the wire. A passphrase is only used to unlock (unzip) the local file containing the private-key. For comparison, when a passphrase is used to lock a private key, the prompt looks like this…
image

2 Likes

Hi @bencoman and @kurianbenoy Thank you so much for helping me out here. I have to say I am overwhelmed with this git issue here. I will get back to it tomorrow.

I have used a previously created (2 days ago) key (I have not set nor used passphrase from the start), and this time there is some progress ( I have been authenticated) from the output of running ssh -Tv git@140.82.112.3. However, the git@github.com password is still blocking me from connecting to github.

(base) 13:21 ~ > ssh -Tv git@140.82.112.3
OpenSSH_8.6p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/Natsume/.ssh/config
debug1: /Users/Natsume/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to 140.82.112.3 [140.82.112.3] port 22.
debug1: Connection established.
debug1: identity file /Users/Natsume/.ssh/id_ed25519 type 3
debug1: identity file /Users/Natsume/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.6
debug1: Remote protocol version 2.0, remote software version babeld-24a5c4c2
debug1: compat_banner: no match: babeld-24a5c4c2
debug1: Authenticating to 140.82.112.3:22 as 'git'
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host '140.82.112.3' is known and matches the ED25519 host key.
debug1: Found key in /Users/Natsume/.ssh/known_hosts:2
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/Natsume/.ssh/id_ed25519 ED25519 SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc explicit agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/Natsume/.ssh/id_ed25519 ED25519 SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc explicit agent
debug1: Server accepts key: /Users/Natsume/.ssh/id_ed25519 ED25519 SHA256:UFKLp/rN0o7czWwT5DukRK6TL2GyxKzfX8alHvlIimc explicit agent
debug1: Authentication succeeded (publickey).
Authenticated to 140.82.112.3 ([140.82.112.3]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: filesystem full
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: client_input_hostkeys: searching /Users/Natsume/.ssh/known_hosts for 140.82.112.3 / (none)
debug1: client_input_hostkeys: searching /Users/Natsume/.ssh/known_hosts2 for 140.82.112.3 / (none)
debug1: client_input_hostkeys: no new or deprecated keys from server
debug1: Sending environment.
debug1: channel 0: setting env LC_TERMINAL_VERSION = "3.4.16"
debug1: channel 0: setting env LC_CTYPE = "UTF-8"
debug1: channel 0: setting env LC_TERMINAL = "iTerm2"
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi EmbraceLife! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2268, received 2344 bytes, in 0.7 seconds
Bytes per second: sent 3456.2, received 3572.0
debug1: Exit status 1
(base) 13:24 ~ > ssh git@github.com
git@github.com's password:
Permission denied, please try again.
git@github.com's password:
Permission denied, please try again.
git@github.com's password:
git@github.com: Permission denied (publickey,password,keyboard-interactive).
(base) 13:25 ~ >
(base) 13:25 ~ >

Could setting IP address manually be the solution? but I have no idea how to do it, nor did I find anything useful online.

Seems like your ssh keys are now working fine with Github. Github does not provide a ssh login access, instead it uses ssh keys to securely connect to the hosted git server.

By getting the reply above from ssh -T git@github.com, you can be rest assured that your ssh keys and github expectations are in sync now.

At this point, your keys are working and you should be able to run git commands that interact with Github, for eg. things like git clone, git push, git pull etc.

Try cloning a private repo(that you have access to) from Github using the SSH method to verify that everything’s working well.

There’s no point to try to ssh login into Github as you’re doing below, since it’s not a remote server that one can login to.

1 Like

Thanks for your help!

However, the problem is that whenever I try git push/ clone, the git@github.com password: pop up automatically and I have never set or used such password before.