RE: [suse-linux-uk-schools] addins users to groups....... 500+
I just keep coming back to newusers - from the man page: update and create new users in batch SYNOPSIS newusers [new_users] DESCRIPTION newusers reads a file of user name and cleartext password pairs and uses this information to update a group of existing users or to create new users. Each line is in the same format as the standard password file (see passwd(5)) with the following exceptions. -----Original Message----- From: Andrew Nix To: suse-linux-uk-schools@suse.com Sent: 8/8/03 9:57 AM Subject: Re: [suse-linux-uk-schools] addins users to groups....... 500+
On Friday 08 August 2003 09:23, Andrew Nix wrote:
Yes, I think that I am confusing the issue by a factor of X^Y. Unlike Debian's 'useradd', SuSE doesn't offer the same functionality. Therefore, still using the same command as you have been using, change "useradd" for "usermod" and then try it.
I changed the it to usermod. But I get the reply user Students doesnt exsist. Below is the exact command issued. Is there something wrong with it? Or is theresomething else i need to add to it?
for i in $(cat ./KS3_20023_PUPILS.csv | awk -F, '{print $1}'); do usermod $1 -G @Students; done
I also tried it with a text file and the command is this:
for i in $(cat ./Group\ Adding); do usermod $i -G Students; done
I get the same error message with the above code. However, it does work fine on SuSE8.2 if you use useradd instead of usermod :-)
for i in $(cat ./newusers); do useradd $i -G students; done
I use 8.2 and I agree it would work if the users werent already set up. But as they are it just tells me that they do exsist! Any other ideas?
Alastair
But each time I get the same response. Any idea anyone? Cheers
-- Andrew Nix
Chris, Totally agree, this 'should' be part of the shadow password utils. Peter. On Fri, 2003-08-08 at 10:03, Chris Puttick wrote:
I just keep coming back to newusers - from the man page:
update and create new users in batch
SYNOPSIS newusers [new_users]
DESCRIPTION newusers reads a file of user name and cleartext password pairs and uses this information to update a group of existing users or to create new users. Each line is in the same format as the standard password file (see passwd(5)) with the following exceptions.
-----Original Message----- From: Andrew Nix To: suse-linux-uk-schools@suse.com Sent: 8/8/03 9:57 AM Subject: Re: [suse-linux-uk-schools] addins users to groups....... 500+
On Friday 08 August 2003 09:23, Andrew Nix wrote:
Yes, I think that I am confusing the issue by a factor of X^Y. Unlike Debian's 'useradd', SuSE doesn't offer the same functionality. Therefore, still using the same command as you have been using, change "useradd" for "usermod" and then try it.
I changed the it to usermod. But I get the reply user Students doesnt exsist. Below is the exact command issued. Is there something wrong with it? Or is theresomething else i need to add to it?
for i in $(cat ./KS3_20023_PUPILS.csv | awk -F, '{print $1}'); do usermod $1 -G @Students; done
I also tried it with a text file and the command is this:
for i in $(cat ./Group\ Adding); do usermod $i -G Students; done
I get the same error message with the above code. However, it does work fine on SuSE8.2 if you use useradd instead of usermod :-)
for i in $(cat ./newusers); do useradd $i -G students; done
I use 8.2 and I agree it would work if the users werent already set up. But as they are it just tells me that they do exsist! Any other ideas?
Alastair
But each time I get the same response. Any idea anyone? Cheers
-- Andrew Nix
--- Chris Puttick <chris@centralmanclc.com> wrote:
I just keep coming back to newusers - from the man page:
update and create new users in batch
SYNOPSIS newusers [new_users]
DESCRIPTION newusers reads a file of user name and cleartext password pairs and uses this information to update a group of existing users or to create new users. Each line is in the same format as the standard password file (see passwd(5)) with the following exceptions.
Well, firstly this can be done with "expect", so I have no need for this. Not to mention the possible security implications that this command has (above). Of course, for added security I would do: mcrypt ./the_file and then when I come to use it do: cat ./the_file | mcrypt -d > ./use_this Secondly I wish SuSE would actually look to Debian as an example for the "adduser" program which does everything from adding users to updating them in one hit. Thus Andrew's problem of adding existing members to groups can easily be solved by: adduser $USER <groupname> Now, surely that is easier than faffing around with "usermod"? -- Thomas Adam ===== Thomas Adam "The Linux Weekend Mechanic" -- www.linuxgazette.com ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/
participants (3)
-
Chris Puttick
-
Peter Wilson
-
Thomas Adam