SSH: Unable to get valid context
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2010
    Posts
    2

    SSH: Unable to get valid context

    I'm trying to get openssh-server working on a fresh install of Fedora 14. I start sshd then try to log in over ssh from another computer. The following error is returned:
    Code:
    Unable to get valid context for xxxxxxxx
    Last login: Thu Dec  9 11:52:10 2010 from xxxxxxxx
    Connection to xxx.xxx.xxx.xxx closed.
    I've done some research, and it seems to have to do with SELinux. However, none of the solutions I came across worked, or they were not clear enough on what to do.
    Can someone who has had and fixed this problem explain exactly what to do?

  2. #2
    Join Date
    Jul 2004
    Location
    Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
    Age
    73
    Posts
    23,607

    Re: SSH: Unable to get valid context

    (Sorry for the "moderation" delay there. "XXX" kinda triggers a block on a post until we can check it out.
    Linux & Beer - That TOTALLY Computes!
    Registered Linux User #362651


    Don't use any of my solutions on working computers or near small children.

  3. #3
    Join Date
    Jun 2007
    Location
    Lake Mary, Florida
    Age
    54
    Posts
    1,088

    Re: SSH: Unable to get valid context

    Hello,
    To test SELinux you can disable, then test your connection.
    Then you know that SELinux is the problem.

    vi /etc/sysconfig/selinux
    SELINUX=disabled
    reboot

  4. #4
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,345

    Re: SSH: Unable to get valid context

    How did you install openssh?

    Using the repositories should have installed the binary with suitable labels
    that will grant the proper context.

    Next, if SELinux was denying sshd a context, there should be a log entry
    which includes the directions on how to enable it.

  5. #5
    Join Date
    Dec 2010
    Posts
    2

    Re: SSH: Unable to get valid context

    Quote Originally Posted by scott32746
    Hello,
    To test SELinux you can disable, then test your connection.
    Then you know that SELinux is the problem.

    vi /etc/sysconfig/selinux
    SELINUX=disabled
    reboot
    With SELinux disabled, I can successfully connect.
    Quote Originally Posted by jpollard
    How did you install openssh?

    Using the repositories should have installed the binary with suitable labels
    that will grant the proper context.

    Next, if SELinux was denying sshd a context, there should be a log entry
    which includes the directions on how to enable it.
    Today 01:53 PM
    It was installed be default.
    What is the path of the log file?

  6. #6
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,345

    Re: SSH: Unable to get valid context

    The file is /var/log/audit/*

    You should be able to see any of the alerts as interpreted by the utility
    "sealert", which is a GUI interface, and provides suggestions for allowing
    certain operations.

    Normally, sshd will not have problems as everything will have been installed appropriately.

    But there are conditions - for instance, user home directories. If the user
    is added manually, then SELinux labels will not necessarily be correct.
    This can be the a source of "cannot set context" because the user is not
    fully set up.

  7. #7
    leigh123linux Guest

    Re: SSH: Unable to get valid context

    Quote Originally Posted by bob
    (Sorry for the "moderation" delay there. "XXX" kinda triggers a block on a post until we can check it out.
    Fixed ..........

Similar Threads

  1. [SOLVED]
    SSH: Unable to get valid context
    By tanwald in forum Using Fedora
    Replies: 19
    Last Post: 26th December 2013, 12:36 AM
  2. SSH unable to get context for username
    By leeatnwi in forum Servers & Networking
    Replies: 5
    Last Post: 14th July 2010, 10:25 AM
  3. Context.xml
    By tariqtariq in forum Servers & Networking
    Replies: 1
    Last Post: 5th July 2005, 10:43 PM
  4. Unable to create files when using "context"option for NFS
    By lobotomy in forum Security and Privacy
    Replies: 0
    Last Post: 28th May 2005, 12:15 AM
  5. Samba Valid Users Not Valid
    By budds in forum Servers & Networking
    Replies: 1
    Last Post: 10th January 2005, 07:22 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •