OpenWrt Forum Archive

Topic: How to Add a user

The content of this topic has been archived on 16 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have an asus wlg500 and use openwrt. Now i have installed sftp and i want to have another user like root. How can  I do that? Add another user in passwd, doesn't work. Is it possible to install a programm adduser? Then yes. How?

edit /etc/passwd and an a similar line as the one you can find for root

And if you *really* need adduser/deluser programs (for example, if it's *really* used by some program), you have to rebuild your OpenWRT (only busybox binary really) to support it, and upload it to the router.

The lack of adduser was intentional, adding end users to a router is a security risk. OpenWrt was never designed to be a multiuser system, only administrators should be logging into the system.

Sorry for bringing up something so old.

Having regular users might be a security risk, but running daemons as root is also a security risk.

Several packages do create users/groups so they can run with limited privileges but these, like many of the low id accounts on any *nix system are not intended to be used for connecting up to the machine and as such have an invalid value in the password field of /etc/passwd.

There is nothing stopping you from turning OpenWrt into a multiuser system but it is left up to the user to handle this.

Oconnor wrote:

I have an asus wlg500 and use openwrt. Now i have installed sftp and i want to have another user like root. How can  I do that? Add another user in passwd, doesn't work. Is it possible to install a programm adduser? Then yes. How?

now we can use shadow-useradd  package

I need this too for adding a 'vagrant' user to create a Vagrant box for testing. Just tell us how to add a user. If I just copy the line in /etc/passwd, how do I set the password? There is no 'chpasswd' either. Even if I edit /etc/shadow, how do I generate a hash? 'opkg find shadow' finds nothing either.

@starrychloe

useradd -m vagrant

then

passwd vagrant

nitroshift

The discussion might have continued from here.