[LINUX] Corrective action for Bad owner or permissions on /home/(user_name)/.ssh/config error that occurs when executing an SSH command

An error occurs when trying to ssh to an EC2 instance

The environment is as follows

Execution command


ssh (Hostname)

Error statement


Bad owner or permissions on /home/(user_name)/.ssh/config

Cause

If the permissions of ~ / .ssh / config are loose (chmod 777, etc.) When executing the ssh command Returns a Bad owner or permissions on /home/(user_name)/.ssh/config error.

Solution

When I restricted the permissions of ~ / .ssh / config to read / write by the owner, the error disappeared and it started to work normally.

Solution


$ chmod 600 ~/.ssh/config


Recommended Posts

Corrective action for Bad owner or permissions on /home/(user_name)/.ssh/config error that occurs when executing an SSH command