Discussion:
[Ltib] adduser through startup script
Rick Hunnicutt
2014-02-20 20:13:11 UTC
Permalink
Hello all:

I want to add a user that is available on the target system. I understand this has to be done through a startup script but I'm not able to get it to work. I best option I have found is:

    printf "password123\npassword123\n" | adduser myuser

The user gets added (in /etc/passwd and /etc/shadow) but the password is not accepted. The out is:

Changing password for myuser
New password:
Retype password:
passwd: password for myuser is unchanged

I have read that adduser may use /dev/tty instead of stdin? I'd appreciate any help in getting this to work.

Thanks,

Rick H
Stuart Hughes
2014-02-21 08:55:47 UTC
Permalink
Hi Rick,

It would probably be better to override the /etc/passwd and /etc/shadow
by placing copies with your pre-defined user/password in
config/platform/_your_platform_/merge/etc/....

The simplest way to do this is to get it working on your target then
copy the files from the target into the merge directory.

Regards, Stuart
Post by Rick Hunnicutt
I want to add a user that is available on the target system. I
understand this has to be done through a startup script but I'm not
printf "password123\npassword123\n" | adduser myuser
The user gets added (in /etc/passwd and /etc/shadow) but the password
Changing password for myuser
passwd: password for myuser is unchanged
I have read that adduser may use /dev/tty instead of stdin? I'd
appreciate any help in getting this to work.
Thanks,
Rick H
_______________________________________________
LTIB home page: http://ltib.org
Ltib mailing list
https://lists.nongnu.org/mailman/listinfo/ltib
Rick Hunnicutt
2014-02-21 19:36:53 UTC
Permalink
Thank you Stuart, great idea!





On Friday, February 21, 2014 12:57 AM, Stuart Hughes <***@zee2.com> wrote:

Hi Rick,

It would probably be better to override the /etc/passwd and
/etc/shadow by placing copies with your pre-defined user/password
in config/platform/_your_platform_/merge/etc/....

The simplest way to do this is to get it working on your target
then copy the files from the target into the merge directory.

Regards, Stuart
Post by Rick Hunnicutt
I want to add a user that is available on the target system. I
understand this has to be done through a startup script but I'm
Post by Rick Hunnicutt
    printf "password123\npassword123\n" | adduser myuser
The user gets added (in /etc/passwd and /etc/shadow) but the
Changing password for myuser
passwd: password for myuser is unchanged
I have read that adduser may use /dev/tty instead of stdin? I'd
appreciate any help in getting this to work.
Post by Rick Hunnicutt
Thanks,
Rick H
_______________________________________________
LTIB home page: http://ltib.org Ltib mailing list ***@nongnu.org https://lists.nongnu.org/mailman/listinfo/ltib
Loading...