Thank you for the responses.  I was initially attempting to set this value via the web UI and if I entered anything other than the hash value of the user's public key it would get rejected.  After thinking about your response I realize that I really need to determine a method of doing this via a HBAC rule.  If I accomplish this with authorized_keys then the user is restricted across the board and would not be able to gain a shell on any system whereas HBAC would allow me to restrict thier access as needed.  We currently require users to tunnel over SSH to gain access to certain sensitive web apps (like Nessus) but those same users have shell access on a few boxes.  Thoughts??<br>
<br>Albert<br><br><div class="gmail_quote">On Mon, Dec 17, 2012 at 4:08 AM, Jan Cholasta <span dir="ltr"><<a href="mailto:jcholast@redhat.com" target="_blank">jcholast@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
this should work and you don't even have to set the shell to /sbin/nologin (depends on whether you want the users to be able to login to the system by other means or not), as the command directive in authorized_keys takes precedence.<br>

<br>
The tricky part is escaping the value correctly (there is shell escaping, IPA CSV quote escaping and authorized_keys quote escaping in effect):<br>
<br>
$ ipa user-mod user --sshpubkey='"command=""/usr/<u></u>bin/perl -e '\''$|=1; print \""Tunnel created, use your webbrowser to connect to the tool\n\"";while(1) { print localtime(time) . \""\n\""; sleep 60}'\''"",permitopen=""<u></u>localhost:8834"",no-agent-<u></u>forwarding,no-X11-forwarding ssh-rsa ..."'<br>

<br>
Honza<div class="im"><br>
<br>
On 17.12.2012 03:23, Peter Brown wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi Albert,<br>
<br>
Have you tried putting that command in the public key for the user in<br>
freeipa and setting the user shell to /sbin/nologin or the equivalent?<br>
<br>
<br>
On 15 December 2012 02:09, Albert Adams <<a href="mailto:biteoag@gmail.com" target="_blank">biteoag@gmail.com</a><br></div><div class="im">
<mailto:<a href="mailto:biteoag@gmail.com" target="_blank">biteoag@gmail.com</a>>> wrote:<br>
<br>
    In our environment we have several systems where users require<br>
    access to the system to setup an SSH tunnel but should not have a<br>
    shell on the system.  Prior to rolling out IPA we accomplished this<br>
    with the authorized_keys file as follows:<br>
<br>
    command="/usr/bin/perl -e '$|=1; print \"Tunnel created, use your<br>
    webbrowser to connect to the tool\n\";while(1) { print<br>
    localtime(time) . \"\n\"; sleep<br>
    60}'",permitopen="localhost:<u></u>8834",no-agent-forwarding,no-<u></u>X11-forwarding<br>
<br>
    Is there a way to accomplish this in IPA?<br>
<br>
    Regards,<br>
    Albert<br>
<br>
    ______________________________<u></u>_________________<br>
    Freeipa-users mailing list<br></div>
    <a href="mailto:Freeipa-users@redhat.com" target="_blank">Freeipa-users@redhat.com</a> <mailto:<a href="mailto:Freeipa-users@redhat.com" target="_blank">Freeipa-users@redhat.<u></u>com</a>><br>
    <a href="https://www.redhat.com/mailman/listinfo/freeipa-users" target="_blank">https://www.redhat.com/<u></u>mailman/listinfo/freeipa-users</a><div class="im"><br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Freeipa-users mailing list<br>
<a href="mailto:Freeipa-users@redhat.com" target="_blank">Freeipa-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/freeipa-users" target="_blank">https://www.redhat.com/<u></u>mailman/listinfo/freeipa-users</a><br>
<br>
</div></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<br>
-- <br>
Jan Cholasta<br>
</font></span></blockquote></div><br>