[comp.os.minix] passwd file

marc@skypod.uucp (Marc Fournier) (04/23/91)

Hi again,

	I'm a new Minix user and am having my problems getting it up and
running.  Mostly small problems that I do fix, but I've run across one
that I don't know:

	Why won't my passwd file keep any new accounts?  If I reboot, the
passwd file resets to the original values.  Is there anyway around this
or something I'm forgetting to do?  BTW, I'm still on floppy's.  Does
that make any difference?  We're looking at hard drive installation
by the weekend, so if that does make a difference, then hopefully the
problem goes away...right?

Oh well...thanks for any help, it is very appreciated.


-- 
| Marc G. Fournier   (416) 250-8589  |   Haven't thought of anything  |
| Toronto, Ontario                   |     real witty to say here!    | 
| uucp:  marc@skypod.uucp            ---------  And probably...       |
| Bitnet: marc%skypod@ugw.utcs.utoronto.ca   |          never will!   | 

jac@dobag.north.de (Joerg Conradt) (04/25/91)

marc@skypod.uucp (Marc Fournier) writes:

>Hi again,

>	I'm a new Minix user and am having my problems getting it up and
>running.  Mostly small problems that I do fix, but I've run across one
>that I don't know:

>	Why won't my passwd file keep any new accounts?  If I reboot, the
>passwd file resets to the original values.  Is there anyway around this
>or something I'm forgetting to do?  BTW, I'm still on floppy's.  Does
>that make any difference?  We're looking at hard drive installation
>by the weekend, so if that does make a difference, then hopefully the
>problem goes away...right?

>Oh well...thanks for any help, it is very appreciated.

hello Marc
oh yes, you do forget something!
if you boot minix, the root-disk is loaded in the ram (at least
atari-st version!) (that's all exapt of /usr !!!). If you now change
a password in the /etc/passwd file, you change it in the ram and
if you reboot, the ram will be booted from disk again! This means,
you'll have to copy the /etc/passwd-file from the ram to the root
disk. simply enter:
<login as root!>
/etc/umount /dev/dd0           # if this is your /usr-disk
<Change disk in floppy to the root-disk now!>
/etc/mount /dev/dd0 /tmp
/bin/cp /etc/passwd /tmp/etc/passwd   # be sure disk is not write protected
/etc/umount /dev/dd0
<put in the disk-drive the /usr-disk again>
/etc/mount /dev/dd0 /usr
<now go on working...>
If you reboot with the modified root-disk now, the new /etc/passwd-file
will be copied in the ram, and you have to enter the new password!
This works for any other file as well, of course! (e.g. /etc/group)
and needless to say: only root is allowed to do so!
Greeting Joerg
If any questions, contact me!

-- 
UUCP: jac@dobag.in-berlin.de  | - The number of viewers watching you is
Alias Joerg Conradt           |   proportional to the stupidity of your
1000 Berlin 41 Germany        |   action.
++ 0307958397                 | - "Murphy was an optimist"

grundy@rtf.bt.co.uk (Martin Grundy) (04/25/91)

In article <1991Apr23.030431.3481@skypod.uucp> marc@skypod.uucp (Marc Fournier) writes:
>Hi again,
>
>	I'm a new Minix user and am having my problems getting it up and
>running.  Mostly small problems that I do fix, but I've run across one
>that I don't know:
>
>	Why won't my passwd file keep any new accounts?  If I reboot, the
>passwd file resets to the original values.  Is there anyway around this
>or something I'm forgetting to do?  BTW, I'm still on floppy's.  Does
>that make any difference?  We're looking at hard drive installation
>by the weekend, so if that does make a difference, then hopefully the
>problem goes away...right?
>
>Oh well...thanks for any help, it is very appreciated.
>
>
>-- 
>| Marc G. Fournier   (416) 250-8589  |   Haven't thought of anything  |
>| Toronto, Ontario                   |     real witty to say here!    | 
>| uucp:  marc@skypod.uucp            ---------  And probably...       |
>| Bitnet: marc%skypod@ugw.utcs.utoronto.ca   |          never will!   | 

Hi there...

If you are running Minix from floppies, then most likely your root file-
system is on RAM disk. (After you type "=" while booting, does the
screen show "RAM disk >0 k" ?)

If this is so, then you have to update the "root" floppy in order to
keep *any* updated files, as you will lose any files on the RAM disk
when you re-boot.

To do this, mount the root floppy as /user, (make sure you have a good
copy first :-), then copy /etc/passwd to /user/etc/passwd.

The commands are: (log in as root first though).

	mount /dev/fd0 /user
	cp /etc/passwd /user/etc/passwd
	umount /dev/fd0

NB. replace fd0 with the correct device name for your floppy.

Hope this helps.

------------------------------------------------------------------
Martin Grundy                     |  email: grundy@rtf.bt.co.uk
British Telecom Customer Systems  |
Hyperion House                    |  phone: +44 273 762102
96-99 Queens Road                 |  fax:   +44 273 722038 or
Brighton BN1 3XF.                 |         +44 273 762071 (netfax)

protonen@daimi.aau.dk (Lars J|dal) (04/25/91)

marc@skypod.uucp (Marc Fournier) writes:
...
>	Why won't my passwd file keep any new accounts?  If I reboot, the
>passwd file resets to the original values.  Is there anyway around this
>or something I'm forgetting to do?  BTW, I'm still on floppy's.  Does
>that make any difference?  We're looking at hard drive installation
>by the weekend, so if that does make a difference, then hopefully the
>problem goes away...right?
...

Your problem is that the passwd file is kept on the RAM-disk. This is
because it has to be accessible (e.g. ls -l uses it to get the user names
from the uid), regardless what disks the user has mounted.
So, when you edit your passwd file it is only changed on the RAM-disk,
and when your reboot, the old passwd file is loaded from the root disk.
What you has to do is either:

1) Mount the disk with the root file system image (the root disk) to e.g.
   /user and edit the passwd file /user/etc/passwd
or
2) Edit your passwd file /etc/passwd on the RAM-disk, mount the root disk
   to /user and cp /etc/passwd /user/etc/passwd

Remember to type sync (or just log out), reboot, and voila! Your new
account has survived.
If still confused, E-mail me.

+--------------------------------------------------------------------------+
|      Lars J|dal       |       (put your favourite quotation here)        |
| protonen@daimi.aau.dk |                                                  |
|--------------------------------------------------------------------------|
| Computer Science Department  -  Aarhus University  -  Aarhus  -  Denmark |
+--------------------------------------------------------------------------+

S12187TJ@semassu.edu (04/26/91)

                                                           SMU, 25-APR-1991

    Sounds like you are only modifying the passwd that is on your ram disk.
 Mount the floppy (say in /user) and modify /user/etc/passwd.  

                                   Tom

HIGGINS@ge-dab.ge.com> (04/26/91)

>	Why won't my passwd file keep any new accounts?  If I reboot, the
>passwd file resets to the original values.  Is there anyway around this
>or something I'm forgetting to do?  BTW, I'm still on floppy's.  Does
>that make any difference?  We're looking at hard drive installation
>by the weekend, so if that does make a difference, then hopefully the
>problem goes away...right?

     The password file is normally loaded to the ramdisk, thus
any changes made to it need to be saved manually to the disk
you use to load the ramdisk...

                    Sean

peter@pa3ebv.nl.mugnet.org (Peter J. de Vrijer) (04/26/91)

In article <1991Apr23.030431.3481@skypod.uucp>, marc@skypod.uucp (Marc Fournier) wrote:
> 	Why won't my passwd file keep any new accounts?  If I reboot, the
> passwd file resets to the original values.  Is there anyway around this
> or something I'm forgetting to do?
Yes you are. At boot time the image of the root device is loaded from a
floppydisk (partition of harddisk) to /dev/ram. /dev/ram is then used as
root device. Any changes to the 'passwd' file will go into /dev/ram.
But if you reboot the old image is again loaded into /dev/ram.

Solution: After changing 'passwd' (or anything else in /dev/ram) put the
root disk in drive 0 and do
cp /dev/ram /dev/fd0
You then have a new root image when you reboot. 

> BTW, I'm still on floppy's.  Does that make any difference?
The same applies when you have the root image on a partition of your
harddisk. I think this is the case with PH 1.5 Minix.

Regards from Peter.

Peter J. de Vrijer           |  UUCP: peter@pa3ebv.nl.mugnet.org
Tel: +31 38 660735           |  packet radio: peter@pa3ebv.ampr.org 
Ministerlaan 9               |
8014 PL Zwolle               |  "And yet I'm happy,
The Netherlands              |   I can't figure it out."     Snoopy

waltje@uwalt.nl.mugnet.org (Fred 'The Rebel' van Kempen) (04/28/91)

marc@skypod.uucp (Marc Fournier) wrote:
> 
> 	Why won't my passwd file keep any new accounts?  If I reboot, the
> passwd file resets to the original values.  Is there anyway around this
> or something I'm forgetting to do?  BTW, I'm still on floppy's.  Does
> that make any difference?  We're looking at hard drive installation
> by the weekend, so if that does make a difference, then hopefully the
> problem goes away...right?

Wrong.  RTFM !!
Standard MINIX (gna... :-) uses a root file system in RAM by default.
This means, that most directories in / are actually RAM, not on disk.
So, when you add a new user to /etc/passwd, it will be gone after a
reboot, unless you copy the changed files to the RAM disk image
("Root File System" diskette, or /dev/hd3 partition on HD).

Fred.
--
MicroWalt Corporation, for MINIX Development	waltje@uwalt.nl.mugnet.org
Tel (+31) 252 230 205, Hoefbladhof  27, 2215 DV  VOORHOUT, The Netherlands
	"An Operating System is what the _USERS_ think of it- me"