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?