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

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.

  • Running semanage login -l returns ValueError: SELinux policy is not managed or store cannot be accessed. – Crimbo Sep 5 '17 at 10:20
  • I turned off 'root' login - Are you suggesting that might be why? – Crimbo Sep 5 '17 at 10:20

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.