<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[FAQ: How can a create another OnionOS user instead of root]]></title><description><![CDATA[<p dir="auto">While OpenWrt is a single user system, you can create additional users so you don't have to disclose the root user password. You can add the user by editing /etc/passwd and /etc/shadow or you can install the useradd package:</p>
<pre><code>opkg install shadow-useradd
</code></pre>
<p dir="auto">Now add a new user named "admin", but we don't want them to have shell access:</p>
<pre><code>useradd admin -d /var -M -s /bin/false -p mytemporarypassword
</code></pre>
<p dir="auto">The password is added in cleartext so you need to change it using the command:</p>
<pre><code>passwd admin
</code></pre>
<p dir="auto">Follow the prompts to set your password then you can confirm the new user has been added as required:</p>
<pre><code>cat /etc/passwd
cat /etc/shadow
</code></pre>
<p dir="auto">Since OnionOS uses ubus via rpc we need to add the user to the rpc user list. The configuration file is /etc/config/rcpd, but you can use uci commands to add the user:</p>
<pre><code>uci add rpcd login
uci set rpcd.@login[-1].username='admin'
uci set rpcd.@login[-1].password='$p$admin'
uci add_list rpcd.@login[-1].read='*'
uci add_list rpcd.@login[-1].write='*'
uci commit rpcd
</code></pre>
<p dir="auto">The username must match the username we just created and the structure of the password field causes the rpc daemon to use the system password we just created.</p>
<p dir="auto">The "read"  and "write" fields is set to an asterisk indicating that the user will have unrestricted access, the same as the root user.</p>
<p dir="auto">You can confirm the new user had been added using a uci command:</p>
<pre><code>uci show rpcd

rpcd.@login[0]=login
rpcd.@login[0].username='root'
rpcd.@login[0].password='$p$root'
rpcd.@login[0].read='*'
rpcd.@login[0].write='*'
rpcd.@login[1]=login
rpcd.@login[1].username='admin'
rpcd.@login[1].password='$p$admin'
rpcd.@login[1].read='*'
rpcd.@login[1].write='*'

</code></pre>
<p dir="auto">Now restart the rpc daemon:</p>
<pre><code>service rpcd restart
</code></pre>
<p dir="auto">You can now login to OnionOS with the same functionality as the root user has, but the user has no console access.</p>
]]></description><link>http://community.onion.io/topic/5086/faq-how-can-a-create-another-onionos-user-instead-of-root</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Jul 2026 19:06:06 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/5086.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Oct 2024 12:54:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to FAQ: How can a create another OnionOS user instead of root on Sat, 19 Oct 2024 13:51:09 GMT]]></title><description><![CDATA[<p dir="auto">While OpenWrt is a single user system, you can create additional users so you don't have to disclose the root user password. You can add the user by editing /etc/passwd and /etc/shadow or you can install the useradd package:</p>
<pre><code>opkg install shadow-useradd
</code></pre>
<p dir="auto">Now add a new user named "admin", but we don't want them to have shell access:</p>
<pre><code>useradd admin -d /var -M -s /bin/false -p mytemporarypassword
</code></pre>
<p dir="auto">The password is added in cleartext so you need to change it using the command:</p>
<pre><code>passwd admin
</code></pre>
<p dir="auto">Follow the prompts to set your password then you can confirm the new user has been added as required:</p>
<pre><code>cat /etc/passwd
cat /etc/shadow
</code></pre>
<p dir="auto">Since OnionOS uses ubus via rpc we need to add the user to the rpc user list. The configuration file is /etc/config/rcpd, but you can use uci commands to add the user:</p>
<pre><code>uci add rpcd login
uci set rpcd.@login[-1].username='admin'
uci set rpcd.@login[-1].password='$p$admin'
uci add_list rpcd.@login[-1].read='*'
uci add_list rpcd.@login[-1].write='*'
uci commit rpcd
</code></pre>
<p dir="auto">The username must match the username we just created and the structure of the password field causes the rpc daemon to use the system password we just created.</p>
<p dir="auto">The "read"  and "write" fields is set to an asterisk indicating that the user will have unrestricted access, the same as the root user.</p>
<p dir="auto">You can confirm the new user had been added using a uci command:</p>
<pre><code>uci show rpcd

rpcd.@login[0]=login
rpcd.@login[0].username='root'
rpcd.@login[0].password='$p$root'
rpcd.@login[0].read='*'
rpcd.@login[0].write='*'
rpcd.@login[1]=login
rpcd.@login[1].username='admin'
rpcd.@login[1].password='$p$admin'
rpcd.@login[1].read='*'
rpcd.@login[1].write='*'

</code></pre>
<p dir="auto">Now restart the rpc daemon:</p>
<pre><code>service rpcd restart
</code></pre>
<p dir="auto">You can now login to OnionOS with the same functionality as the root user has, but the user has no console access.</p>
]]></description><link>http://community.onion.io/post/26126</link><guid isPermaLink="true">http://community.onion.io/post/26126</guid><dc:creator><![CDATA[crispyoz]]></dc:creator><pubDate>Sat, 19 Oct 2024 13:51:09 GMT</pubDate></item></channel></rss>