Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: File Owner = Nobody??? Help me please

  1. #11
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    6,255
    Distro
    Xubuntu 17.10 Artful Aardvark

    Re: File Owner = Nobody??? Help me please

    Firstly, I don't know how you're sharing the files (you don't say). I guess different servers put their file in different places. If you know a filename, try the command:
    locate <filename>
    and see where it has ended up.

    Secondly, many servers run under the account name nobody as a security thing. This means the server can't be subverted into writing into your home folder for instance - it doesn't have write permissions there. You can probably configure it to run under a different account name if you want, but unless you really know what you're doing and why, it's a Bad Idea.

  2. #12
    Join Date
    Oct 2007
    Beans
    6

    Re: File Owner = Nobody??? Help me please

    I have had the same problem. It has something to do with shares created via Samba. I've found several fixes that are quite technical and frankly I couldn't bothered... until I found this http://ubuntuforums.org/showthread.php?t=24008. This creates a launcher that you can drag the offending folder to and it will magically open as root and then you can change the permissions. It worked for me. Good luck!

  3. #13
    Join Date
    Mar 2009
    Beans
    27
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: File Owner = Nobody??? Help me please

    I don't know if anybody is still wondering about this but you can use sudo chown to CHange OWNer of the folder. For instance I've just copied over a whole bunch of files/directories from a Windows box into a folder called /newFolder. I can use sudo chown -R myName /newFolder and it will change the owner of everything inside to myName.


  4. #14
    Join Date
    Feb 2010
    Beans
    3

    Re: File Owner = Nobody??? Help me please

    Nice thread. Great Help.

  5. #15
    Join Date
    Jan 2011
    Beans
    18

    Re: File Owner = Nobody??? Help me please

    The answer for why all the newly created or saved files are changing ownership to nobody has to do with the guest access to the share (I'm assuming it is guest access since the specific access being used was not stated). All guest that save or modify files will end up creating files that are owned by the user nobody, in the same manner that any user that creates a file will create a file owned by himself or herself.

    How do you get around this? It is possible to change the guest user in the smb.conf file, but this may be a bad idea if you have other shares on the system. I would instead create a share with very specific user access or create a deamon that scans for new files and then executes the chown command on them.
    Last edited by mblahay; August 27th, 2011 at 12:36 AM.

  6. #16
    Join Date
    Mar 2007
    Location
    Sacramento, Ca
    Beans
    85
    Distro
    Ubuntu 6.10 Edgy

    Re: File Owner = Nobody??? Help me please

    Permissions still bother me too at times. One workaround I do is edit files with supervisory rights. e.g. gksu gedit <filename optional>
    After typing the requested password, you to edit the file as root.
    Of course, that may later cause more complications if "root" owns the edited file.

    Another workaround - gksu nautilus (or gksu thunar) so you can use the graphic interface to change ownerships and access.

  7. #17
    Join Date
    Dec 2008
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: File Owner = Nobody??? Help me please

    Quote Originally Posted by mblahay View Post
    The answer for why all the newly created or saved files are changing ownership to nobody has to do with the guest access to the share (I'm assuming it is guest access since the specific access being used was not stated). All guest to save to modify files will end up created files that are owned by the user nobody, in the same manner that any user that creates a file will create a file owned by himself or herself.

    How do you get around this? It is possible to change the guest user in the smb.conf file, but this may be a bad idea if you have other shares on the system. I would instead create a share with very specific user access or create a deamon that scans for new files and then executes the chown command on them.
    Yes it is possible to change the user that is used for the guest account. You have to set the parameters in the /etc/samba/smb.conf file. This is done with 2 parts. The first part is set by default. It is the parameter map to guest. This is a [global] parameter that says "...logins with an invalid password are rejected, unless the username does not exist, in which case it is treated as a guest login and mapped into the guest account. It is defined as
    Code:
    map to guest = Bad User
    The second part is the [global] parameter guest account which is used to map the user you wish to be used as the Samba guest account. The default is the user "nobody". It is defined as
    Code:
    guest account = nobody
    I use an account called smbguest on my system.

    In practice, the user is not as important as the group the file is created with. All of my Samba users and the guest account create files with the group smbusers and the permissions of 3664. This allows any user that is part of the smbusers to manipulate the file. In addition any directory (folder) is created with this group and the permissions are 3775.

    These parameters are set by using extended permissions. The leading 3 (as in 3775 or 3664) set the sticky bit on folders and sets the setguid to smbusers). The sticky bit is set so no file or folder can be deleted except by the owner (creator) or root. The setguid is what forces the file or folder when created to have the group the same as the folder it is created in.

    First you set the directory that is the root of the share with the permissions and group ownership you want (in my case it looks like this Note the extended attributes)
    Code:
    drwsrwsr-t  9 root smbusers 4.0K 2011-08-23 19:01 backup
    Then you can force these create modes on in the /etc/samba/smb.conf. These are [share] parameters. They are used like this for files
    Code:
    force create mode = 3664
    ...and for directories
    Code:
    force directory mode = 0775
    All the samba configuration parameters for the smb.conf file are described here.

    I also set the umask to 002 so any file created on the system is set to the minimum of 664 and any directory is set to 775. The default is umask=022 which has a setting of 644 and 755. The default is not appropriate for group usage.

    In addition I set the underlaying file permissions to 3664 and directories to 3775. This is explained here.

    This is a lot of tuning to the system, but in the end you have a setup that allows any samba user to read, write and copy any shared file or folder while only the original creator or root can delete or change permissions on the file or folder.

    If you have a need to control user access you can do that by changing the user group on any particular share.

  8. #18
    Join Date
    Jan 2011
    Beans
    18

    Re: File Owner = Nobody??? Help me please

    Wow, thank you Capscrew. It is good to get some information from someone who is experienced in this. I'm new to Samba, and Linux in general, and will try implementing the best practices you have laid out. Beware, I may be back with additional questions.

  9. #19
    Join Date
    Nov 2010
    Beans
    271
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: File Owner = Nobody??? Help me please

    user 'nobody' is used for running processes on your system as a non-privileged user.

    you can otherwise create a different user under a different group for accessing files through your web server or ftp, and next add your username as a member of that group.

    groupadd -g < group-id> <group-name>
    useradd -g <group-name> -d /dev/null -s /bin/false <username> (-d and -s flags for home and shell respectively for security reasons, you may change that)

    adding the new user to the application you are using would be application specific.

    next, add your own user as a member of the newly crated group:
    Open Administration > Groups and users > click on manage groups > navigate to the newly created group and add your user account as a member of the group.
    (am not sure if adduser will add you to the group or rather create a new user and add it to the group; therefore the GUI way )

    btw, adding your username to the group 'nogroup' (which user nobody belongs to isn't a good idea)

    EDIT: heck.. that doesn't solve the problem
    Last edited by debd; August 26th, 2011 at 03:30 PM.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •