LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 11-17-2004, 01:35 AM   #1
engyeow
LQ Newbie
 
Registered: Nov 2004
Location: Singapore
Distribution: RedHat/Fedora
Posts: 5

Rep: Reputation: 0
Question useradd: invalid username username$


Hi guys,

After installed FC3, i have problem joining windows client to samba PDC
I use samba-3.0.8

Issue:
#useradd -M machine_name$
useradd: invalid user name 'machine_name$'

I remember i don't face this problem with RH9. I can add my windows machine hostname with a $ behind, when joining samba domian server.

/etc/samba/smb.conf
add machine script = /usr/sbin/useradd -s /bin/false -d /dev/null -M %u

Does anyone know what's going on?

Thanks and regards,
Eng Yeow
 
Old 11-17-2004, 03:08 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392
You are not allowed to use anything but the following for loginnames:

alphanumeric characters, the period (.), underscore (_), plus (+), and minus (-) characters)

I know that some distro's do allow other characters to be used, but this is not officially allowed.

Hope this helps.
 
Old 11-17-2004, 04:44 AM   #3
kozgun
LQ Newbie
 
Registered: Jun 2003
Posts: 12

Rep: Reputation: 0
Quote:
I know that some distro's do allow other characters to be used, but this is not officially allowed.
Slackware allows this type of naming, and also FC1 allows this. I've been thinking of
creating lots of users using "_". What do you mean this is not officially allowed? Is this
related with bash or useradd script or FC?

Thank you.
-ozgun.
 
Old 11-17-2004, 05:23 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392Reputation: 2392
The _ is allowed (as I stated in the previous post).

Characters like $ % & # ! (etc) should not, and most often can not, be used for usernames.

The loginname is very often used by other programs (mail being one), which restricts the use of special characters.

What about the following.

Your loginname is: foo@bar
The emailaddress created will be: foo@bar@some.machine

I don't think mailers will like this.......

Another example is :, which is used as a seperator in /etc/passwd. A username like john:doe is therefore not usable.
 
Old 11-17-2004, 08:49 AM   #5
engyeow
LQ Newbie
 
Registered: Nov 2004
Location: Singapore
Distribution: RedHat/Fedora
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks guy for replying.

I just found out it could be due to different version of the package shadow-utils (provides useradd function, etc) that being used in RH9 and FC3.

I don't intend to create username with a $ behind. This is automatically done when joining windows 2000 pro machine to samba PDC server. I'm trying to use Samba to replace my existing Windows 2000 server.

The following line in /etc/samba/smb.conf did the adding of machine trust account:
add machine script = /usr/sbin/useradd -s /bin/false -d /dev/null -M %u
So, windows will just append $ behind the hostname automatically.

There is a solution which need to manually create all my windows client Pc's hostname before joining them to samba domain, this could be troublesome.

I think I may use RH9 instead of FC3, unless someone got better solution.

Thanks,
Eng Yeow
 
Old 12-05-2004, 04:35 AM   #6
bvdbos
LQ Newbie
 
Registered: Dec 2004
Posts: 1

Rep: Reputation: 0
temporary solution

In my first days as a linux-user I've stumbled accross the same problem and found the following soultion, assuming teh group machines:

# useradd -g machines -d /dev/null -s /bin/false winmachine
# passwd -l winmachine

Notice the lack of the string. Now here comes the tricky part. Make backup copy's of the files "/etc/passwd" and "/etc/shadow" first. Manually edit the "/etc/passwd" and "/etc/shadow" and change the machine name to include a string. In my case my winxp-machine was called hemel3, so I changed the name in both files to hemel3$.

Then add the user to samba:
# smbpasswd -a -m machine_name

This should work for now. Also, as of nov 16th there's a new version of shadow-utils which handels this, didn't try it yet though.
http://fr.rpmfind.net/linux/RPM/fedo...3-42.i386.html

gr

Bas
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why "bash-2.05b$" in Terminal instead of "username@localhost username" jayelitumbiolo Linux - General 9 10-04-2009 03:16 AM
Mount CIFS partition as user: Invalid or missing username paco36 Linux - General 2 07-04-2005 12:31 AM
Changing LQ username? ksgill LQ Suggestions & Feedback 3 03-06-2005 02:44 PM
Change username? theonebeyond LQ Suggestions & Feedback 3 12-05-2004 12:32 PM
How to login w/o username and pw liubhs02 Fedora - Installation 1 06-01-2004 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 03:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration