Jump to content

ubuntu permission/user quandries

i have mounted a partition in the media folder and shared some folders with samba using *sudo nautilus*

The problem is, i can only access those folders if i leave them open to everyone.

i have done    *sudo smbpasswd -a (user)*   to change the password to be certain i have the right one.

 

the problem is, when i try to access the folder with user: xx  password: xx

it keeps telling me the password is incorrect, it worked once, it has even

registered a login at the proper time, its just that, it only worked once...

does the samba user somehow not apply to the partition?

 

i wasn't able to locate the actual text files containing the passwords and whatnot.

/etc/samba only contained 3 files.

Link to comment
Share on other sites

Link to post
Share on other sites

When I had the same problem when setting up samba on my raspberry pi it helped to make the samba share paths refer to the home folder associated with the user/samba user.

When I set it up like that I could use a 770 mask so that only the file owner and the folder user(usually the same) could access them.

You could also add in the samba config file the option: invalid users=<username>. this excludes the username from entering the samba share

 

PS: you do have a line that says valid user=<username> right? where you separate usernames with space.

 

PPS here is a link to the samba.org documentation page on users and security, it helped me in setting up my samba shares. https://www.samba.org/samba/docs/using_samba/ch09.html

Edited by Cazzman
Link to comment
Share on other sites

Link to post
Share on other sites

You could also add in the samba config file the option: invalid users=<username>. this excludes the username from entering the samba share

 

PS: you do have a line that says valid user=<username> right? where you separate usernames with space.

 

PPS here is a link to the samba.org documentation page on users and security, it helped me in setting up my samba shares. https://www.samba.org/samba/docs/using_samba/ch09.html

Thanks for the reply, that "invalid users" option was awesome that you threw in,

i was wondering how to give specific users only access to certain folders aswell.

But i left it as the post was starting to become long.

 

i haven't located the actual text file in samba to edit.. i have been using

command line so far, but i did this  * sudo pdbedit -L -v * and it did give 

me a user that had been logged into. But i think it only worked in /home/user

Link to comment
Share on other sites

Link to post
Share on other sites

i haven't located the actual text file in samba to edit..

The standard location for the samba config file should be /etc/samba/smb.conf which you can edit by "sudo nano" through the terminal

 

i was wondering how to give specific users only access to certain folders aswell.

The way I did this was by having a samba share for one user : valid user=<username> and path=/home/<username> then if this alone does not exclude other users from entering the share the simplest thing to change would be: create mask=770 and directory mask=770 if this doesn't work you can always fill the invalid users line up with the other users.

BTW these lines should be added to the samba config file at the very bottom where you define your shares

 

I hope you can find and edit the config file, it's the easiest way to make changes.

When you made changes use: "sudo /etc/init.d/samba restart" to restart the samba daemon before testing the changes otherwise you'll work with the older settings

Link to comment
Share on other sites

Link to post
Share on other sites

The standard location for the samba config file should be /etc/samba/smb.conf which you can edit by "sudo nano" through the terminal

 

The way I did this was by having a samba share for one user : valid user=<username> and path=/home/<username> then if this alone does not exclude other users from entering the share the simplest thing to change would be: create mask=770 and directory mask=770 if this doesn't work you can always fill the invalid users line up with the other users.

BTW these lines should be added to the samba config file at the very bottom where you define your shares

 

I hope you can find and edit the config file, it's the easiest way to make changes.

When you made changes use: "sudo /etc/init.d/samba restart" to restart the samba daemon before testing the changes otherwise you'll work with the older settings

well, thanks for the help. It has decided to cooperate after abit of fiddling.

i came to the conclusion that it was windows that was being stupid and not samba.

 

Now i have some additional functionality i can take advantage of.

I wanted login to be required every time you access the folder though,

currently it just attaches the pc to the folder until i manually disconnect it.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×