
If you try to connect with your GitHub username, it will fail: $ ssh -T Permission denied (publickey). Always use the "git" userĪll connections, including those for remote URLs, must be made as the "git" user. The connection should be made on port 22, unless you're overriding settings to use SSH over HTTPS. > debug1: /etc/ssh/ssh_config line 47: Applying options for * > debug1: Reading configuration data /etc/ssh/ssh_config > debug1: Reading configuration data /Users/ you/.ssh/config To make sure you are connecting to the right domain, you can enter the following command: $ ssh -vT OpenSSH_8.1p1, LibreSSL 2.7.3 In some cases, a corporate network may cause issues resolving the DNS record as well. Pay attention to what you type you won't be able to connect to "" or "". Check that you are connecting to the correct server If you generate SSH keys without sudo and then try to use a command like sudo git push, you won't be using the same keys that you generated. If you have a very good reason you must use sudo, then ensure you are using it with every command (it's probably just better to use su to get a shell as root at that point). You should not be using the sudo command with Git. Should the sudo command be used with Git?
