Koozali.org: home of the SME Server

Problem with Samba Share Password(s) & Accounts

Offline timm

  • *
  • 14
  • +0/-0
    • http://www.dreyercycle.com
Problem with Samba Share Password(s) & Accounts
« on: September 08, 2007, 02:13:53 AM »
I have a problem with my SME 7.2 server.  I attempted to backup the server with directions per this forum. I used the following script to put these files on a removable USB hard drive:

cp -av /etc/sudoers /media/backupdr/
cp -av /root/ /media/backupdr/
cp -av /opt/ /media/backupdr/
cp -av /etc/ssh/ /media/backupdr/
cp -av /etc/smbpasswd /media/backupdr/
cp -av /etc/shadow /media/backupdr/
cp -av /etc/passwd /media/backupdr/
cp -av /etc/gshadow /media/backupdr/
cp -av /etc/group /media/backupdr/
cp -av /etc/e-smith/templates-user-custom/ /media/backupdr/
cp -av /etc/e-smith/templates-custom/ /media/backupdr/
cp -av /home/netlogon/ /media/backupdr/
cp -av /home/e-smith/ /media/backupdr/

Now my server has samba share issues and all of my users have problems. Here is an example of some of my log file:

Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user pcalendar (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user tyler (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user scot (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user matt (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user backup (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user fiche2 (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user fiche3 (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user chuck (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user partsmngrpro (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user service (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user terry (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user ssl (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user fichefinder (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user info (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user steve (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user bobby (uid not number)
Sep  7 19:58:35 aserver smbd[4157]: [2007/09/07 19:58:35, 0] passdb/pdb_smbpasswd.c:getsmbfilepwent(413)
Sep  7 19:58:35 aserver smbd[4157]:   getsmbfilepwent: malformed password entry for user mike (uid not number)
Sep  7 19:58:39 aserver atalkd[3897]: zip_getnetinfo for eth0
Sep  7 19:58:45 aserver squid[3874]: WARNING: Disk space over limit: 117952 KB > 102400 KB
Sep  7 19:58:49 aserver atalkd[3897]: config for no router
Sep  7 19:58:50 aserver atalkd[3897]: ready 0/0/0
Sep  7 19:58:50 aserver atalk: atalkd startup succeeded
Sep  7 19:58:56 aserver squid[3874]: WARNING: Disk space over limit: 112904 KB > 102400 KB
Sep  7 19:58:56 aserver atalk:   Registering aserver:Workstation: succeeded
Sep  7 19:59:02 aserver atalk:   Registering aserver:netatalk: succeeded
Sep  7 19:59:02 aserver papd[4277]: restart (2.0.3)
Sep  7 19:59:02 aserver atalk: papd startup succeeded
Sep  7 19:59:02 aserver atalk: cnid_metad startup succeeded
Sep  7 19:59:02 aserver afpd[4285]: Registering CNID module [last]
Sep  7 19:59:02 aserver afpd[4285]: Registering CNID module [cdb]
Sep  7 19:59:02 aserver afpd[4285]: Registering CNID module [dbd]
Sep  7 19:59:02 aserver afpd[4285]: Loading ConfigFile
Sep  7 19:59:02 aserver atalk: afpd startup succeeded
Sep  7 19:59:08 aserver papd[4277]: Authentication disabled: office copy machine
Sep  7 19:59:08 aserver papd[4277]: register office copy machine:LaserWriter@*
Sep  7 19:59:08 aserver afpd[4285]: aserver:AFPServer@* started on 65280.204:130 (2.0.3)
Sep  7 19:59:08 aserver afpd[4285]: ASIP started on 192.168.0.168:548(6) (2.0.3)
Sep  7 19:59:08 aserver afpd[4285]: uam: loading (/usr/lib/uams_dhx.so)
Sep  7 19:59:08 aserver afpd[4285]: uam: uams_dhx.so loaded
Sep  7 19:59:08 aserver afpd[4285]: uam: loading (/usr/lib/uams_pgp.so)
Sep  7 19:59:08 aserver afpd[4285]: uam: uam not found (status=-1)
Sep  7 19:59:08 aserver afpd[4285]: uam: "DHCAST128" available
Sep  7 19:59:08 aserver afpd[4285]: Finished parsing Config File

How can does the relationship for samba share work against the existing user database & passwords. If I delete the user & re-enter the user with a samba share for a group directory it works perfectly, but I can tell from the log something big is broken. Please help.

-Timm
...

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Problem with Samba Share Password(s) & Accounts
« Reply #1 on: September 08, 2007, 04:44:24 AM »
timm

What about

etc/samba/secrets.tdb
etc/samba/smbpasswd
...

Offline timm

  • *
  • 14
  • +0/-0
    • http://www.dreyercycle.com
Re: Problem with Samba Share Password(s) & Accounts
« Reply #2 on: September 08, 2007, 04:16:53 PM »
timm

What about

etc/samba/secrets.tdb
etc/samba/smbpasswd


You are correct the messed up /etc/smbpasswd file looks like this:

root::0:root,admin
bin::1:root,bin,daemon
daemon::2:root,bin,daemon
sys::3:root,bin,adm
adm::4:root,adm,daemon
tty::5:
disk::6:root
lp::7:daemon,lp
mem::8:
kmem::9:
wheel::10:root
mail::12:mail
news::13:news
uucp::14:uucp,nut
man::15:
games::20:
gopher::30:
dip::40:
ftp::50:
lock::54:
nobody::99:
users::100:
dbus:x:81:
floppy:x:19:
vcsa:x:69:
mysql:x:27:
nofiles:x:400:
qmail:x:401:
slocate:x:21:
utmp:x:22:
haldaemon:x:68:
apache:x:48:
ldap:x:55:
pcap:x:77:
clamav:x:402:
shared:x:500:www,admin,public,fiche,public_bbs,timm,jukebox,adminbay,bardahl,billboard,calendar,calendar2,drivers,engles220,factoryfx,gerbings,k_l,lightspeed,logos,mac,msds,music,photos,projectx,royalstar,super2004,super2005,swap,sx05,training,usedbikes,video,yamaha,barbie,ben,brian,chelsi,cindy,credit,duane,estore,james,janet,jasona,jeff,josh,kimber,lauren,mandybishop,max,megan,mick,ssj,whitney,jamie,sullivans,dealerexpo,e-bay,email,steph,kawasaki,rivco,suzuki,riders,elmo,jwilder,star,star2006,gregg,kyle,mindy,haleydavis,indianaflat,dhs,main,electa,dreyerhonda,bryan,missy,jr,abby,chas,music2,kathy,kshare,swap2,pcalendar,tyler,scot,matt,backup,fiche2,chuck,partsmngrpro,service,terry,ssl,fichefinder,fiche123,info,steve,bobby,mike
www:x:102:admin
admin:x:101:main
public:x:103:
smelog:x:1002:
ntp:x:38:
nut:x:57:
rpm:x:37:
cvmlog:x:1003:
dnscache:x:410:
dnslog:x:411:
dovecot:x:97:
stunnel:x:451:
imaplog:x:1001:
radiusd:x:95:
sshd:x:74:
squid:x:23:
smelastsys:x:2999:
dns:x:53:
spamd:x:1005:
qpsmtpd:x:453:
fiche:x:5000:
public_bbs:x:5001:
timm:x:5002:
jukebox:x:5003:
adminbay:x:5004:
bardahl:x:5005:
billboard:x:5006:
calendar:x:5007:
calendar2:x:5008:
drivers:x:5009:
engles220:x:5010:
factoryfx:x:5011:
gerbings:x:5012:
k_l:x:5013:
lightspeed:x:5014:
logos:x:5015:
mac:x:5016:
msds:x:5017:
music:x:5018:
photos:x:5019:
projectx:x:5020:
royalstar:x:5021:
super2004:x:5022:
super2005:x:5023:
swap:x:5024:
sx05:x:5025:
training:x:5026:
usedbikes:x:5029:
video:x:5030:
yamaha:x:5031:
barbie:x:5033:
ben:x:5034:
brian:x:5036:
chelsi:x:5037:
cindy:x:5038:
credit:x:5039:
duane:x:5040:
estore:x:5041:
james:x:5042:
janet:x:5043:
jasona:x:5044:
jeff:x:5045:
josh:x:5046:
kimber:x:5047:
lauren:x:5048:
mandybishop:x:5049:
max:x:5051:
megan:x:5052:
mick:x:5054:
ssj:x:5057:
whitney:x:5060:
adminst:x:5061:barbie,duane,janet,lauren,ssj,admin,www
finance:x:5062:cindy,credit,admin,www
management:x:5063:cindy,jeff,josh,ssj,timm,admin,www,gregg,steve
parts:x:5064:chelsi,jasona,kimber,lauren,mandybishop,megan,admin,www,jamie,brian,gregg,kyle,mindy,kathy,steve
sales:x:5065:ben,admin,www,chas,terry
service_dept:x:5066:megan,admin,www,mick,bryan
jamie:x:5069:
sullivans:x:5071:
dealerexpo:x:5072:
e-bay:x:5073:
email:x:5074:
steph:x:5075:
kawasaki:x:5076:
rivco:x:5077:
suzuki:x:5079:
riders:x:5059:
elmo:x:5081:
jwilder:x:5084:
star:x:5083:
outside:x:5085:admin,star,www
star2006:x:5086:
gregg:x:5088:
kyle:x:5089:
mindy:x:5090:
haleydavis:x:5078:
indianaflat:x:5082:
dhs:x:5093:
main:x:5094:
electa:x:5095:
dhss:x:5096:admin,duane,lauren,riders,ssj,timm,www
dreyerhonda:x:5032:
bryan:x:5068:
missy:x:5098:
jr:x:5053:
abby:x:5056:
chas:x:5080:
music2:x:5100:
music3:x:5101:music2,admin,www
kathy:x:5102:
kshare:x:5105:
kaw:x:5106:admin,kshare,www,swap2
swap2:x:5104:
pcalendar:x:5107:
tyler:x:5108:
scot:x:5109:
matt:x:5050:
backup:x:5067:
fiche2:x:5070:
fiche3:x:5087:fiche2,admin,www,fichefinder,fiche123,steve
chuck:x:5091:
partsmngrpro:x:5092:
service:x:5055:
terry:x:5103:
ssl:x:5027:
fichefinder:x:5028:
info:x:5099:
steve:x:5058:
bobby:x:5035:
mike:x:5097:
fiche123:5110:B61D3439D545E5151AA818381E4E281B:DE3698D97FCBF68943F4FEE3C7B262EA:[U          ]:LCT-46E1DAEC:


It should look like this (old backup file):
admin:101:EB0A9C69ADA6D859143F8BD9AE9E0363:6809880F1DA7D902E74FBB693EB5D74D:[U          ]:LCT-453683DE:
mike:5097:7D8DCD3AB9C2A7671486235A2333E4D2:927BFDE387941EC3BBB270E6CAABA7E5:[U          ]:LCT-45A40CBE:
missy:5098:EF97B164A1D998BCC2265B23734E0DAC:0A1D3A276EEEEE46B438F6860C532E89:[U          ]:LCT-45A40CD1:
info:5099:2C4146497536D12325AD3B83FA6627C7:B5F14515153A8C6A52BAC691286847B0:[U          ]:LCT-45A53E3A:
gregg:5088:8096CBECD68D9545AAD3B435B51404EE:DFFA57C5EB4B54A2B6FAD124D9828772:[U          ]:LCT-459A726F:
barbie:5033:72E51A289C33BA32AAD3B435B51404EE:07C72F0042CE813C60AB485ED57DA5CD:[U          ]:LCT-45A52B3D:
duane:5040:8DC054D3D615AF6DAAD3B435B51404EE:36EBC985B1EBD870E0B8DF99E76033BF:[U          ]:LCT-45AA6E01:
jr:5053:8AE5F200D8761D11AAD3B435B51404EE:1F87E849BBFB5E028CBB64616D21DEB1:[U          ]:LCT-45AE8EA4:
abby:5056:B46029C78A3F85041D71060D896B7A46:D46F023253AD2F64F19962285EFC7584:[U          ]:LCT-45AE8E83:
chas:5080:EBAD4B71B595A4311D71060D896B7A46:2C512C83DF14DC1A16FC3A3CFFF8E815:[U          ]:LCT-4630F43E:
music2:5100:00CCE86B56A4033DAAD3B435B51404EE:D89360AFBCC598A5521276C690A2947A:[U          ]:LCT-45B28816:
kathy:5102:9B661004763A9E2FE6EDBA1A03E5C57D:8A09AEAF543ACD78063E1E985EFF4CEC:[U          ]:LCT-45B78C80:
jasona:5044:BBEAB45A86BF2DB6AAD3B435B51404EE:51E150EBCF377D9BE02B19104ACF88C6:[U          ]:LCT-45C1FAF1:
kshare:5105:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU         ]:LCT-00000000:
swap2:5104:DA045A1901BCF3CBAAD3B435B51404EE:BE1D8F1FD731DFD9982FCD3DCFB3C604:[U          ]:LCT-45CE158E:
jwilder:5084:7B63770261D561E8AAD3B435B51404EE:38E0AFE59954444056F75CC1E527024D:[U          ]:LCT-45E461F9:
tyler:5108:A45152A2DF314085E6EDBA1A03E5C57D:DE325BB5B0B8118907B4B63B021CCEEC:[U          ]:LCT-45ED7FB2:
scot:5109:B0F6628625991C1E25AD3B83FA6627C7:2DC68F4EB60F7570EDB9DBAD688E0952:[U          ]:LCT-45ED801E:
matt:5050:49E4C3CBF62020A925AD3B83FA6627C7:2C58AE61DE0EB6540ED91068FC933268:[U          ]:LCT-45EEDBC1:
fiche2:5070:CCD37B8C54CC2AF1AAD3B435B51404EE:C5FD505544725D5BFAC9B873E80D8BF0:[U          ]:LCT-463CB549:
steve:5058:72E046C40D7832DBAAD3B435B51404EE:82FA7B4EBEC2CC1F35C78E6DD8962050:[U          ]:LCT-463D4590:
chuck:5091:B46BEE4AE8F27E46DF128B2DD32BAD07:059DFE307A3F170A2E8A3D0345693D03:[U          ]:LCT-467ABE15:
bobby:5035:285BB1687FD5EFC2AAD3B435B51404EE:415C7CE732B37114FFF35B9914790EBF:[U          ]:LCT-4682B92E:
terry:5103:061101AE87046C9225AD3B83FA6627C7:BF79917CD4BDA98293F7AAF438A18961:[U          ]:LCT-468D320A:
janet:5043:D654B5B7945D3851E6EDBA1A03E5C57D:2E9ABFB03E4182F680E01A45113B1DCB:[U          ]:LCT-46AB65FE:
fichefinder:5028:89BEFD612751600996270CFE6F20D901:4F28D298E9F0968B2056321BB46B1D9D:[U          ]:LCT-46D8C982:


Can I just replace the smbpasswd file and make it work or do I have to replace the secrets.tdb file too?

I don't know what made it jumble up like this..

-Tim
...

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Problem with Samba Share Password(s) & Accounts
« Reply #3 on: September 08, 2007, 07:46:17 PM »
timm

To do a full backup and restore, you need all the files you mentioned plus the ones I mentioned.
I note that /etc/smbpasswd is a link to /etc/samba/smbpasswd


> I don't know what made it jumble up like this..

You didn't include the 2 files I mentioned in your backup and restore.
Also you should do a
signal-event post-upgrade
reboot
after doing the restore

PS What about the mysql databases, you need to dump those and restore them too
/var/lib/mysql/....
This gets done by the normal backup procedures.

I don't know why you chose to backup and restore the way you did, when there are perfectly good solutions available, that work without problem eg

backup using dar2 contrib (dmay)
http://distro.ibiblio.org/pub/linux/distributions/smeserver/contribs/dmay/smeserver/7.x/

desktop backup & restore using the tricks outlined here
http://wiki.contribs.org/Backup_server_config

or even the standard backup to USB disk and restore from USB disk, ie
login to console as admin and select Perform backup to USB device

or other contribs eg Affa
http://wiki.contribs.org/Affa

or the modified e-smith-backup with dar, that adds additional "backup to workstation" (& restore) functionality, see
http://wiki.contribs.org/Backup_with_dar

or even more simply restoring directly from the old server's disk directly to the disk in the new server. This requires the old disk to be temporarily removed and mounted in the new server, but it does avoid the need to do a backup first, see
http://wiki.contribs.org/UpgradeDisk

Any of the above methods would have included everythig that was needed.
...

Offline timm

  • *
  • 14
  • +0/-0
    • http://www.dreyercycle.com
Re: Problem with Samba Share Password(s) & Accounts
« Reply #4 on: September 08, 2007, 09:18:20 PM »
timm

To do a full backup and restore, you need all the files you mentioned plus the ones I mentioned.
I note that /etc/smbpasswd is a link to /etc/samba/smbpasswd


> I don't know what made it jumble up like this..

You didn't include the 2 files I mentioned in your backup and restore.
Also you should do a
signal-event post-upgrade
reboot
after doing the restore

PS What about the mysql databases, you need to dump those and restore them too
/var/lib/mysql/....
This gets done by the normal backup procedures.

I don't know why you chose to backup and restore the way you did, when there are perfectly good solutions available, that work without problem eg

backup using dar2 contrib (dmay)
http://distro.ibiblio.org/pub/linux/distributions/smeserver/contribs/dmay/smeserver/7.x/

desktop backup & restore using the tricks outlined here
http://wiki.contribs.org/Backup_server_config

or even the standard backup to USB disk and restore from USB disk, ie
login to console as admin and select Perform backup to USB device

or other contribs eg Affa
http://wiki.contribs.org/Affa

or the modified e-smith-backup with dar, that adds additional "backup to workstation" (& restore) functionality, see
http://wiki.contribs.org/Backup_with_dar

or even more simply restoring directly from the old server's disk directly to the disk in the new server. This requires the old disk to be temporarily removed and mounted in the new server, but it does avoid the need to do a backup first, see
http://wiki.contribs.org/UpgradeDisk

Any of the above methods would have included everythig that was needed.


Thank you so much for your help. I think why the backup to USB never worked before I just found out when I tried to do it manually. The USB disk was formatted as a NTFS. When I manually attempted to mount it, the kernel reported that it is not configured to work with that type of filesystem, hence my hard drive overfilled and messed up my backup. I might attempt to do another USB backup and see (since I reformatted the USB drive) if I can make the 'backup to USB' option work. Thanks again for your help!

-Timm
...

Offline raem

  • *
  • 3,972
  • +4/-0
...

Offline misnerspace

  • *
  • 58
  • +0/-0
Re: Problem with Samba Share Password(s) & Accounts
« Reply #6 on: September 11, 2007, 02:00:18 PM »
Hi Ray,

I was wondering if the method you outlined as  "or even the standard backup to USB disk and restore from USB disk, ie
login to console as admin and select Perform backup to USB device" will backup  and restore everything, i.e. user login/pwds, MySQL dbs etc. or wili t only back up/restore user files and ibays. I'm currently investigating the simpler backup everything and restore everything strategies. Thanks for your help/advice in advance

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Problem with Samba Share Password(s) & Accounts
« Reply #7 on: September 12, 2007, 12:12:57 PM »
misnerspace

The following are included in a backup & restore:

a dump of mysql dbs
etc/e-smith/templates-custom
etc/e-smith/templates-user-custom
etc/group
etc/gshadow
etc/passwd
etc/samba/secrets.tdb
etc/samba/smbpasswd
etc/shadow
etc/smbpasswd
etc/ssh
etc/sudoers
home/e-smith
root

A restore should always be done to a fresh install of sme7.x
You will need to reinstall any contribs that you previously had installed.
Configuration for those contribs will be restored from the backup.
...