|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
[Solved] Cannot "chmod" after account migration on openBSD.
I copy home directory, file /etc/passwd, file /etc/group, file /etc/master.passwd to the new server. This is result of "ls/home" on the old server. Code:
drwxr-xr-x 3 user1 user1 512 Aug 3 2012 user1 drwxr-xr-x 19 user2 user2 2560 Jan 9 09:24 user2 But This is result of "ls/home" on the new server. Code:
drwxr-xr-x 3 root wheel 512 Aug 3 2012 user1 drwxr-xr-x 19 root wheel 2560 Jan 9 09:24 user2 I would like to change root:wheel to user1:user1 This is result of Code:
chmod user1:user1 user1 chown: user is invalid: user1 Although user1 has been stored in /etc/passwd Any idea? Thank you in advance.
Last edited by bakunin; 03-13-2013 at 07:13 AM.. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Quote:
Just to be sure: you talk about "chmod" and "chown" intermixed. Which one do you have problems with? I hope this helps. bakunin |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Quote:
Code:
chown user1:user1 user1 chown: user is invalid: user1 I don't want to add new user B'cuz there are a lot of user and they have to change their password or not? And I cannot find shadow file on OpenBSD. Code:
locate shadow /usr/X11R6/include/xorg/shadow.h /usr/X11R6/include/xorg/shadowfb.h /usr/X11R6/lib/modules/libshadow.la /usr/X11R6/lib/modules/libshadow.so /usr/X11R6/lib/modules/libshadowfb.la /usr/X11R6/lib/modules/libshadowfb.so |
|
#4
|
|||
|
|||
|
If you inspect the chown source, you'll see that it uses getpwnam(3) to convert the username to a uid. That function reads the binary database files /etc/spwd.db and /etc/pwd.db. Did you rebuild those? If you don't know what I'm talking about, refer to
man pwd_mkdb .
It's safest to make edits to the password files using vipw. As always, if you break it, you get to keep all the pieces. Regards, Alister Last edited by alister; 03-14-2013 at 12:56 AM.. |
| The Following User Says Thank You to alister For This Useful Post: | ||
cyberking (03-14-2013) | ||
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
Thank you all. It's solved. I use this command Code:
/usr/sbin/pwd_mkdb -p /etc/master.passwd
Last edited by bakunin; 03-14-2013 at 03:21 AM.. |
| Sponsored Links | ||
|
![]() |
| Tags |
| account, chown, passwd |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| chmod on a remote server -solved | in5ane | UNIX for Dummies Questions & Answers | 0 | 03-24-2011 01:54 PM |
| What is the difference between chmod in solaris and chmod in Linux? | sumaiya | UNIX and Linux Applications | 1 | 08-12-2010 08:38 AM |
| Apply disk quota to account(dedicate 3 GB to account). | ashokd009 | Linux | 1 | 06-17-2009 11:32 AM |
| Change Account to not lock account if password expires | stringzz | UNIX for Dummies Questions & Answers | 1 | 04-04-2008 05:31 PM |
|
|