1
0
mirror of synced 2026-01-09 06:03:09 -05:00

Merge pull request #15830 from taleleuma/patch-2

Update error-permission-denied-publickey.md
This commit is contained in:
Vanessa
2022-03-02 12:20:10 +10:00
committed by GitHub

View File

@@ -14,9 +14,9 @@ topics:
- SSH
shortTitle: Permission denied (publickey)
---
## Should the `sudo` command be used with Git?
## Should the `sudo` command or elevated privileges be used with Git?
You should not be using the `sudo` command with Git. 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). If you [generate SSH keys](/articles/generating-an-ssh-key) without `sudo` and then try to use a command like `sudo git push`, you won't be using the same keys that you generated.
You should not be using the `sudo` command or elevated privileges, such as administrator permissions, with Git. 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). If you [generate SSH keys](/articles/generating-an-ssh-key) without `sudo` and then try to use a command like `sudo git push`, you won't be using the same keys that you generated.
## Check that you are connecting to the correct server