OpenWrt Forum Archive

Topic: add new user

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

Hello,

I'd like to add a new user on my router.
I explain you the reasons.

I'd like from outside, to be able to connect to my routuer by ssh or to my desktop linux computer.

So I'd like to use user root, to directly connect to my router, and another user, so that in his home, I put in his .bashrc, a command ssh, which connect to the desktop linux computer with a system of keys, so I don't have to type the password :-)

In effect, I add the user in /etc/passwd, because there is no useradd command lol.

I changed the pasword for that user, with passwd user, it worked very well, but when I try to connect by ssh with that user, it failed even if I type the good password :-(.

What do you think of that?

Thanks.
bye

Give him a home directory, for instance :

guest:x:1002:100::/home/guest/:/bin/ash

Should work very well

Hello,

I put that:
thierry:xxxxxxx:0:0:thierry:/home/thierry:/bin/sh

I put /bin/bash , to use .bashrc in fact in the directory /home/thierry, that I have created:

root@OpenWrt:/# ls -al /home/thierry/
drwxr-xr-x    1 root     root            0 Jul 24 01:33 .

It's works, but with /bin/ash instead of /bin/sh.

So i'm asking if a ssh command in .bashrc will work :-(.

There is an equivalent of .bashrc in bash, to put my ssh command so it will be executed as soon as I will be loggued as thierry?


Thanks.

Bye

(Last edited by thierry_b on 24 Jul 2005, 03:07)

the user you created should own is home directory (and the files you put in there) :

# chown -R thierry /home/thierry

Yes of course.

I found that I have to create the .profile, in my home :-)

But it's strange, I forgot to do the chown and it worked lol...
Maybe I did that with the user root LOL.
That's the only explication possible lol.

root@OpenWrt:/home/thierry# ls -al
drwxr-xr-x    1 root     root            0 Jul 24 04:09 .
drwxr-xr-x    1 root     root            0 Jul 24 01:33 ..
-rw-r--r--    1 root     root           16 Jul 24 04:09 .profile
root@OpenWrt:/home/thierry#

But I manage to put what I want in .profile :-)

Thanks.

Bye

(Last edited by thierry_b on 24 Jul 2005, 09:12)

I've a problem when I log with thierry and my password I have thay:

login as: thierry
thierry@192.168.0.1's password:


BusyBox v1.00 (2005.07.18-21:49+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
WHITE RUSSIAN (RC2) -------------------------------
  * 2 oz Vodka   Mix the Vodka and Kahlua together
  * 1 oz Kahlua  over ice, then float the cream or
  * 1/2oz cream  milk on the top.
---------------------------------------------------
root@OpenWrt:/home/thierry#

root@OpenWrt:~# ls -l /home/thierry/
-rw-r--r--    1 1000     thierry      1051 Jul 24 16:32 ssh2.tar.gz
root@OpenWrt:~# chown -R thierry:thierry /home/thierry/
root@OpenWrt:~# ls -l /home/thierry/
-rw-r--r--    1 root     thierry      1051 Jul 24 16:32 ssh2.tar.gz

root@OpenWrt:/home/thierry# ls -l /home/thierry/
-rw-r--r--    1 root     thierry      1051 Jul 24 16:32 ssh2.tar.gz

SO the user is root and the group thierry.

I added a group in /etc/group:
root@OpenWrt:/home/thierry# cat /etc/group
root:x:0:
nogroup:x:65534:
thierry:x:1000:

But I'd like to have the user thierry and group thierry associated with the name "thierry".

This is the content of my passwd.
root@OpenWrt:/home/thierry# cat /etc/passwd
root:$x$$xxxxxxxxxxxxxxxxxxxxxxxxx:0:0:root:/tmp:/bin/ash
nobody:*:65534:65534:nobody:/var:/bin/false
thierry:$1$$xxxxxxxxxxxxxxxxxxxx:0:0::/home/thierry:/bin/ash

I can modify the line thierry, to have a real user thierry and a real group thierry, so that when I do chown -R thiery:thierry, I see thierry:thierry and not root:thierry?

If I try to put that in /etc/passwd:

thierry:$1$xxxxxxxxxxxxxxxxxxx:1000:1000::/home/thierry:/bin/ash

and I try to log on thierry, I have that:

login as: thierry
thierry@192.168.0.1's password:


BusyBox v1.00 (2005.07.18-21:49+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

You don't exist, go away!
/home/thierry $


Thanks.

(Last edited by thierry_b on 25 Jul 2005, 00:01)

The discussion might have continued from here.