After changing permission of ~/.ssh/authorized_keys and the ~/.ssh directory I get a permission denied (public key)SSH Permission denied (publickey)SSH Permission denied (public key), but root ssh worksSSH “Permission Denied (Public Key)” Automatically re-occuring problemGetting prompted for a password via SSH even after setting up authorized_keysSSH Permission denied (using right password)Permission denied via ssh accessPublic key authentication Permission denied (publickey)ssh permission denied(public key)ssh login with public key stopped work in Ubuntu 16.04.4
Conflict between a religious belief that accounts for the existence of transgender people vs. one that doesn't
What color is a wolf's coat?
Heavy condensation inside car during winter. Tried multiple things, but no results!
Is there a coup going on in Bolivia?
Why in the world would the tab on a TO-220 package have a connection to anything (but GND, if applicable)?
What does Darth Vader think Obi-Wan's referring to when Obi says "If you strike me down..."
Outlining the climax made me lose interest in writing the actual story
How to respond to requests to retest, in hope that the bug is gone?
What happens when a ceramic bypass or decoupling capacitor goes bad?
A robot surviving on top of a 3x3 platform
Should I turn off kernel logging (and how?) if I'm running off an SSD?
Hanging string lights from stone
Does a small cup of coffee result in a 45% reduced blood flow to the brain?
Why is super hero technology never used by civilians?
C: Can't pass '#' as command-line argument
What is the communications range of a standard Starfleet combadge?
A novel about "helpful" woodlice aliens who eventually end up destroying every civilization they try to help
Crack hashed passwords using a known password
Single word for being half in this world, half in some other spooky plane of existence
Mostly pluses and minuses: says Grandpa
Does the German President's apology for WWII reflect the prevailing views of the people of Germany?
In an interview, is it self-defeating to say you use StackOverflow to find errors in code?
How do impulse response guitar amp simulators work?
Size Does Matter (at least referring to bottles)
After changing permission of ~/.ssh/authorized_keys and the ~/.ssh directory I get a permission denied (public key)
SSH Permission denied (publickey)SSH Permission denied (public key), but root ssh worksSSH “Permission Denied (Public Key)” Automatically re-occuring problemGetting prompted for a password via SSH even after setting up authorized_keysSSH Permission denied (using right password)Permission denied via ssh accessPublic key authentication Permission denied (publickey)ssh permission denied(public key)ssh login with public key stopped work in Ubuntu 16.04.4
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
Without changing the permissions this error doesn't occur. I'm changing them with:
sudo chmod 700 ~/.ssh
sudo chmod 600 ~/.ssh/authorized_keys
(same steps as in this answer)
server permissions ssh
add a comment
|
Without changing the permissions this error doesn't occur. I'm changing them with:
sudo chmod 700 ~/.ssh
sudo chmod 600 ~/.ssh/authorized_keys
(same steps as in this answer)
server permissions ssh
Why are you usingsudo
? are the files owned byroot
?
– steeldriver
Aug 11 at 11:32
@steeldriver Thanks for the reply It tells me permission denied if I don't use sudo. The authorized_keys is owned by rootrw------- 1 root root 744 Aug 11 10:34 authorized_keys
– Twiggeh
Aug 11 at 16:10
add a comment
|
Without changing the permissions this error doesn't occur. I'm changing them with:
sudo chmod 700 ~/.ssh
sudo chmod 600 ~/.ssh/authorized_keys
(same steps as in this answer)
server permissions ssh
Without changing the permissions this error doesn't occur. I'm changing them with:
sudo chmod 700 ~/.ssh
sudo chmod 600 ~/.ssh/authorized_keys
(same steps as in this answer)
server permissions ssh
server permissions ssh
edited Aug 11 at 11:21
cmak.fr
4,0271 gold badge15 silver badges32 bronze badges
4,0271 gold badge15 silver badges32 bronze badges
asked Aug 11 at 11:13
TwiggehTwiggeh
31 bronze badge
31 bronze badge
Why are you usingsudo
? are the files owned byroot
?
– steeldriver
Aug 11 at 11:32
@steeldriver Thanks for the reply It tells me permission denied if I don't use sudo. The authorized_keys is owned by rootrw------- 1 root root 744 Aug 11 10:34 authorized_keys
– Twiggeh
Aug 11 at 16:10
add a comment
|
Why are you usingsudo
? are the files owned byroot
?
– steeldriver
Aug 11 at 11:32
@steeldriver Thanks for the reply It tells me permission denied if I don't use sudo. The authorized_keys is owned by rootrw------- 1 root root 744 Aug 11 10:34 authorized_keys
– Twiggeh
Aug 11 at 16:10
Why are you using
sudo
? are the files owned by root
?– steeldriver
Aug 11 at 11:32
Why are you using
sudo
? are the files owned by root
?– steeldriver
Aug 11 at 11:32
@steeldriver Thanks for the reply It tells me permission denied if I don't use sudo. The authorized_keys is owned by root
rw------- 1 root root 744 Aug 11 10:34 authorized_keys
– Twiggeh
Aug 11 at 16:10
@steeldriver Thanks for the reply It tells me permission denied if I don't use sudo. The authorized_keys is owned by root
rw------- 1 root root 744 Aug 11 10:34 authorized_keys
– Twiggeh
Aug 11 at 16:10
add a comment
|
2 Answers
2
active
oldest
votes
The problems are that the keys are owned by root.
sudo chown -R $USER:$USER ~/.ssh
chmod -R 700 ~/.ssh
These two commands will restore ownership to user and set permissions appropriately.
The general rule is that everything in your home directory should be owned by you. In the case of ssh keys, ssh will refuse to work if ownership does not match username, as it may be a security problem.
I changed the permissions back with chown after steeldriver asked if they were owned by root and it still didn't work. Turned out that Digital Oceans console doesn't do well with copy pasting - it bummed my key up when I pasted it
– Twiggeh
Aug 12 at 10:16
add a comment
|
In my case the answer was that the console provided by Digital Ocean bummed up my key when I pasted it in. (I don't know why it does that but long strings get scrambled when you paste them).
So the solution for me was to download the key file with curl
.
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1164956%2fafter-changing-permission-of-ssh-authorized-keys-and-the-ssh-directory-i-g%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The problems are that the keys are owned by root.
sudo chown -R $USER:$USER ~/.ssh
chmod -R 700 ~/.ssh
These two commands will restore ownership to user and set permissions appropriately.
The general rule is that everything in your home directory should be owned by you. In the case of ssh keys, ssh will refuse to work if ownership does not match username, as it may be a security problem.
I changed the permissions back with chown after steeldriver asked if they were owned by root and it still didn't work. Turned out that Digital Oceans console doesn't do well with copy pasting - it bummed my key up when I pasted it
– Twiggeh
Aug 12 at 10:16
add a comment
|
The problems are that the keys are owned by root.
sudo chown -R $USER:$USER ~/.ssh
chmod -R 700 ~/.ssh
These two commands will restore ownership to user and set permissions appropriately.
The general rule is that everything in your home directory should be owned by you. In the case of ssh keys, ssh will refuse to work if ownership does not match username, as it may be a security problem.
I changed the permissions back with chown after steeldriver asked if they were owned by root and it still didn't work. Turned out that Digital Oceans console doesn't do well with copy pasting - it bummed my key up when I pasted it
– Twiggeh
Aug 12 at 10:16
add a comment
|
The problems are that the keys are owned by root.
sudo chown -R $USER:$USER ~/.ssh
chmod -R 700 ~/.ssh
These two commands will restore ownership to user and set permissions appropriately.
The general rule is that everything in your home directory should be owned by you. In the case of ssh keys, ssh will refuse to work if ownership does not match username, as it may be a security problem.
The problems are that the keys are owned by root.
sudo chown -R $USER:$USER ~/.ssh
chmod -R 700 ~/.ssh
These two commands will restore ownership to user and set permissions appropriately.
The general rule is that everything in your home directory should be owned by you. In the case of ssh keys, ssh will refuse to work if ownership does not match username, as it may be a security problem.
answered Aug 12 at 9:22
vidarlovidarlo
14.2k6 gold badges34 silver badges60 bronze badges
14.2k6 gold badges34 silver badges60 bronze badges
I changed the permissions back with chown after steeldriver asked if they were owned by root and it still didn't work. Turned out that Digital Oceans console doesn't do well with copy pasting - it bummed my key up when I pasted it
– Twiggeh
Aug 12 at 10:16
add a comment
|
I changed the permissions back with chown after steeldriver asked if they were owned by root and it still didn't work. Turned out that Digital Oceans console doesn't do well with copy pasting - it bummed my key up when I pasted it
– Twiggeh
Aug 12 at 10:16
I changed the permissions back with chown after steeldriver asked if they were owned by root and it still didn't work. Turned out that Digital Oceans console doesn't do well with copy pasting - it bummed my key up when I pasted it
– Twiggeh
Aug 12 at 10:16
I changed the permissions back with chown after steeldriver asked if they were owned by root and it still didn't work. Turned out that Digital Oceans console doesn't do well with copy pasting - it bummed my key up when I pasted it
– Twiggeh
Aug 12 at 10:16
add a comment
|
In my case the answer was that the console provided by Digital Ocean bummed up my key when I pasted it in. (I don't know why it does that but long strings get scrambled when you paste them).
So the solution for me was to download the key file with curl
.
add a comment
|
In my case the answer was that the console provided by Digital Ocean bummed up my key when I pasted it in. (I don't know why it does that but long strings get scrambled when you paste them).
So the solution for me was to download the key file with curl
.
add a comment
|
In my case the answer was that the console provided by Digital Ocean bummed up my key when I pasted it in. (I don't know why it does that but long strings get scrambled when you paste them).
So the solution for me was to download the key file with curl
.
In my case the answer was that the console provided by Digital Ocean bummed up my key when I pasted it in. (I don't know why it does that but long strings get scrambled when you paste them).
So the solution for me was to download the key file with curl
.
answered Aug 12 at 10:20
TwiggehTwiggeh
31 bronze badge
31 bronze badge
add a comment
|
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1164956%2fafter-changing-permission-of-ssh-authorized-keys-and-the-ssh-directory-i-g%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Why are you using
sudo
? are the files owned byroot
?– steeldriver
Aug 11 at 11:32
@steeldriver Thanks for the reply It tells me permission denied if I don't use sudo. The authorized_keys is owned by root
rw------- 1 root root 744 Aug 11 10:34 authorized_keys
– Twiggeh
Aug 11 at 16:10