Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2008, 10:31 PM
dpeirce dpeirce is offline
Junior Member
 
Join Date: Dec 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default change UID number?
I'm new with PCBSD, and pretty new with Linux. I run several Linuces on my tower machine, and share common data among them using userID 1000 so that they are all compatible and the files don't get messed up from bad permissions. I'd like to share those common data files with PCBSD also, but it assigned my dave userID as 1001. I need to change it to 1000 to match the others.

Can I simply change the UID to 1000 in /etc/passwd? I tried that once earlier in a Linux but it messed everything up because many files and configs were left with the old UID#, and I had to reinstall. I've been handling it in Linux, when an installation assigned an uncompatible UID, by creating a new user bob, deleting dave, then creating a new user dave with the correct UID, using adduser, then removing user bob. I've created Bob in PCBSD, but he has no 'su -' privilages and no root access to system settings. I added bob to the wheel and operator groups (/etc/group) but he still has no root access. So I can't adjust the UID in the usual way for me.

So how can I change Dave's UID from 1001 to 1000? Help will be greatly appreciated. And, how can I give bob root access?

In faith, Dave
Viva Texas

Registered linux user #417229
Reply With Quote
  #2  
Old 12-07-2008, 11:51 PM
dpeirce dpeirce is offline
Junior Member
 
Join Date: Dec 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: change UID number?
Regarding the above: I accidentally ran into this post which seems to indicate possible problems between PCBSD and ext2/3 files. Is it a good idea for me to access and share my common files in PCBSD that I share between my other Linuces?

viewtopic.php?f=1&t=12872

Thanks, Dave
Viva Texas
Reply With Quote
  #3  
Old 12-08-2008, 07:05 PM
TerryP TerryP is offline
Senior Member
 
Join Date: Nov 2005
Location: Ga. USofA
Posts: 7,906
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to TerryP Send a message via AIM to TerryP Send a message via Yahoo to TerryP
Default Re: change UID number?
You sometimes may need to fsck/e2fsck the file system before mounting it in Linux/BSD; but shouldn't have any major problems. It's just, FreeBSD/PC-BSD mounts ext3 as ext2, so you really don't gain anything.


The system uses several flat files as a "user database" so to speak, along with compiled databases for speed. Generally, you should use programs that manipulate them for you, rather then editing them directly (although I break this advice often...)

if /etc/passwd is changed, you'll need to update the /etc/pwd.db and /etc/spwd.db files with the pwd_mkdb utility. Normally people use the program 'vipw' to edit the file manually, which takes care of the safety considerations & updating stuff.


for most intents and purposes, change the UID with vipw or by hand, and then recursively chown your home directory.


Code:
$ su - root
Password:
# vipw     (or run pwd_mkdb)
# chown -R 1000 /home/Dav
Reply With Quote
  #4  
Old 12-08-2008, 09:45 PM
dpeirce dpeirce is offline
Junior Member
 
Join Date: Dec 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: change UID number?
OK, in Dave's desktop, as root, I changed the UID in /etc/passwd to 1000:1000, ran pwd_mkdb, and then chown -R 1000 /home/Dave; then I rebooted, but it would not accept my password. So I rebooted in single-user mode, executed passwd dave, and entered my password. Still won't accept my password.

The error message is pam_chauthtok(): error in service module. ????

Alternatively, how can I give Bob root privilages so I can use rmuser and adduser.

In faith, Dave
Viva Texas
Reply With Quote
  #5  
Old 12-08-2008, 11:37 PM
TerryP TerryP is offline
Senior Member
 
Join Date: Nov 2005
Location: Ga. USofA
Posts: 7,906
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to TerryP Send a message via AIM to TerryP Send a message via Yahoo to TerryP
Default Re: change UID number?
Unless something has gone astray with the systems PAM.

The only things I can think of is if there is a problem with the shadow password file (/etc/master.passwd). I'd suggest opening a root shell and try taking a look at the file,

Code:
# grep Dav /etc/master.passwd
# edit /etc/master.passwd
   ... make any changes if necessary
# pwd_mkdb /etc/master.passwd
and redo the pwd databases again just to be safe.



really, all utilities for manipulating users/groups be they command line or graphical, just screw around with this stuff lol (lines in passwd/group files; home directory setup, etc)
Reply With Quote
  #6  
Old 12-09-2008, 10:01 PM
dpeirce dpeirce is offline
Junior Member
 
Join Date: Dec 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: change UID number?
'll try this, but is there any way to give root privilages to bob?

Thanks,

In faith, Dave
Viva Texas
Reply With Quote
  #7  
Old 12-09-2008, 11:16 PM
TerryP TerryP is offline
Senior Member
 
Join Date: Nov 2005
Location: Ga. USofA
Posts: 7,906
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to TerryP Send a message via AIM to TerryP Send a message via Yahoo to TerryP
Default Re: change UID number?
Code:
$ su - root
Password:
# setenv EDITOR /usr/local/bin/nano
# vipw
find the line for Bob, and change the UID column from whatever it is to a 0. The UID is the 3rd field; i.e. nameassword:uid:gid:class: and so on; see 'man 5 master.passwd' for details.


If you prefer a different line editor, feel free to adapt the setenv command; I wrote it in a way that launches the easiest editor available in multi-user mode. vipw respects the $EDITOR environment variable; and falls back to the system default /usr/bin/vi.

(Note: root can not run graphical programs on a users display by default; the 'ee' and 'nano' editors are the easiest to use from a terminal)
Reply With Quote
  #8  
Old 12-11-2008, 04:59 PM
dpeirce dpeirce is offline
Junior Member
 
Join Date: Dec 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: change UID number?
Problem is, I can't use su in bob, and dave's login is borked. My Knoppix 5.3.1 live DVD won't read the PCBSD partition. Do I have any other options?

Or is resistance fu-tile, and it's reinstall time?

In faith, Dave
Viva Texas

I'm beginning to feel like a woodpecker in a petrified forest!
Reply With Quote
  #9  
Old 12-11-2008, 09:38 PM
TerryP TerryP is offline
Senior Member
 
Join Date: Nov 2005
Location: Ga. USofA
Posts: 7,906
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to TerryP Send a message via AIM to TerryP Send a message via Yahoo to TerryP
Default Re: change UID number?
Just keep on pecking through, until you hit chow ;-)


If you can get as far as the KDM login screen, you can always use Control+Alt+Function keys to change 'Virtual Consoles'

vtty0 -> F1, system console
vtty1 -> F2, virtual console
....


I believe PC-BSD runs X/KDE on the F7 or F8 virtual consoles, but I'm not sure (I don't use KDM). Note that on vtty0 (control+alt+f1) system messages will be printed there from time to time. If you can't control+alt+function key your way back to the GUI, you can always use the 'reboot' command in a root shell.


The virtual consoles are just like a terminal window for all intents and purposes. But unlike the KDM system, all logins are allowed by default (as text mode virtual consoles are the default on FreeBSD). You can login as root directly at the virtual console (any that are in text mode), and have the same basic ability as a root shell in konsole. Root can even su to other user accounts at will (su - Bob)



Many times, if I'm working off battery power on my laptop, I'll boot and control+alt+f2 into text mode, and skip the fancy desktop until I'm back on A/C ;-)
Reply With Quote
  #10  
Old 12-12-2008, 06:46 AM
dpeirce dpeirce is offline
Junior Member
 
Join Date: Dec 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: change UID number?
OK, it looks like I'm partway back. I got a console at ctrl-alt-F7, used rmuser dave and then adduser dave. Now I can login as dave to a desktop, and the UID/GID are 1000/1000, but neither su - nor kdesu work as they did before. I also did rmuser bob; he is gone from /etc/passwd, but his home directory is still there. I can delete it as root, I suppose, but does that indicate any troubles?

How do I restore root privileges for dave? I saw what you said earlier about giving bob root privileges, but what you said didn't match what I saw in /etc/passwd.

In faith, Dave
Viva Texas

Today's subliminal message is [ . . . ]
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NEED A WAY TO CHANGE IRQ! silversidhe General Support 21 02-27-2008 02:48 AM
PBI Experiment Number One: Recreating the Creator Ireclan Creating PC-BSD Packages (.pbi files) 6 07-28-2007 02:42 AM
Let's use the system and quit whining over version number ezcomputers General Questions 12 02-24-2007 01:15 AM
Can't change permissions ranran General Questions 3 12-30-2006 04:11 AM
PBI Package Version Number? Dingens Feature Requests 3 07-21-2005 08:59 PM


All times are GMT. The time now is 05:14 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Copyright 2005-2010, The PC-BSD Project. PC-BSD and the PC-BSD logo are registered trademarks of iXsystems.
All other content is freely available for sharing under the terms of the Creative Commons Attribution License.