LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   No shift in adduser? not using my previous /home (https://www.linuxquestions.org/questions/slackware-14/no-shift-in-adduser-not-using-my-previous-home-412399/)

RedNovember 02-06-2006 06:51 PM

No shift in adduser? not using my previous /home
 
I finally got x working in slack 10.2, and I'm trying to get it to use my previous /home directory from SuSE. However, when I do adduser, it won't let me enter "RedNovember" (which was my previous user under SuSE). This effectively prevents me from using my previous /home directory. I initially entered "rednovember" before I realized that this was the case.
So I guess I have 2 questions. How do I completely get rid of references to "rednovember", and how do I get Slackware to accept "RedNovember"? I'd really like to be able to use capitalized usernames. I don't really see why this would be prevented, seeing as how SuSE accepted it fine and it's allowed under the filesystem.
Appreciate any help,
RedNovember

gilead 02-06-2006 08:21 PM

I'm not sure what the user name length limit is, but if you copy over the files you can use them still, just use chown to change the username/group.

RedNovember 02-07-2006 11:02 AM

I guess I could do that, but it seems like a pain. Plus it would take up twice the disk space if I wanted to dual boot with SuSE. Isn't there some way to get slackware to accept "RedNovember"?

odevans 02-07-2006 12:16 PM

Have you tried manually editing /etc/passwd?

Run the adduser script (as root)
Set the username to rednovember
Set home dir to /home/RedNovember (or whatever it actually is)
If asked to chown rednovember.users /home/RedNovember answer NO
Finish up adduser
edit /etc/passwd and change the rednovember entry to RedNovember

odevans 02-07-2006 12:29 PM

Also, from the /usr/sbin/adduser script:

# v1.04 - 09/06/02
# * Catered for shadow-4.0.3's 'useradd' binary that no longer
# will let you create a user that has any uppercase chars in it
# This was reported on the userlocal.org forums
# by 'xcp' - thanks. <sw,pjv>

(note current version of adduser is 1.09, using shadow 4.0.3)

RedNovember 02-07-2006 03:51 PM

I got your first post, but not your second. What does that stuff pertain to, and what does it mean?

odevans 02-07-2006 04:05 PM

Quote:

Originally Posted by RedNovember
I got your first post, but not your second. What does that stuff pertain to, and what does it mean?

The "adduser" command in Slackware is just a bash script. It takes the answers you provide and creates the "useradd" command (you can see how the command would look by reading the useradd manpage).

That was just a comment from that script. Apparantly, the version of useradd (from the shadow password suite 4.0.3) included with slack doesn't support uppercase letters in usernames.

Seemingly, and somewhat nonsensically, you can still USE uppercase usernames, just not create them with useradd.

Hope it worked for you.

cheers

RedNovember 02-07-2006 04:37 PM

Weirdly enough it did not work. Here are the steps I took: deleted the previous 'rednovember' from /etc/passwd, created the new 'rednovember', edited /etc/passwd to set the name to 'RedNovember'. Now neither 'rednovember' nor 'RedNovember' work for login to slack.

Perhaps slack just won't accept capitalized usernames? Or maybe I didn't delete the previous user enough? Or is it something wrong with my passwd?

/etc/passwd:
Code:

root:x:0:0::/root:/bin/bash
bin:x:1:1:bin:/bin:
daemon:x:2:2:daemon:/sbin:
adm:x:3:4:adm:/var/log:
lp:x:4:7:lp:/var/spool/lpd:
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/:
news:x:9:13:news:/usr/lib/news:
uucp:x:10:14:uucp:/var/spool/uucppublic:
operator:x:11:0:operator:/root:/bin/bash
games:x:12:100:games:/usr/games:
ftp:x:14:50::/home/ftp:
smmsp:x:25:25:smmsp:/var/spool/clientmqueue:
mysql:x:27:27:MySQL:/var/lib/mysql:/bin/bash
rpc:x:32:32:RPC portmap user:/:/bin/false
sshd:x:33:33:sshd:/:
gdm:x:42:42:GDM:/var/state/gdm:/bin/bash
pop:x:90:90:POP:/:
nobody:x:99:99:nobody:/:

RedNovember:x:1000:100:N Subramanian,,,:/home/RedNovember:/bin/bash

EDIT: Perhaps that line break is messing it up? Time to delete it and go reboot I guess. Thanks for all your help so far.
EDIT #2: That wasn't it. Neither were the commas. I'm stuck for an answer.

odevans 02-07-2006 05:03 PM

Sorry - forgot to add that you'll need to edit /etc/shadow too

RedNovember 02-07-2006 05:36 PM

How so? The same thing?

MS3FGX 02-07-2006 05:48 PM

Erm, wouldn't it have been easier to just make a link from "/etc/RedNovember" to "/etc/rednovember"?

odevans 02-07-2006 06:03 PM

Quote:

Originally Posted by MS3FGX
Erm, wouldn't it have been easier to just make a link from "/etc/RedNovember" to "/etc/rednovember"?

I'm guessing you meant add a user rednovember and link /home/redn... to /home/RedN...?

That wouldn't work if his existing home dir is owned by RedNovember and user/group names /are/ case sensitive. He may be able to access/edit files in his existing home dir as he would still be in the group 'users', but then, so could any other user, a bit of a security no-no.

Quote:

Originally Posted by RedNovember
How so? The same thing?

Sorta, /etc/shadow contains a hash of your password and is unreadable by anyone but root. /etc/passwd /can/ contain a hashed password, but is world readable - potential security risk (?):

/etc/passwd:
RedNovember:x:1004:100:,,,:/home/RedNovember/:/bin/bash
^username ^UID ^GID ^homedir ^shell


/etc/shadow:
RedNovember:$1$dNV0anKu$WvKgun.DxISGJ.p4iTxot0:13186:0:99999:7:::
^username ^^hash of password

EDIT:
Non-fixed width font in posting messed up those examples.

RedNovember 02-07-2006 06:05 PM

Sweet, it works now! Granted, KDE is a bit messed up, but that is for another day. Thanks for all the help :)

odevans 02-07-2006 06:17 PM

Quote:

Originally Posted by RedNovember
Sweet, it works now!

Cool!

Quote:

Originally Posted by RedNovember
Granted, KDE is a bit messed up, but that is for another day.

Probably differences between SuSE and Slack


Quote:

Originally Posted by RedNovember
Thanks for all the help :)

Happy to have helped :)

MS3FGX 02-07-2006 07:26 PM

Quote:

That wouldn't work if his existing home dir is owned by RedNovember and user/group names /are/ case sensitive. He may be able to access/edit files in his existing home dir as he would still be in the group 'users', but then, so could any other user, a bit of a security no-no.
True, but he could have made a group called "rednovember" on SuSE and Slack, and put the permissions to /home/RedNovember to "rednovember:rednovember" and 770. so while the usernames would have been different, the two users could have been in a specific group and permissions would have worked as they should.

But it is working now, so it does't matter.


All times are GMT -5. The time now is 05:18 AM.