<p dir="ltr"><br>
On 17 Nov 2014 18:52, "Martin Pool" <<a href="mailto:mbp@sourcefrog.net">mbp@sourcefrog.net</a>> wrote:<br>
><br>
> Hi, Sebastian,<br>
><br>
> I don't recall the exact command, but it's probably going to be `distccd --inet ...something...`. You might be able to see it in the distcc verbose log.<br>
><br>
> Being able to restrict the command would be good.<br>
><br>
> However the main problem with this approach is that distccd in turn executes a client-supplied command, and it at the moment doesn't have a way to limit that.</p>
<p dir="ltr">Actually we do have a way to limit that, via <a href="http://commands.allow.sh">commands.allow.sh</a> which is executed by /etc/init.d/distccd and which sets environment variables used by distccd.</p>
<p dir="ltr">See the following extract from the distccd man page:</p>
<p dir="ltr">-----<br>
<b>ENVIRONMENT VARIABLES</b><br></p>
<p dir="ltr"><b>DISTCC_</b><b>CMDLIST</b><br>
If the environment variable DISTCC_CMDLIST is set, load a list of supported commands from the file named by DISTCC_CMDLIST, and refuse to serve any command whose last DISTCC_CMDLIST_MATCHWORDS last words do not match those of a command in that list. See the comments in src/serve.c.</p>
<p dir="ltr"><b>DISTCC_</b><b>CMDLIST</b><b>_</b><b>NUMWORDS</b><br>
The number of words, from the end of the command, to match. The default is 1.<br>
----<br><br></p>
<p dir="ltr">> Two complementary things we could do:<br>
> - run distcc within a chroot/container that contains only the compiler - ideally, provide a reusable way for other people to set this up - at least documentation, maybe a script<br>
> - give distccd restrictions on what commands it can run<br>
><br>
><br>
> On Sun Nov 09 2014 at 7:29:12 AM Sebastian Wieseler <<a href="mailto:sebastian@nanofortnight.org">sebastian@nanofortnight.org</a>> wrote:<br>
>><br>
>> Hello Distcc List,<br>
>><br>
>> I followed the guide<a href="http://wiki.gentoo.org/wiki/Distcc"> http://wiki.gentoo.org/wiki/Distcc</a> to get Distcc to work with SSH.<br>
>> That should work as followed:<br>
>>         /usr/bin/distcc-config --set-hosts "@test1"<br>
>><br>
>> I just wondering how to limit the portage user to get a real SSH shell on the "compiling box".<br>
>> There should be a way with the .authorized_keys and the command="…" parameter for the SSH key.<br>
>><br>
>> What command will be exactly executed on the remote host within the distcc call?<br>
>> To just specify command="/usr/bin/distcc" does not work for example.<br>
>><br>
>> Is there a way to make this even more secure? I couldn't find any information on this on the web.<br>
>> Thanks for helping.<br>
>><br>
>> Best Regards,<br>
>> Sebastian 'kickino'<br>
>> --<br>
>>   ,= ,-_-. =.           /"\<br>
>>  ((_/)o o(\_))          \ /    ASCII Ribbon Campaign<br>
>>   `-'(. .)`-'   &&       X      against HTML e-mail<br>
>>       \_/               / \<br>
>><br>
>><br>
>> __<br>
>> distcc mailing list           <a href="http://distcc.samba.org/"> http://distcc.samba.org/</a><br>
>> To unsubscribe or change options:<br>
>><a href="https://lists.samba.org/mailman/listinfo/distcc"> https://lists.samba.org/mailman/listinfo/distcc</a><br>
><br>
><br>
> __<br>
> distcc mailing list           <a href="http://distcc.samba.org/"> http://distcc.samba.org/</a><br>
> To unsubscribe or change options:<br>
><a href="https://lists.samba.org/mailman/listinfo/distcc"> https://lists.samba.org/mailman/listinfo/distcc</a><br>
</p>