Skip to contentSkip to conversation

MLS Policy (rawhide)

DISCUSSION Michael C Thompson 3 participants 9 messages Sep 7, 2006 – Sep 19, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hey all,

It seems that ssh is unable to add entries to known_hosts for the root user as sysadm_t. Is this a known issue? And if so, who can add entries to /root/.ssh/known_hosts ?

Thanks,
Mike

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 3 lines · Michael C Thompson

Hey all,

It seems that ssh is unable to add entries to known_hosts for the root user as sysadm_t. Is this a known issue? And if so, who can add entries to /root/.ssh/known_hosts ?

I think I should point out that this isn't as the user, but when executing ssh as root.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw
In reply to Michael C Thompson
Quoted 7 lines · Michael C Thompson

Hey all,

It seems that ssh is unable to add entries to known_hosts for the root user as sysadm_t. Is this a known issue? And if so, who can add entries to /root/.ssh/known_hosts ?

Thanks,
Mike

This works for me. How is the file labeled?

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#3 lore raw
Quoted 9 lines · Daniel J Walsh
Quoted 7 lines · Michael C Thompson

Hey all,

It seems that ssh is unable to add entries to known_hosts for the root user as sysadm_t. Is this a known issue? And if so, who can add entries to /root/.ssh/known_hosts ?

Thanks,
Mike

This works for me. How is the file labeled?

# ls -alZ /root/.ssh
drwx------  root root root:object_r:user_home_ssh_t:SystemLow .
drwxr-x---  root root root:object_r:sysadm_home_dir_t:SystemLow-SystemHigh ..
-rw-------  root root root:object_r:bin_t:SystemLow    id_rsa
-rw-r--r--  root root root:object_r:bin_t:SystemLow    id_rsa.pub
-rw-r--r--  root root root:object_r:user_home_ssh_t:SystemLow known_hosts

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#4 lore raw
Quoted 17 lines · Michael C Thompson
Quoted 11 lines · Daniel J Walsh
Quoted 9 lines · Michael C Thompson

Hey all,

It seems that ssh is unable to add entries to known_hosts for the root user as sysadm_t. Is this a known issue? And if so, who can add entries to /root/.ssh/known_hosts ?

Thanks,
Mike

This works for me. How is the file labeled?

# ls -alZ /root/.ssh
drwx------  root root root:object_r:user_home_ssh_t:SystemLow .
drwxr-x---  root root 
root:object_r:sysadm_home_dir_t:SystemLow-SystemHigh ..

Review

Quoted 3 lines
(quoted diff) +0 -3
-rw-------  root root root:object_r:bin_t:SystemLow    id_rsa
-rw-r--r--  root root root:object_r:bin_t:SystemLow    id_rsa.pub
-rw-r--r--  root root root:object_r:user_home_ssh_t:SystemLow known_hosts

/sbin/restorecon -R /root/.ssh

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#5 lore raw
Quoted 11 lines · Stephen Smalley
Quoted 10 lines · Michael C Thompson
Quoted 9 lines · Daniel J Walsh
Quoted 7 lines · Michael C Thompson

Hey all,

It seems that ssh is unable to add entries to known_hosts for the root user as sysadm_t. Is this a known issue? And if so, who can add entries to /root/.ssh/known_hosts ?

Thanks,
Mike

This works for me. How is the file labeled?

Quoted 8 lines

Review

Quoted 6 lines
# ls -alZ /root/.ssh
drwx------  root root root:object_r:user_home_ssh_t:SystemLow .
drwxr-x---  root root root:object_r:sysadm_home_dir_t:SystemLow-SystemHigh ..
(quoted diff) +0 -3
-rw-------  root root root:object_r:bin_t:SystemLow    id_rsa
-rw-r--r--  root root root:object_r:bin_t:SystemLow    id_rsa.pub
-rw-r--r--  root root root:object_r:user_home_ssh_t:SystemLow known_hosts

/sbin/restorecon -R /root/.ssh

I have relabeled this system numerous times with touch /.autorelabel... why wasn't this picked up?

Mike

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#6 lore raw
Quoted 24 lines · Michael C Thompson
Quoted 13 lines · Stephen Smalley
Quoted 12 lines · Michael C Thompson
Quoted 11 lines · Daniel J Walsh
Quoted 9 lines · Michael C Thompson

Hey all,

It seems that ssh is unable to add entries to known_hosts for the root user as sysadm_t. Is this a known issue? And if so, who can add entries to /root/.ssh/known_hosts ?

Thanks,
Mike

This works for me. How is the file labeled?

Quoted 9 lines

Review

Quoted 7 lines
# ls -alZ /root/.ssh
drwx------  root root root:object_r:user_home_ssh_t:SystemLow .
drwxr-x---  root root 
root:object_r:sysadm_home_dir_t:SystemLow-SystemHigh ..
(quoted diff) +0 -3
-rw-------  root root root:object_r:bin_t:SystemLow    id_rsa
-rw-r--r--  root root root:object_r:bin_t:SystemLow    id_rsa.pub
-rw-r--r--  root root root:object_r:user_home_ssh_t:SystemLow known_hosts

/sbin/restorecon -R /root/.ssh

Quoted 2 lines

I have relabeled this system numerous times with touch /.autorelabel... why wasn't this picked up?

Not sure, not a big fan of autorelabeling myself. Is /home on a separate partition? Would it be mounted when the relabel runs from rc.sysinit?

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#7 lore raw
Quoted 20 lines · Stephen Smalley
Quoted 19 lines · Michael C Thompson
Quoted 18 lines · Stephen Smalley
Quoted 13 lines · Michael C Thompson
Quoted 9 lines · Daniel J Walsh
Quoted 7 lines · Michael C Thompson

Hey all,

It seems that ssh is unable to add entries to known_hosts for the root user as sysadm_t. Is this a known issue? And if so, who can add entries to /root/.ssh/known_hosts ?

Thanks,
Mike

This works for me. How is the file labeled?

# ls -alZ /root/.ssh
drwx------  root root root:object_r:user_home_ssh_t:SystemLow .
drwxr-x---  root root root:object_r:sysadm_home_dir_t:SystemLow-SystemHigh ..

Review

Quoted 3 lines
(quoted diff) +0 -3
-rw-------  root root root:object_r:bin_t:SystemLow    id_rsa
-rw-r--r--  root root root:object_r:bin_t:SystemLow    id_rsa.pub
-rw-r--r--  root root root:object_r:user_home_ssh_t:SystemLow known_hosts

/sbin/restorecon -R /root/.ssh

Quoted 3 lines
Quoted 1 line

I have relabeled this system numerous times with touch /.autorelabel... why wasn't this picked up?

Not sure, not a big fan of autorelabeling myself.

Me either, not sure how it got some messed up though.

Quoted 3 lines

Is /home on a
separate partition? Would it be mounted when the relabel runs from rc.sysinit?

Well, it wasn't in /home, but even then that isn't the case. But it works now, so thanks Stephen :)

Mike

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#8 lore raw
Quoted 28 lines · Michael C Thompson
Quoted 21 lines · Stephen Smalley
Quoted 20 lines · Michael C Thompson
Quoted 19 lines · Stephen Smalley
Quoted 16 lines · Michael C Thompson
Quoted 9 lines · Daniel J Walsh
Quoted 7 lines · Michael C Thompson

Hey all,

It seems that ssh is unable to add entries to known_hosts for the root user as sysadm_t. Is this a known issue? And if so, who can add entries to /root/.ssh/known_hosts ?

Thanks,
Mike

This works for me. How is the file labeled?

# ls -alZ /root/.ssh
drwx------  root root root:object_r:user_home_ssh_t:SystemLow .
drwxr-x---  root root root:object_r:sysadm_home_dir_t:SystemLow-SystemHigh ..
(quoted diff) +0 -3
-rw-------  root root root:object_r:bin_t:SystemLow    id_rsa
-rw-r--r--  root root root:object_r:bin_t:SystemLow    id_rsa.pub
-rw-r--r--  root root root:object_r:user_home_ssh_t:SystemLow 
Quoted 1 line

known_hosts

/sbin/restorecon -R /root/.ssh

Quoted 3 lines
Quoted 1 line

I have relabeled this system numerous times with touch /.autorelabel... why wasn't this picked up?

Not sure, not a big fan of autorelabeling myself.

Me either, not sure how it got some messed up though.

Quoted 8 lines
Quoted 3 lines

Is /home on a
separate partition? Would it be mounted when the relabel runs from rc.sysinit?

Well, it wasn't in /home, but even then that isn't the case. But it works now, so thanks Stephen :)

Mike

touch /.autorelabel should only be used when you have a serious labeling problem (file_t, selinux=0, changing policy types).

This should seldom be done. I have not done it in over a year.

The file system should not be getting badly mislabeled at this point.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.