--- mkpasswd.pl 2005/08/24 19:43:28 1.11 +++ mkpasswd.pl 2005/08/25 20:49:32 1.15 @@ -6,7 +6,7 @@ # ZEPTOOS:zepto-info # # ZEPTOOS:zepto-fillin -# $Id: mkpasswd.pl,v 1.11 2005/08/24 19:43:28 kazutomo Exp $ +# $Id: mkpasswd.pl,v 1.15 2005/08/25 20:49:32 kazutomo Exp $ # ZeptoOS_Version: DEVELOPMENT-PRERELEASE # ZeptoOS_Heredity: FOSS_ORIG # ZeptoOS_License: GPL @@ -41,11 +41,10 @@ my $word; PASSENTRY: -print "Please enter temporary password for users on ramdisk\n"; +print "Please enter password for ramdisk.\n"; # root and $username system "stty -echo"; -print "Password:"; - +print "New password:"; chomp($word = ); if( length($word) < 6 ) { @@ -53,6 +52,18 @@ printf "\npasswd is too short!\n\n"; goto PASSENTRY; } +print "\n"; +system "stty -echo"; +print "Retype new password:"; +my $word2; +chomp($word2 = ); +system "stty echo"; + +if( $word != $word2 ) { + print "\nsorry. password does not match.\n"; + goto PASSENTRY; +} + my $salt = join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64] ; @@ -67,6 +78,7 @@ print FH "root:${passwd}:0:0:root:/:/bin/sh\n"; print FH "${username}:${passwd}:${UID}:100:${username}:/:/bin/sh\n"; +print FH "rpcuser:*:29:29:RPC Service User:/var/lib/nfs:\n"; print FH "sshd:*:74:74:Privilege-separated SSH:/var/empty/sshd:/bin/sh\n"; print FH "nobody:*:99:99:Nobody:/:\n"; @@ -76,33 +88,5 @@ chomp($pwd); print "\n${pwd}/${passwdfn} has been created.\n"; - -my $groupfn = "ramdisk-group"; - -open(FH, ">${groupfn}") or die "Unable to open ${groupfn}"; - -print FH "root:*:0:root\n"; -print FH "bin:*:1:bin\n"; -print FH "daemon:*:2:daemon\n"; -print FH "sys:*:3:sys\n"; -print FH "adm:*:4:adm\n"; -print FH "tty:*:5:\n"; -print FH "disk:*:6:\n"; -print FH "sync:*:8:sync\n"; -print FH "shutdown:*:9:shutdown\n"; -print FH "halt:*:10:halt\n"; -print FH "mail:*:11:mail\n"; -print FH "ftp:*:14:ftp\n"; -print FH "kmem:*:15:\n"; -print FH "utmp:*:16:\n"; -print FH "shadow:*:17:\n"; -print FH "sshd:*:74:\n"; -print FH "users:*:100:\n"; -print FH "nogroup:*:65534:\n"; - -close(FH); - -print "${pwd}/${groupfn} has been created.\n\n"; - - exit 0; +