From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,f0e73e6c57c7eb58 X-Google-Attributes: gidfee84,public From: dunnett@mala.bc.ca (Malcolm Dunnett) Subject: Re: Setting password from a shell script possible? Date: 1995/12/21 Message-ID: <1995Dec21.204610@malad2.mala.bc.ca>#1/1 X-Deja-AN: 122585056 references: <1995Dec19.160036@malad2.mala.bc.ca> <95355.204430JONQC@CUNYVM.CUNY.EDU> organization: Malaspina University-College newsgroups: comp.unix.osf.osf1 In article <95355.204430JONQC@CUNYVM.CUNY.EDU>, writes: > > We had the same problem. At the beginning of every semester, we need to > put up bulk accounts for new students. The answer to your problems is > the 'expect' program that is mentioned in the OSF FAQ; 'expect' can > "talk" to 'passwd'. > Thanks for the suggestion. One other person also suggested using expect. I decided to write a program that takes the cleartext password as a command argument and outputs the encryted password. I modified adduser to feed this into an environment variable and then "echo" the password into the /etc/passwd file along with all the other information. I haven't put everything together yet, but this approach seems to work quite well ( if there's a flaw in this method I'd sure appreciate someone pointing it out ). -- ============================================================================= Malcolm Dunnett Malaspina University-College Email: dunnett@mala.bc.ca Computer Services Nanaimo, B.C. CANADA V9R 5S5 Tel: (604)755-8738