<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.1701technology.com/index.php?action=history&amp;feed=atom&amp;title=Allow_non-root_to_access_restricted_resources</id>
	<title>Allow non-root to access restricted resources - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.1701technology.com/index.php?action=history&amp;feed=atom&amp;title=Allow_non-root_to_access_restricted_resources"/>
	<link rel="alternate" type="text/html" href="https://wiki.1701technology.com/index.php?title=Allow_non-root_to_access_restricted_resources&amp;action=history"/>
	<updated>2026-05-06T15:32:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.1701technology.com/index.php?title=Allow_non-root_to_access_restricted_resources&amp;diff=1073&amp;oldid=prev</id>
		<title>Michael.mast: Created page with &quot;==Purpose== To allow non-root users to access restricted resources. This spawned from my desire to have a docker container run nxfilter as not root. Seeing it run as root in h...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.1701technology.com/index.php?title=Allow_non-root_to_access_restricted_resources&amp;diff=1073&amp;oldid=prev"/>
		<updated>2019-03-09T18:54:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Purpose== To allow non-root users to access restricted resources. This spawned from my desire to have a docker container run nxfilter as not root. Seeing it run as root in h...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Purpose==&lt;br /&gt;
To allow non-root users to access restricted resources. This spawned from my desire to have a docker container run nxfilter as not root. Seeing it run as root in htop, especially with recent vulnerabilities&amp;lt;ref&amp;gt;https://medium.com/@mccode/processes-in-containers-should-not-run-as-root-2feae3f0df3b&amp;lt;/ref&amp;gt;, made me want to figure this out.&lt;br /&gt;
==Procedure==&lt;br /&gt;
In this example I want to run a jvm as a non-root user.&lt;br /&gt;
*Create a new group, user, and add the user to the group. In my case I set the ID to something random.&amp;lt;ref&amp;gt;https://www.cyberciti.biz/faq/linux-change-user-group-uid-gid-for-all-owned-files/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
groupadd -g 54628 nxfilter &amp;amp;&amp;amp; useradd -u 54682 -g nxfilter nxfilter&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Then use setcap to allow java to bind to ports under 1000 (since we want to use 53,80 and 443)&amp;lt;ref&amp;gt;https://blogs.oracle.com/sduloutr/binding-a-server-to-privileged-port-on-linux-wo-running-as-root&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://wiki.archlinux.org/index.php/Capabilities&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://man7.org/linux/man-pages/man7/capabilities.7.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setcap CAP_NET_BIND_SERVICE=+eip /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64/jre/bin/java&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*The important next step is required to get java to recognize these changes. I do not fully understand what this is (other than the symlink)&amp;lt;ref&amp;gt;https://techblog.jeppson.org/2017/12/make-java-run-privileged-ports-centos-7/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find / -name 'libjli.so' -exec /usr/bin/ln -s {} /usr/lib/ \; &amp;amp;&amp;amp; ldconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Michael.mast</name></author>
		
	</entry>
</feed>