So, I've set up docker 17.03
on Ubuntu 16.04.5 LTS
. The problem is, the application needs to ssh
to an external server. Since docker
binds current users ssh
files, it should allow me to ssh
into the server from the container. However its giving me the Bad owner or permissions on /root/.ssh/config
error.
From what I've figured, docker is running as my ubuntu user which is 1001
and is trying to access root
account ssh
files (I could be wrong) which is why its giving me this error.
Also, when I run echo $USER
from the container, its not returning any user, but just an empty line.
The question is, has anybody faced this problem before and if so, has anybody solved it?
These commands should fix the permissions issues:
Set the file owner:
chown $USER ~/.ssh/config
Set rw for user only permissions on config:
chmod 600 ~/.ssh/config
If chmod 600 ~/.ssh/config
doesn't work try with:
chmod 400 ~/.ssh/config
On Linux, Changing the ownership to root fixed the issue for me. I also added my usergroup as group, so the config will work outside docker as well.
chown root:$USER ~/.ssh/config
chmod 644 ~/.ssh/config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With