Skip to main content
Improve formatting
Source Link
AdminBee
  • 23.6k
  • 25
  • 55
  • 77

The issue will likely have to do with the SELinux contexts on the ID's .ssh directory (and maybe more). look to the contexts (in .ssh) to have a type of ssh_home_t.

This is similar to the SSH user file's required permissions (no rwx for group/other). I've not checked but it may be required on both ends (both source and target user's .ssh dir needs that same contexts).

This is an example of the "correct" contexts:

[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts 
[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts 

In order to fix the context, you can use sudo chcon -t ssh_home_t /home/username/.ssh/authorized_keys

sudo chcon -t ssh_home_t /home/username/.ssh/authorized_keys 

The issue will likely have to do with the SELinux contexts on the ID's .ssh directory (and maybe more). look to the contexts (in .ssh) to have a type of ssh_home_t.

This is similar to the SSH user file's required permissions (no rwx for group/other). I've not checked but it may be required on both ends (both source and target user's .ssh dir needs that same contexts).

This is an example of the "correct" contexts:

[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts 

In order to fix the context, you can use sudo chcon -t ssh_home_t /home/username/.ssh/authorized_keys

The issue will likely have to do with the SELinux contexts on the ID's .ssh directory (and maybe more). look to the contexts (in .ssh) to have a type of ssh_home_t.

This is similar to the SSH user file's required permissions (no rwx for group/other). I've not checked but it may be required on both ends (both source and target user's .ssh dir needs that same contexts).

This is an example of the "correct" contexts:

[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts 

In order to fix the context, you can use

sudo chcon -t ssh_home_t /home/username/.ssh/authorized_keys 
Added a command to fix the context if it is wrong.
Source Link

The issue will likely have to do with the SELinux contexts on the ID's .ssh directory (and maybe more). look to the contexts (in .ssh) to have a type of ssh_home_t.

This is similar to the SSH user file's required permissions (no rwx for group/other). I've not checked but it may be required on both ends (both source and target user's .ssh dir needs that same contexts).

This is an example of the "correct" contexts:

[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts 

In order to fix the context, you can use sudo chcon -t ssh_home_t /home/username/.ssh/authorized_keys

The issue will likely have to do with the SELinux contexts on the ID's .ssh directory (and maybe more). look to the contexts (in .ssh) to have a type of ssh_home_t.

This is similar to the SSH user file's required permissions (no rwx for group/other). I've not checked but it may be required on both ends (both source and target user's .ssh dir needs that same contexts).

This is an example of the "correct" contexts:

[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts 

The issue will likely have to do with the SELinux contexts on the ID's .ssh directory (and maybe more). look to the contexts (in .ssh) to have a type of ssh_home_t.

This is similar to the SSH user file's required permissions (no rwx for group/other). I've not checked but it may be required on both ends (both source and target user's .ssh dir needs that same contexts).

This is an example of the "correct" contexts:

[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts 

In order to fix the context, you can use sudo chcon -t ssh_home_t /home/username/.ssh/authorized_keys

Formatting
Source Link
AdminBee
  • 23.6k
  • 25
  • 55
  • 77

theThe issue will likely have to do with the SELinux contexts on the ID's .ssh.ssh directory (and maybe more). look to the contexts (in .ssh.ssh) to have a type of "ssh_home_t"ssh_home_t. this

This is similar to the sshSSH user file's required permissions (no rwxrwx for group/other). I've not checked but it may be required on both ends (both source and target user's .ssh.ssh dir needs that same contexts). this

This is an example of the "correct" contexts:

[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts

[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts 

the issue will likely have to do with the SELinux contexts on the ID's .ssh directory (and maybe more). look to the contexts (in .ssh) to have a type of "ssh_home_t". this is similar to the ssh user file's required permissions (no rwx for group/other). I've not checked but it may be required on both ends (both source and target user's .ssh dir needs that same contexts). this is an example of the "correct" contexts:

[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts

The issue will likely have to do with the SELinux contexts on the ID's .ssh directory (and maybe more). look to the contexts (in .ssh) to have a type of ssh_home_t.

This is similar to the SSH user file's required permissions (no rwx for group/other). I've not checked but it may be required on both ends (both source and target user's .ssh dir needs that same contexts).

This is an example of the "correct" contexts:

[account@hostname .ssh]# ls -alZ drwx------. account account unconfined_u:object_r:ssh_home_t:s0 . drwx------. account account unconfined_u:object_r:user_home_dir_t:s0 .. -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 authorized_keys -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa -rw-------. account account unconfined_u:object_r:ssh_home_t:s0 id_rsa.pub -rw-r--r--. account account unconfined_u:object_r:ssh_home_t:s0 known_hosts 
Source Link
badSA
  • 61
  • 1
  • 1
Loading