All of lore.kernel.org
 help / color / mirror / Atom feed
* How to recreate or modify already existing usres in /etc/passwd in Yocto
@ 2013-10-23 17:44 Amit Tomer
  2013-10-26 17:15 ` Amit Tomer
  2013-10-27 16:16 ` Amit Tomer
  0 siblings, 2 replies; 8+ messages in thread
From: Amit Tomer @ 2013-10-23 17:44 UTC (permalink / raw)
  To: yocto, Hans Beckérus

I have a requirement where I have to modify the already existing users
in /etc/passwd file.
I have tried doing this with below method and changes are reflected to
rootfs/etc/passwd .
But when I code load my image to target board ,and login as root
,prompt ask for password(Didn't make any changes related to root user
in /etc/passwd).

Earlier with older image login as root doesn't ask for any password

Below is the method which I used to modify the /etc/passwd

SRC_URI += "file://passwd"

do_install_append() {
install -d ${D}${sysconfdir}/base-passwd ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/passwd ${D}${sysconfdir}/passwd
}

Content of origin/earlier file is

root:x:0:0:root:/home/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
fuwmshey:x:0:0::/user/fuwmshey:/bin/sh
frfhsjk:x:999:999::/home/frfhsjk:/bin/sh
ftp:x:998:998::/var/lib/ftp:/bin/sh
messagebus:x:997:996::/var/lib/dbus:/bin/sh
quagga:x:996:995::/var/run/quagga:/bin/sh
sshd:x:995:992::/var/run/sshd:/bin/sh

Above file we have downloaded from base-passwd_3.5.26.tar.gz and added
some new users like frfhsjk and quaqqa using USERADD_PARAM_${PN}.


Content of modified file


root:x:0:0:root:/home/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/flase
bin:x:2:2:bin:/bin:/bin/false
sys:x:3:3:sys:/dev:/bin/false
sync:x:4:65534:sync:/bin:/bin/flase
games:x:5:60:games:/usr/games:/bin/false
man:x:6:12:man:/var/cache/man:/bin/false
lp:x:7:7:lp:/var/spool/lpd:/bin/false
mail:x:8:8:mail:/var/mail:/bin/false
news:x:9:9:news:/var/spool/news:/bin/false
uucp:x:10:10:uucp:/var/spool/uucp:/bin/flase
proxy:x:13:13:proxy:/bin:/bin/false
www-data:x:33:33:www-data:/var/www:/bin/false
backup:x:34:34:backup:/var/backups:/bin/false
list:x:38:38:Mailing List Manager:/var/list:/bin/false
irc:x:39:39:ircd:/var/run/ircd:/bin/false
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/false
nobody:x:65534:65534:nobody:/nonexistent:/bin/false
fuwmshey:x:0:0::/user/fuwmshey:/bin/sh
frfhsjk:x:999:999::/home/frfhsjk:/bin/false
ftp:x:998:998::/var/lib/ftp:/bin/false
messagebus:x:997:996::/var/lib/dbus:/bin/false
quagga:x:996:995::/var/run/quagga:/bin/false
sshd:x:995:992::/var/run/sshd:/bin/false

We changed the command /bin/sh to /bin/false for every user except
root and tor4nsn.

I wanted to know what are ways to modify already existing members in /etc/passwd

Thanks ,
Amit


^ permalink raw reply	[flat|nested] 8+ messages in thread

* How to recreate or modify already existing usres in /etc/passwd in Yocto
  2013-10-23 17:44 How to recreate or modify already existing usres in /etc/passwd in Yocto Amit Tomer
@ 2013-10-26 17:15 ` Amit Tomer
  2013-10-28  8:48   ` Jukka Rissanen
  2013-10-27 16:16 ` Amit Tomer
  1 sibling, 1 reply; 8+ messages in thread
From: Amit Tomer @ 2013-10-26 17:15 UTC (permalink / raw)
  To: yocto

Running out of ideas

Can I get some fresh ideas for this issue

---------- Forwarded message ----------
From: Amit Tomer <amittomer25@gmail.com>
Date: Wed, Oct 23, 2013 at 11:14 PM
Subject: How to recreate or modify already existing usres in
/etc/passwd in Yocto
To: "yocto@yoctoproject.org" <yocto@yoctoproject.org>, Hans Beckérus
<hans.beckerus@gmail.com>


I have a requirement where I have to modify the already existing users
in /etc/passwd file.
I have tried doing this with below method and changes are reflected to
rootfs/etc/passwd .
But when I code load my image to target board ,and login as root
,prompt ask for password(Didn't make any changes related to root user
in /etc/passwd).

Earlier with older image login as root doesn't ask for any password

Below is the method which I used to modify the /etc/passwd

SRC_URI += "file://passwd"

do_install_append() {
install -d ${D}${sysconfdir}/base-passwd ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/passwd ${D}${sysconfdir}/passwd
}

Content of origin/earlier file is

root:x:0:0:root:/home/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
fuwmshey:x:0:0::/user/fuwmshey:/bin/sh
frfhsjk:x:999:999::/home/frfhsjk:/bin/sh
ftp:x:998:998::/var/lib/ftp:/bin/sh
messagebus:x:997:996::/var/lib/dbus:/bin/sh
quagga:x:996:995::/var/run/quagga:/bin/sh
sshd:x:995:992::/var/run/sshd:/bin/sh

Above file we have downloaded from base-passwd_3.5.26.tar.gz and added
some new users like frfhsjk and quaqqa using USERADD_PARAM_${PN}.


Content of modified file


root:x:0:0:root:/home/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/flase
bin:x:2:2:bin:/bin:/bin/false
sys:x:3:3:sys:/dev:/bin/false
sync:x:4:65534:sync:/bin:/bin/flase
games:x:5:60:games:/usr/games:/bin/false
man:x:6:12:man:/var/cache/man:/bin/false
lp:x:7:7:lp:/var/spool/lpd:/bin/false
mail:x:8:8:mail:/var/mail:/bin/false
news:x:9:9:news:/var/spool/news:/bin/false
uucp:x:10:10:uucp:/var/spool/uucp:/bin/flase
proxy:x:13:13:proxy:/bin:/bin/false
www-data:x:33:33:www-data:/var/www:/bin/false
backup:x:34:34:backup:/var/backups:/bin/false
list:x:38:38:Mailing List Manager:/var/list:/bin/false
irc:x:39:39:ircd:/var/run/ircd:/bin/false
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/false
nobody:x:65534:65534:nobody:/nonexistent:/bin/false
fuwmshey:x:0:0::/user/fuwmshey:/bin/sh
frfhsjk:x:999:999::/home/frfhsjk:/bin/false
ftp:x:998:998::/var/lib/ftp:/bin/false
messagebus:x:997:996::/var/lib/dbus:/bin/false
quagga:x:996:995::/var/run/quagga:/bin/false
sshd:x:995:992::/var/run/sshd:/bin/false

We changed the command /bin/sh to /bin/false for every user except
root and tor4nsn.

I wanted to know what are ways to modify already existing members in /etc/passwd

Thanks ,
Amit


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to recreate or modify already existing usres in /etc/passwd in Yocto
  2013-10-23 17:44 How to recreate or modify already existing usres in /etc/passwd in Yocto Amit Tomer
  2013-10-26 17:15 ` Amit Tomer
@ 2013-10-27 16:16 ` Amit Tomer
  1 sibling, 0 replies; 8+ messages in thread
From: Amit Tomer @ 2013-10-27 16:16 UTC (permalink / raw)
  To: yocto

We have fixed this issue by patching the passwd.master file .
So ,if someone wanted to modify the alreay existing usres in /etc/paswd file
one way is to patch the master file rather than pathcing passwd file.

Thanks
Amit.

On Wed, Oct 23, 2013 at 11:14 PM, Amit Tomer <amittomer25@gmail.com> wrote:
> I have a requirement where I have to modify the already existing users
> in /etc/passwd file.
> I have tried doing this with below method and changes are reflected to
> rootfs/etc/passwd .
> But when I code load my image to target board ,and login as root
> ,prompt ask for password(Didn't make any changes related to root user
> in /etc/passwd).
>
> Earlier with older image login as root doesn't ask for any password
>
> Below is the method which I used to modify the /etc/passwd
>
> SRC_URI += "file://passwd"
>
> do_install_append() {
> install -d ${D}${sysconfdir}/base-passwd ${D}${sysconfdir}
> install -m 0644 ${WORKDIR}/passwd ${D}${sysconfdir}/passwd
> }
>
> Content of origin/earlier file is
>
> root:x:0:0:root:/home/root:/bin/sh
> daemon:x:1:1:daemon:/usr/sbin:/bin/sh
> bin:x:2:2:bin:/bin:/bin/sh
> sys:x:3:3:sys:/dev:/bin/sh
> sync:x:4:65534:sync:/bin:/bin/sync
> games:x:5:60:games:/usr/games:/bin/sh
> man:x:6:12:man:/var/cache/man:/bin/sh
> lp:x:7:7:lp:/var/spool/lpd:/bin/sh
> mail:x:8:8:mail:/var/mail:/bin/sh
> news:x:9:9:news:/var/spool/news:/bin/sh
> uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
> proxy:x:13:13:proxy:/bin:/bin/sh
> www-data:x:33:33:www-data:/var/www:/bin/sh
> backup:x:34:34:backup:/var/backups:/bin/sh
> list:x:38:38:Mailing List Manager:/var/list:/bin/sh
> irc:x:39:39:ircd:/var/run/ircd:/bin/sh
> gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
> nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
> fuwmshey:x:0:0::/user/fuwmshey:/bin/sh
> frfhsjk:x:999:999::/home/frfhsjk:/bin/sh
> ftp:x:998:998::/var/lib/ftp:/bin/sh
> messagebus:x:997:996::/var/lib/dbus:/bin/sh
> quagga:x:996:995::/var/run/quagga:/bin/sh
> sshd:x:995:992::/var/run/sshd:/bin/sh
>
> Above file we have downloaded from base-passwd_3.5.26.tar.gz and added
> some new users like frfhsjk and quaqqa using USERADD_PARAM_${PN}.
>
>
> Content of modified file
>
>
> root:x:0:0:root:/home/root:/bin/sh
> daemon:x:1:1:daemon:/usr/sbin:/bin/flase
> bin:x:2:2:bin:/bin:/bin/false
> sys:x:3:3:sys:/dev:/bin/false
> sync:x:4:65534:sync:/bin:/bin/flase
> games:x:5:60:games:/usr/games:/bin/false
> man:x:6:12:man:/var/cache/man:/bin/false
> lp:x:7:7:lp:/var/spool/lpd:/bin/false
> mail:x:8:8:mail:/var/mail:/bin/false
> news:x:9:9:news:/var/spool/news:/bin/false
> uucp:x:10:10:uucp:/var/spool/uucp:/bin/flase
> proxy:x:13:13:proxy:/bin:/bin/false
> www-data:x:33:33:www-data:/var/www:/bin/false
> backup:x:34:34:backup:/var/backups:/bin/false
> list:x:38:38:Mailing List Manager:/var/list:/bin/false
> irc:x:39:39:ircd:/var/run/ircd:/bin/false
> gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/false
> nobody:x:65534:65534:nobody:/nonexistent:/bin/false
> fuwmshey:x:0:0::/user/fuwmshey:/bin/sh
> frfhsjk:x:999:999::/home/frfhsjk:/bin/false
> ftp:x:998:998::/var/lib/ftp:/bin/false
> messagebus:x:997:996::/var/lib/dbus:/bin/false
> quagga:x:996:995::/var/run/quagga:/bin/false
> sshd:x:995:992::/var/run/sshd:/bin/false
>
> We changed the command /bin/sh to /bin/false for every user except
> root and tor4nsn.
>
> I wanted to know what are ways to modify already existing members in /etc/passwd
>
> Thanks ,
> Amit


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to recreate or modify already existing usres in /etc/passwd in Yocto
  2013-10-26 17:15 ` Amit Tomer
@ 2013-10-28  8:48   ` Jukka Rissanen
  2013-10-28 10:07     ` Amit Tomer
  0 siblings, 1 reply; 8+ messages in thread
From: Jukka Rissanen @ 2013-10-28  8:48 UTC (permalink / raw)
  To: Amit Tomer; +Cc: yocto

On 26.10.2013 20:15, Amit Tomer wrote:
> Running out of ideas
>
> Can I get some fresh ideas for this issue
>

I am using this in my distro conf file 
(http://git.yoctoproject.org/cgit/cgit.cgi/meta-eca/tree/meta-eca/conf/distro/eca.conf) 
to change the root default password

INHERIT += "extrausers"
EXTRA_USERS_PARAMS = "usermod -p 'enrcrypted-password' root;"

So if you want to change the shell of a user, the command could look 
something like EXTRA_USERS_PARAMS="usermod -s /bin/false foobar;"

-- 
Cheers,
Jukka


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to recreate or modify already existing usres in /etc/passwd in Yocto
  2013-10-28  8:48   ` Jukka Rissanen
@ 2013-10-28 10:07     ` Amit Tomer
  2013-10-28 10:11       ` Jukka Rissanen
  0 siblings, 1 reply; 8+ messages in thread
From: Amit Tomer @ 2013-10-28 10:07 UTC (permalink / raw)
  To: Jukka Rissanen; +Cc: yocto

Thanks Jukka for the response

EXTRA_USERS_PARAMS="usermod -s /bin/false foobar;" where did you
define user(Is  foobar is usre here??).

Thanks,
Amit.

On Mon, Oct 28, 2013 at 2:18 PM, Jukka Rissanen
<jukka.rissanen@linux.intel.com> wrote:
> On 26.10.2013 20:15, Amit Tomer wrote:
>>
>> Running out of ideas
>>
>> Can I get some fresh ideas for this issue
>>
>
> I am using this in my distro conf file
> (http://git.yoctoproject.org/cgit/cgit.cgi/meta-eca/tree/meta-eca/conf/distro/eca.conf)
> to change the root default password
>
> INHERIT += "extrausers"
> EXTRA_USERS_PARAMS = "usermod -p 'enrcrypted-password' root;"
>
> So if you want to change the shell of a user, the command could look
> something like EXTRA_USERS_PARAMS="usermod -s /bin/false foobar;"
>
> --
> Cheers,
> Jukka


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to recreate or modify already existing usres in /etc/passwd in Yocto
  2013-10-28 10:07     ` Amit Tomer
@ 2013-10-28 10:11       ` Jukka Rissanen
  2013-10-28 10:41         ` Amit Tomer
  0 siblings, 1 reply; 8+ messages in thread
From: Jukka Rissanen @ 2013-10-28 10:11 UTC (permalink / raw)
  To: Amit Tomer; +Cc: yocto

On 28.10.2013 12:07, Amit Tomer wrote:
> Thanks Jukka for the response
>
> EXTRA_USERS_PARAMS="usermod -s /bin/false foobar;" where did you
> define user(Is  foobar is usre here??).

Yes, foobar is the username in this example. See manual page of usermod 
for details.


-- 
Cheers,
Jukka


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to recreate or modify already existing usres in /etc/passwd in Yocto
  2013-10-28 10:11       ` Jukka Rissanen
@ 2013-10-28 10:41         ` Amit Tomer
  2013-10-28 11:47           ` Amit Tomer
  0 siblings, 1 reply; 8+ messages in thread
From: Amit Tomer @ 2013-10-28 10:41 UTC (permalink / raw)
  To: Jukka Rissanen; +Cc: yocto

Fine Jukka ,I got your point.

The way we changed shell of a user of the /etc/passwd fie is by
patching the passwd.master file(orignator of /etc/passwd).

How Do you review this method of modifying  shell of a user?

Thanks
Amit

On Mon, Oct 28, 2013 at 3:41 PM, Jukka Rissanen
<jukka.rissanen@linux.intel.com> wrote:
> On 28.10.2013 12:07, Amit Tomer wrote:
>>
>> Thanks Jukka for the response
>>
>> EXTRA_USERS_PARAMS="usermod -s /bin/false foobar;" where did you
>> define user(Is  foobar is usre here??).
>
>
> Yes, foobar is the username in this example. See manual page of usermod for
> details.
>
>
> --
> Cheers,
> Jukka


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to recreate or modify already existing usres in /etc/passwd in Yocto
  2013-10-28 10:41         ` Amit Tomer
@ 2013-10-28 11:47           ` Amit Tomer
  0 siblings, 0 replies; 8+ messages in thread
From: Amit Tomer @ 2013-10-28 11:47 UTC (permalink / raw)
  To: Jukka Rissanen; +Cc: yocto

Jukaa I trying adding these lines in to my .conf file
But getting below error while bitbake

 Unable to parse extrausers: ParseError in configuration INHERITs:
Could not inherit file classes/extrausers.bbclass

Thanks

On Mon, Oct 28, 2013 at 4:11 PM, Amit Tomer <amittomer25@gmail.com> wrote:
> Fine Jukka ,I got your point.
>
> The way we changed shell of a user of the /etc/passwd fie is by
> patching the passwd.master file(orignator of /etc/passwd).
>
> How Do you review this method of modifying  shell of a user?
>
> Thanks
> Amit
>
> On Mon, Oct 28, 2013 at 3:41 PM, Jukka Rissanen
> <jukka.rissanen@linux.intel.com> wrote:
>> On 28.10.2013 12:07, Amit Tomer wrote:
>>>
>>> Thanks Jukka for the response
>>>
>>> EXTRA_USERS_PARAMS="usermod -s /bin/false foobar;" where did you
>>> define user(Is  foobar is usre here??).
>>
>>
>> Yes, foobar is the username in this example. See manual page of usermod for
>> details.
>>
>>
>> --
>> Cheers,
>> Jukka


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-10-28 11:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-23 17:44 How to recreate or modify already existing usres in /etc/passwd in Yocto Amit Tomer
2013-10-26 17:15 ` Amit Tomer
2013-10-28  8:48   ` Jukka Rissanen
2013-10-28 10:07     ` Amit Tomer
2013-10-28 10:11       ` Jukka Rissanen
2013-10-28 10:41         ` Amit Tomer
2013-10-28 11:47           ` Amit Tomer
2013-10-27 16:16 ` Amit Tomer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.