skip to Main Content

I attempted to create a shared folder on a raspberry pi using the instructions found here. On running the command "sudo smbpasswd -a pi" to create a user and add a password, I got an error "Failed to add entry for user pi". Changing the user name to something else or trying different passwords did not make the error go away.

While I did not confirm this, I suspect the same error shows up in Ubuntu as well. However the solution there was not super clear.

2

Answers


  1. Chosen as BEST ANSWER

    It turns out that the error message from smbpasswd is not super clear. Also the man page for smbpasswd can be misleading as the -a option seems to suggest that this option will add the user and create a password for that user.

    The underlying issue seems to be that smbpasswd only adds users/sets passwords for users already known to the OS. So the right sequence of steps would be:

    sudo useradd pi
    sudo passwd pi
    sudo smbpasswd -a pi
    

    as detailed here.

    A closer reading of the smbpasswd man page with this knowledge shows that what smbpasswd does is make changes to the smbpasswd file and not the main password file of the OS.


  2. You need to create a UNIX user named student before you create a samba user named student.

    1. adduser student
    2. smbpasswd -a student
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search