<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>

<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.2">
<TITLE>New prompt at login time</TITLE>
</HEAD>
<BODY>

<P>        <FONT SIZE=2 FACE="Courier New">I have posted this on the redhat-list and the pam-list an no one responded. So I am trying here. Hopefully someone will have something to say that will help.</FONT></P>

<P>        <FONT SIZE=2 FACE="Courier New">I ran up2date yesterday (now a few days ago) and have my system completely up to</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">date. I rebooted this morning (now a few days ago) and now when I login via telnet, yes that</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">is just plain old telnet, not ssh, I get the following:</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">========</FONT><BR>
<FONT SIZE=2 FACE="Courier New">Red Hat Enterprise Linux AS release 4 (Nahant Update 2)</FONT><BR>
<FONT SIZE=2 FACE="Courier New">Kernel 2.6.9-22.ELsmp on an i686</FONT><BR>
<FONT SIZE=2 FACE="Courier New">login: jca</FONT><BR>
<FONT SIZE=2 FACE="Courier New">Password:</FONT><BR>
<FONT SIZE=2 FACE="Courier New">Your default context is user_u:system_r:unconfined_t.</FONT> 
<BR><FONT SIZE=2 FACE="Courier New">Do you want to choose a different one? [n]</FONT><BR>
<FONT SIZE=2 FACE="Courier New">========</FONT> 
<BR><FONT SIZE=2 FACE="Courier New">I just entered a CR and thought this would be a one time things. But it</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">is not. While the prompt was being displayed I did a who and it does not</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">show me logged in yet. I did a ps -ef | grep log and see a login process</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">with the host name and -p option. So it appears the prompt is coming</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">from the login program or its calls to some PAM routine.</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">Does anybody know where this is controlled so I can set a</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">default and not be prompted each time?</FONT> 
<BR><FONT SIZE=2 FACE="Courier New">Also exactly what is this controlling?</FONT> 
<BR><FONT SIZE=2 FACE="Courier New">If I do id, it shows context=user_u:system_r:unconfined_t</FONT> 
<BR><FONT SIZE=2 FACE="Courier New">Some things I have been able to find out and more questions.</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">I did man -k context and discovered the get_default_context routine. Doing</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">man get_default_context tells me about get_default_context_list</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">get_ordered_context_list queries the SE Linux policy database in the</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">kernel and some configuration files to determine an ordered list of</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">contexts that may be used for login sessions. The list must be freed</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">with freeconary. The possible roles and domains will be read from</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">/etc/security/default_contexts and .default_contexts in the home</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">directory of the user in question.</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">My question now is what is the format of the files listed above?</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">manual_user_enter_context allows the user to manually enter a context</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">as a fallback if a list of authorized contexts could not be obtained.</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">Caller must free via freecon.</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">So I assume this is why I am getting prompted.</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">I found default_contexts in /etc/selinux/targeted/contexts and it contains:</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">system_r:unconfined_t system_r:unconfined_t</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">I also found that if I removed the multiple option for pam_selinux.so, in remote located in /etc/pam.d, I do not get the prompt. So is this the correct place to correct this? That is the next time I run up2date and there is an update to remote is it going to get replaced and I will have to remove it again? Or is there another place that controls this that would be better to change.</FONT></P>

<P><FONT SIZE=2 FACE="Courier New">Thanks:</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">Jack Allen</FONT><FONT FACE="Times New Roman"> </FONT>
</P>

</BODY>
</HTML>