OpenWrt Forum Archive

Topic: SAMBA: No valid user found in /etc/passwd

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm running kami 8.09 (2.6 kernel) on a wl-500g premium v1.
I'm trying to set it up as a samba server.
I've never used samba before so I could be doing something insanely stupid.
I've installed the samba3 package.
I'm getting this error:

root@OpenWrt:~# smbpasswd -a n00b
No valid user found in /etc/passwd

but my /etc/passwd file shows:

root@OpenWrt:~# cat /etc/passwd
root:$1$cLQJUdBB$tLNuqU75Nu.UB9gIq0Zs9/:0:0:root:/root:/bin/ash
nobody:*:65534:65534:nobody:/var:/bin/false
daemon:*:65534:65534:daemon:/var:/bin/false
n00b:$1$gWhX/J/6$jFuO91JJ/REvBnRMcUDKX1:1000:1000:The n00bilator:/home:/bin/ash

I can even SSH in as n00b.
Could someone please point out the error of my ways?

Cheers

I fixed it.  I should run:

 smbpasswd n00b <my samba password>

and not use the -a option.

I am having a hell of a time with the current Kamikaze, samba 3 and the Slug.
Can't even figure out how to add a user, adduser or useradd don't exist.
And, even if I tick off "allow guests", samba always wants a password!

Any similar problems or suggestions, anybody?

Are you still having problems?  The steps should be something like this:

1. Add the user the the /etc/passwd file.  Since there is not a utility, you will need to manually edit the file in vi.
2. While not needed, set the new users Linux password with the passwd command.  Then sign in via ssh to test the user ID.
3. Add the the user to Samba
     smbpasswd -a <newuser>
     It will prompt for the users password, follow the prompts

    The user will be added to the /etc/samba/smbpasswd file.  You should be able to cat the file and see the user.
    At this point you should have a valid Linux and Samba user.  Note, that passwords do not have to be the same.

4. How do you have samba configured?  I use user security.  Here is my /etc/samba/smb.conf for an example, adjust paths as needed.

[global]
syslog = 0
syslog only = yes
workgroup = Wakeyland
server string = OpenWrt Samba Server
security = user
encrypt passwords = yes
guest account = nobody
local master = yes
name resolve order = lmhosts hosts bcast

[shared]
comment = Shared directory
path = /opt/dp/shared
browseable = yes
public = yes
writeable = yes
create mask = 0775
force group = users          <---- You may need to add the group.  This force the group ownership of the files.

5. make sure Samba is starting.  You should see nmbd and smbd is the process list.  If not, you may need to add the host name to the /etc/hosts.local file so that Samba can resolve the name. (not a bad idea in general)

6. Try connecting to the Samba server.  From another Linux machine: smbclient //192.168.1.10/shared -U <user>%<password>
     adjust IP address and supply correct user ID and password.  Should get yo right in.

Hope this helps.

The discussion might have continued from here.