LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   samba and chmod problems... (https://www.linuxquestions.org/questions/linux-networking-3/samba-and-chmod-problems-81251/)

djroketboy 08-12-2003 08:00 AM

file/user permission problems...
 
hi guys.. i've searched, and searched for this, but can't seem to find my exact problem.. i know it's prolly very simple, but i would like just a xtra set of eyes to help me solve this issue.

My problem is somewhere in my file permissions, we run customized web software that allows our clients to remotely send us files via a client on their end, the client logs into our ftp and puts the files, then prints us up a job ticket.

The problem is when the file is uploaded to the ftp server *sometimes* the files are moved, and sometimes they aren't. (They are supposed to be moved everytime). What i'm thinking it is, when the client uploads files with a directory, that, that seems to be why it can't delete it... but i'm really not sure.

It's not just this particular web software doing this, if i were to upload a file/directory w/ a ftp client, then the same thing happens.

Another issue is that we can't create directory's more than 2 deep.. but sometimes, and some shares we can...

if you think you can shed any light on this issue.. or even send me in the right direction i'd really appreciate it.

Thanks for your time.

smb.conf:
Code:

# Global parameters

[global]
      workgroup = workgroup
#    server string = Kal-Blue Network Samba Server
#      server string = taz
      encrypt passwords = True
      security = user
      smb passwd file = /etc/smbpasswd
      log level = 1
      log file = /var/log/samba/log.%m
      socket options = IPTOS_LOWDELAY TCP_NODELAY
      domain master = Yes
      local master = Yes
      preferred master = Yes
      os level = 65
#      dns proxy = yes
#      wins server = 192.168.1.1
#      wins support = yes
#      wins proxy = yes
      netbios name = taz
      name resolve order = lmhosts hosts bcast
      bind interfaces only = True
#      interfaces = eth0 192.168.1.1 eth1 192.168.1.2 eth2 192.168.1.3
#      hosts allow = 192.168.1.0/255.255.255.0 127.0.0.1 EXCEPT 192.168.1.3
#      hosts deny = ALL
#      debug level = 1
      create mask = 0777
      directory mask = 0777
      oplocks = yes
      max xmit = 65535
      dead time = 15
      getwd cache = yes
#      lpq cache = 30
      read raw = yes
      write raw = yes
      write cache size = 262144
      lock directory = /var/lock/samba

[ftp]
        Comment = Public FTP Repository
        browsable = yes
        create mode = 0777
        directory mode = 0777
        path = /var/ftp
        public = yes
        only guest = no
        read only = no
        available = yes
        guest only = no
        writable = yes
        only user = no

[http]
        Comment = Kal-Blue Web Files
        browsable = yes
        create mode = 0777
        directory mode = 0777
        path = /var/www/html
        public = yes
        only guest = no
        read only = no
        available = yes
        guest only = no
        writable = yes
        only user = no

[printroom]
        Comment = Printroom file storage
        browsable = yes
        create mode = 0777
        directory mode = 0777
        path = /usr/public
        public = yes
        only guest = no
        read only = no
        available = yes
        guest only = no
        writable = yes
        only user = no

[copyroom]
        Comment = Copyroom file storage
        browsable = yes
        create mode = 0777
        directory mode = 0777
        path = /usr/copyroom
        public = yes
        only guest = no
        read only = no
        available = yes
        guest only = no
        writable = yes
        only user = no

[os]
        Comment = Operating System Files
        browsable = yes
        create mode = 0777
        directory mode = 0777
        path = /usr/os_share
        public = yes
        only guest = no
        read only = no
        available = yes
        guest only = no
        writable = yes
        only user = no

[tmp]
        Comment = Temporary Working Directory
        browsable = yes
        create mode = 0777
        directory mode = 0777
        path = /usr/temp
        public = yes
        only guest = no
        read only = no
        available = yes
        guest only = no
        writable = yes
        only user = no


JRandom 08-12-2003 01:27 PM

Hello,

I'm confused. I understand the web-based software uses FTP to transfer the files to your host. You mention that they can't be moved. What process or component is attempting the move? Also, how does Samba fit in to all of this.

I will guess that you are using Samba to move the files off from the FTP drop onto a Windows box? O.K.

If this is correct, what unix user and group owns the files in the FTP drop/upload directory? For security reasons, it's fine to give me a fake user and group. Are the file permissions correct? For move it should be 666. Be sure to check the FTP drop's directory permissions too.

What I'm getting at is that Samba has a force user/group option that may help. It "maps" the user that you windows box is logged in to and forces UNIX file operations to use a specific user (That didn't make much sense to me, even!).

So if the owner of the FTP'd files is 'ftp' and the group is 'ftp' then under the [ftp] section of you can try:

force user = ftp
force group = ftp

and see if that helps. Don't forget to restart Samba!

--Eric

djroketboy 08-12-2003 01:34 PM

thanks for the reply, what you assumed is correct, the files get moved from the ftp via samba to a printroom directory...

i started playing with usergroups and permissions a bit more today, and think i realized what i did....

we have a generic login for our comps here.. let's say "user" but for ftp i created a new user "ftpuser" but never put them in the same group... so the ftp would create the files, the "user" would copy the files, but never delete them from the ftp... (make sense?)

so i changed the ownership of the ftp directory to match the "user" group... made sure both "ftpuser" and "user" are in the same group... and viola! everything is working seemless...

i guess i knew how to fix it all along, but just didn't hit me til after i posted this....

one other thing, if anyone know's, is there a way to "steamline" my samba config? just so it's a little faster.. and i've run testparm on it, everything checks out ok.. but just wanted to tweak it for speed a lil bit more :)

thanks y'all :)


All times are GMT -5. The time now is 03:09 PM.