Artigos‎ > ‎Configuração de Hardware‎ > ‎OpenWrt‎ > ‎

Add Users


Primeiramente gostaria de salientar que não sou o autor principal do conteúdo deste artigo. A minha intenção é de mostrar o que outros autores tem realizado (referenciando links para o conteúdo original) neste blog até como um guia pessoal para uso próprio e ainda compartilhar minhas anotações e pequenas modificações que realizo no conteúdo, desejando que possa ajudar mais alguém em algum lugar.
First and foremost, I take no credit for any of this post’s content. I am really just taking what others have done (which I have links to bellow) and am putting it on my blog for a personal reference and hopefully the small changes that I made to their guides will help someone somewhere.


This will add user only for ssh access. There is no Luci multi-user yet.

Adding users to openwrt:

opkg update 
opkg install shadow-useradd
useradd aarvati
passwd aarvati

mkdir /home 
mkdir /home/aarvati
chown aarvati /home/aarvati

Indicate shell bellow:

vi /etc/passwd 
aarvati:x:1000:1000:aarvati:/home/nicolaus:/bin/ash

another way of creating user is just:
useradd -Um -d /mnt/data/home/aarvati/ -s /bin/ash -G sudo aarvati


Grant root access:
opkg install sudo

visudo

## Uncomment to allow any user to run sudo if they know the password 
## of the user they are running the command as (root by default). 
Defaults targetpw # Ask for the password of the target user 
ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'

In this configuration to get root access the user should enter ROOT PASSWORD

opkg install shadow-groupadd
groupadd --system sudo
opkg install shadow-usermod 
usermod -a -G sudo aarvati

visudo

## Uncomment to allow members of group sudo to execute any command 
%sudo ALL=(ALL) ALL

In this configuration to get root access the user should use his own password and must belong to sudo group.



Comments