Linux console: "Unable to get valid context for..."

I have the warning Unable to get valid context for crimbo appearing at login, and I have not been able to fix it...

Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-83-generic x86_64)                                                                       

 * Documentation:  https://help.ubuntu.com                                                                                              
 * Management:     https://landscape.canonical.com                                                                                      
 * Support:        https://ubuntu.com/advantage                                                                                         

0 packages can be updated.                                                                                                              
0 updates are security updates.                                                                                                         


Unable to get valid context for crimbo                                                                                                  
Last login: Fri Jun 30 00:29:56 2017 from 65.52.184.164

I believe this is not specific to Ubuntu. I have created a . autorelabel at the root of the drive and rebooted the system to make SELinux rebuild the labels of the entire filesystem as directed here, but it has not made any difference. The autorelabel must of taken place as the file is no longer there.

Do you have any ideas what I can do?


I recommend checking your SELinux user mapping if you haven't already. I came across a similar error on the graphical side of a CentOS 7x box. It was because the user I was currently trying to log in as was mapped to the "sysadm_u" user. You can confirm this by running semanage login -l. The fix was to run setsebool xdm_sysadm_login on and in your case, probably setsebool ssh_sysadm_login on could help as well.