Skip to content

Commit

Permalink
Update error-permission-denied-publickey.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrl authored Mar 2, 2022
1 parent ba263ca commit 4cdd1f6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ topics:
- SSH
shortTitle: Permission denied (publickey)
---
## (Linux) 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

Expand Down

0 comments on commit 4cdd1f6

Please sign in to comment.