".ssh/config" E212: Can not open file for writing
20,898
If the .ssh folder didn't exist you could get this.
In which case you could create it first with:
mkdir ~/.ssh
chmod 700 ~/.ssh
Related videos on Youtube
Author by
Lorraine
Updated on September 18, 2022Comments
-
Lorraine over 1 year
I'm new to linux. I downloaded an image of ubuntu 12 for VirtualBox and I want to configure the
.ssh/config
file to access via ssh to an application in development.I access
/home/ubuntu
folder and I login as root, I typevim .ssh/config
and when I save I get the error:.ssh/config
E212: Can not open file for writing. Y saved it with :w, :w!, :wq! and I can´t.I tried with
sudo .ssh/config
andsudo ~/.ssh/config
.I've tried different virtual machines so i don't know can be causing this error. I hope you can help me.
-
Admin over 10 yearsOpen your editor as root user.
-
Admin over 10 yearsAre you trying to configure the
~/.ssh/config
? If so, you should't need to be root.
-
-
An Amateur over 10 yearsYes, I tried it too... but I have the same problem.
-
Lorraine over 10 yearsThanks for your response, but I still have problem to save it. I typed that and this is the output:
:w !sudo tee % > /dev/null
tee: .ssh/config: No such file or directory
shell returned 1
How can I know if the image is for readonly ? ¿Can someone link a image without this problem?