Shadow file does not exist

Hi,

Another problem I’m having is that when I try to su to root i.e. ‘su - root’ it fails with the message as stated in subject.

How can I fix this ?

regards

  • Ingvaldur

Ingvaldur Sigurjonsson <ingvaldur.sigurjonsson@ementor.se> wrote:

Hi,

Another problem I’m having is that when I try to su to root i.e. ‘su - root’ it fails with the message as stated in subject.

Presumably you don’t have a password on your root account and you have
not created any other user accounts. You can create a dummy account
with passwd and give it a password entry and it will generate the
shadow file. Or you could just touch /etc/shadow and create it yourself,
but make sure the permissions are correct.

Thomas

Ingvaldur Sigurjonsson <ingvaldur.sigurjonsson@ementor.se> wrote:

Hi,

Another problem I’m having is that when I try to su to root i.e. ‘su - root’ it fails with the message as stated in subject.

How can I fix this ?

I’ve seen this before on a un-successful installed machine (power off
during installation).

Try to see if the /etc/shadow is “spilled”. (/var/pkg/spill/etc/.fspkg-spilled).

-xiaodan

Xiaodan Tang wrote:

Ingvaldur Sigurjonsson <> ingvaldur.sigurjonsson@ementor.se> > wrote:

Hi,


Another problem I’m having is that when I try to su to root i.e. ‘su - root’ it fails with the message as stated in subject.


How can I fix this ?


I’ve seen this before on a un-successful installed machine (power off
during installation).

Try to see if the /etc/shadow is “spilled”. (/var/pkg/spill/etc/.fspkg-spilled).

-xiaodan

Both the passwd and group file were spilled in
/var/pkg/spill/etc/.fspkg-spilled, so I restored them with ‘pkgctl -r
/etc/passwd’ etc.

But then the user I’d added was gone! and the group. So I save away the
old homedirectory for that user and tried to add the user again with
‘passwd username’.

But then I got an error like 'could not add password entry"!

I was running as root doing all this stuff.

What is the correct way adding a new user and a new group to QNX ?
When I installed QNX I did not enter a password for root, is that the
reason why I didnt get a ‘/etc/shadow’ file ?

regards

  • Ingvaldur

Ingvaldur Sigurjonsson <ingvaldur.sigurjonsson@ementor.se> wrote:

Both the passwd and group file were spilled in
/var/pkg/spill/etc/.fspkg-spilled, so I restored them with ‘pkgctl -r
/etc/passwd’ etc.

But then the user I’d added was gone! and the group. So I save away the
old homedirectory for that user and tried to add the user again with
‘passwd username’.

You really didn’t want to recover the spilled files =;-( It looks
to me like your system was doing just fine.

But then I got an error like 'could not add password entry"!

Yes because our password utility tries to create a hard link
across filesystem boundaries. You first have to forcibly cause
a spill on the file (copy it somewhere and then back on top
of itself), and then you can use the passwd utility.

What is the correct way adding a new user and a new group to QNX ?
When I installed QNX I did not enter a password for root, is that the
reason why I didnt get a ‘/etc/shadow’ file ?

Yes as I mentioned, if you don’t add any users will passwords then
there is no reason for the /etc/shadow file to exist. The su utility
will not run if the /etc/shadow file doesn’t exist. If you had
simply “touch /etc/shadow” as root then you would have been able
to su on your machine.

Thomas

Hi,

I got this working fine now by creating ‘opasswd’ + ‘oshadow’ (after having given root a password) and copying the opasswd → passwd and the same for oshadow.

But if you ask me, I think the error message was a little short! And that the passwd utility should not have any hidden implicit requisits for functioning (the shadow file must exist + other).

But because QNX looks so great, is fast and runs so greatly on my IBM Thinkpad @ 1600x1200-24bit’s depth, it doesn’t bother me :slight_smile:

Best regards and keep on with the good work!

  • Ingvaldur

Previously, Ingvaldur Sigurjonsson wrote in qdn.public.qnxrtp.newuser:

Xiaodan Tang wrote:

Ingvaldur Sigurjonsson <> ingvaldur.sigurjonsson@ementor.se> > wrote:

Hi,


Another problem I’m having is that when I try to su to root i.e. ‘su - root’ it fails with the message as stated in subject.


How can I fix this ?


I’ve seen this before on a un-successful installed machine (power off
during installation).

Try to see if the /etc/shadow is “spilled”. (/var/pkg/spill/etc/.fspkg-spilled).

-xiaodan

Both the passwd and group file were spilled in
/var/pkg/spill/etc/.fspkg-spilled, so I restored them with ‘pkgctl -r
/etc/passwd’ etc.

But then the user I’d added was gone! and the group. So I save away the
old homedirectory for that user and tried to add the user again with
‘passwd username’.

But then I got an error like 'could not add password entry"!

I was running as root doing all this stuff.

What is the correct way adding a new user and a new group to QNX ?
When I installed QNX I did not enter a password for root, is that the
reason why I didnt get a ‘/etc/shadow’ file ?

regards

  • Ingvaldur

Ingvaldur Sigurjonsson <ingvaldur.sigurjonsson@ementor.se> wrote:

Hi,

I got this working fine now by creating ‘opasswd’ + ‘oshadow’
(after having given root a password) and copying the
opasswd → passwd and the same for oshadow.

But if you ask me, I think the error message was a
little short! And that the passwd utility should not have
any hidden implicit requisits for functioning (the shadow file
must exist + other).

It wasn’t the passwd utility that needed shadow, it was su.

But because QNX looks so great, is fast and runs so greatly
on my IBM Thinkpad @ 1600x1200-24bit’s depth, it doesn’t
bother me > :slight_smile:

Glad to hear it.

Thanks,
Thomas