ssh-copy-id fails with Permission Denied due to immutable attribute

You might not be able to copy your SSH key. The problems is immutable attributes as below:

~ ssh-copy-id -p30022 [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/username/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:
sh: .ssh/authorized_keys: Permission denied

chmod 600 authorized_keys
chmod: changing permissions of ‘authorized_keys’: Operation not permitted

lsattr authorized_keys
----i----------- authorized_keys

Tags

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top