I am trying to read in a list of users from a file and automatically create users from that. Here is what I thought would work: #!/bin/sh cat /mnt/PDC1-UsrSync/user.diff | while read Foo; do useradd $Foo; done Contents of the user.diff file: dccut dclam dcprep dcshp But here is what I get when I run the script:> sh test.sh useradd: invalid user name `dccut ' useradd: invalid user name`dclam ' useradd: invalid user name `dcprep ' useradd: invalid user name `dcshp ' Any ideas? Thanks, AE
> sh test.sh useradd: invalid user name `dccut ' useradd: invalid user name`dclam ' useradd: invalid user name `dcprep ' useradd: invalid user name `dcshp ' ^^^^^^^^^^^^^^^^^^^^^^^^ Revised, this is command runs in the terminal:> sh test.sh'seradd: invalid user name `dccut 'seradd: invalid user name `dclam 'seradd: invalid user name `dcprep 'seradd: invalid user name `dcshp -----Original Message----- From: Adam Ellis [mailto:AdamE@AccelGrp.com] Sent: Monday, October 22, 2001 3:35 PM To: 'samba@lists.samba.org' Subject: Add User Script I am trying to read in a list of users from a file and automatically create users from that. Here is what I thought would work: #!/bin/sh cat /mnt/PDC1-UsrSync/user.diff | while read Foo; do useradd $Foo; done Contents of the user.diff file: dccut dclam dcprep dcshp But here is what I get when I run the script:> sh test.sh useradd: invalid user name `dccut ' useradd: invalid user name`dclam ' useradd: invalid user name `dcprep ' useradd: invalid user name `dcshp ' Any ideas? Thanks, AE -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
PERFECT! That works like a charm. Thanks Les. -----Original Message----- From: Les Gondor [mailto:les@gandalfgraphics.com] Sent: Monday, October 22, 2001 4:22 PM To: Adam Ellis Subject: RE: Add User Script Check for the presence of a ^M at the end of each line in /mnt/PDC1-UsrSync/user.diff. Text files written by DOS and Windows applications have CRLF line terminators, while UNIX-derived systems require only LF, thus the extraneous ^M. Or just try the following as a quick fix: tr -d '\015' </mnt/PDC1-UsrSync/user.diff | while read Foo; do useradd $Foo; done>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<On 22/10/01, 04:08:17 PM, Adam Ellis <AdamE@AccelGrp.com> wrote regarding RE: Add User Script:> > sh test.sh useradd: invalid user name `dccut ' useradd: invalid username> `dclam ' useradd: invalid user name `dcprep ' useradd: invalid user name > `dcshp ' > ^^^^^^^^^^^^^^^^^^^^^^^^> Revised, this is command runs in the terminal:> > sh test.sh > 'seradd: invalid user name `dccut > 'seradd: invalid user name `dclam > 'seradd: invalid user name `dcprep > 'seradd: invalid user name `dcshp> -----Original Message----- > From: Adam Ellis [mailto:AdamE@AccelGrp.com] > Sent: Monday, October 22, 2001 3:35 PM > To: 'samba@lists.samba.org' > Subject: Add User Script> I am trying to read in a list of users from a file and automaticallycreate> users from that. Here is what I thought would work:> #!/bin/sh > cat /mnt/PDC1-UsrSync/user.diff | while read Foo; do useradd $Foo; done> Contents of the user.diff file:> dccut > dclam > dcprep > dcshp> But here is what I get when I run the script:> > sh test.sh useradd: invalid user name `dccut ' useradd: invalid username> `dclam ' useradd: invalid user name `dcprep ' useradd: invalid user name > `dcshp '> Any ideas? Thanks,> AE> -- > To unsubscribe from this list go to the following URL and read the > instructions: http://lists.samba.org/mailman/listinfo/samba> -- > To unsubscribe from this list go to the following URL and read the > instructions: http://lists.samba.org/mailman/listinfo/samba
Hi, I've been trying to get the add user script to work without any luck when I noticed that it needs security = server or domain. Talk about not seeing what you're looking at ... Sigh. So my question is: Up until now all of my clients are using Win 98. I just picked up a couple of clients with Win2K and WinXP workstations. I would like to keep all my systems as similar as possible. If I went through and changed all the Samba servers to security = server, would that break things for the Win98 people? There are no NT servers in the mix. Thanks -- Bob Crandell Assured Computing When you need to be sure. Voice 541-689-9159 FAX 240-371-7237 bob@assuredcomp.com www.assuredcomp.com Eugene, Or. 97402
Hello, Trying to get an rh9 box running samba 2.2.7 to act as a pdc. I've got an issue with my add user script to add machine accounts to the domain. Here is what that parameter looks like: add user script=/usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u the problem is %u is not expanding to the name of the machine being added, if i run the script manually and substitute the MachineName$ of the joining machine that works, after a restart of smb, however if i just try to join the domain, i get an error that the domain can not be found or contacted. Also, the unix password sync parameters are not working, i used smbpasswd to add a samba user, one that also has a unix account, and gave said user a different password, such changes were not reflected on the Unix side. The parameters i used are right out of the default rh9 smb.conf file. Any ideas? Thanks. Dave. ________________________________________________________________ Sign Up for Juno Platinum Internet Access Today Only $9.95 per month! Visit www.juno.com
Hi all- OK, I've been pulling my hair out for a while on this. I've got a server running RH9 and Samba-3.0.0RC1 (installed via rpm) set up as a PDC. There seems to be a problem setting up machine accounts on the fly. I've got the basic: add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u in my smb.conf but every time I try to join a computer to the domain, I get the error: The following error occurred attempting to join the domain "<domain>": The user name could not be found. All the logs show that everything is fine with the authentication, and I know that if I add the machine account manually, I've got no problem joining the domain. With 50-100 computers, manually adding the machine accounts is not really a viable option. Has anyone else experienced this problem? Thanks for your input, Mark
Yes it's an XP machine, and made the registry changes, but that doesn't seem to be where the problem is. When I issue the exact same command to create the machine account (/usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M <computer name>) from the command line, I've got no problem joining the domain. Also, the logs show that I'm authenticating just fine with Administrator => [root], so it's not that the account doesn't have the rights to join a computer to the domain... I'm wondering if anyone else out there is seeing anything similar? Thanks for your reply. Mark> -----Original Message----- > From: Mark Ford [mailto:mford@bbmusa.com] > Sent: Monday, August 18, 2003 3:38 PM > To: 'Mark' > Subject: RE: [Samba] add user script > > this on a Win XP computer? If so have you made the change to theWindows> Registy? >
Hi all- Just wanted to say thanks to everyone for their input. The problem, unfortunately, isn't solved yet. I did try adding a new group with guid of 100 but that didn't work (thanks though, Glenn). Also, I'm not using ldap for authentication, could that be a problem? I know I can add the accounts by issuing the same command at the command line, which makes me wonder if, for some odd reason, Samba isn't able to run useradd as root. Any ideas? Thanks for the help, Mark