Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 6th September 2008, 11:50 AM
majdi Offline
Registered User
 
Join Date: Feb 2007
Posts: 160
Why are files being created automatically when windows user acceses samba

The following files/folders listed below are automatically created when a windows client user accesses samba for the first time. They seem to be log files, are they necessary, and why is there a Mozilla folder?


Code:
[root@localstore shamim]# pwd 
/media/disk/shamim 
[root@localstore shamim]# ls -alph 
total 40K 
drwx------ 3 shamim shamim 4.0K Sep  6 13:39 ./ 
drwxr-xr-x 4 root   root   4.0K Sep  6 11:36 ../ 
-rw-r--r-- 1 shamim shamim   33 May 25 00:04 .bash_logout 
-rw-r--r-- 1 shamim shamim  124 May 25 00:04 .bashrc 
drwxr-xr-x 4 shamim shamim 4.0K Aug 30 19:43 .mozilla/ 
[root@localstore shamim]#
__________________
Fedora 11 (Leonidas)

Kernel 2.6.29.6-213.fc11.i686
GNOME 2.26.3

Dell Latitude D630
Memory: 3 GB
Intel(R) Core(TM) Duo CPU T7500 @ 2.20GHz

Last edited by majdi; 6th September 2008 at 02:47 PM.
Reply With Quote
  #2  
Old 6th September 2008, 12:42 PM
forkbomb's Avatar
forkbomb Offline
Registered User
 
Join Date: May 2007
Location: U.S.
Posts: 4,852
Quote:
Originally Posted by majdi
The following files/folders listed below are automatically created when a windows client user accesses samba for the first time. They seem to be log files, are they necessary, and why is there a Mozilla folder?

Code:
.bash_logout
.bashrc
.mozilla/
Those aren't log files.

.bash_logout is a script that's executed on exiting the bash shell.
.bashrc is a script executed on logging into bash - each user should have a .bashrc in his home directory
.mozilla is for storing cookies, bookmarks, plugins, etc. for Mozilla browsers.

What these all have in common is that they are "dot files" that usually end up in a user's home directory (the . means they are "hidden").

What's odd is that they're on your /media/disk/shamim mount point when you'd expect them to be in /home/foo. Do you by chance have any local UNIX users on the machine with a home directory of /media/disk/shamim?

Let's see, oh, say:
Code:
cat /etc/passwd
__________________
- Tom
"What is freedom? To have the will to be responsible for one's self." - Stirner
Reply With Quote
  #3  
Old 6th September 2008, 12:48 PM
servies's Avatar
servies Offline
Registered User
 
Join Date: Sep 2008
Location: the Netherlands
Age: 41
Posts: 1
These files have nothing to do with Samba. They're being generated when you create (by means of samba) the account for the user. The .bashrc and .bashlogout are needed by bash (a shell) if the user logs in on the server.
If you are sure that the user will never use a shell on the server just delete them.
The .mozilla folder is where p.e. firefox (when started on the server itself by the user) will put its (temporary) data. This one can always be deleted because it will be created again if needed.
These files are copied for every new system user from /etc/skel.
The place where they are is indeed a bit strange. I guess that the user's homedirectory is set to these directories... as already suggested by tjvanwyk

Last edited by servies; 6th September 2008 at 12:50 PM.
Reply With Quote
  #4  
Old 6th September 2008, 12:53 PM
forkbomb's Avatar
forkbomb Offline
Registered User
 
Join Date: May 2007
Location: U.S.
Posts: 4,852
DItto on what servies said.

My guess is you were under the impression that you needed to create a local LInux user for Samba and set the homee dir to /media/disk/shamim. But you don't need local Linux users - you need Samba users, which are indepeendent of normal local Linux users, created with smbpasswd, and are stored separately (with hashed passwords) in /etc/smbpasswd.
__________________
- Tom
"What is freedom? To have the will to be responsible for one's self." - Stirner
Reply With Quote
  #5  
Old 6th September 2008, 03:11 PM
majdi Offline
Registered User
 
Join Date: Feb 2007
Posts: 160
Thanks guys for the info, the files might be hidden in linux but windows clients can see them. I read up on setting up a Samba server and there are a lot of guides on the net on how to do so, but most of them say you have to create the linux users first before creating the samba users.

Then when configuring samba you will choose the linux user from the list and this will link it to the samba user you are creating. I followed this guide setting up samba.

To reduce the steps in the user and folder setup, instead of creating all the users and then all the shared folders, I thought it would be a good short cut to create the user with his shared folder being his home folder on the attached drive when creating the linux users in one step.

Quote:
But you don't need local Linux users - you need Samba users,
This is news to me, but good news because it will make life easier, as I said most of the guides I read will disagree with this, are you sure each samba user dose not need a corresponding linux user on the same server? If so, what will we do, when adding a samba user in the GUI with that drop down listing all current linux users to choose from?
__________________
Fedora 11 (Leonidas)

Kernel 2.6.29.6-213.fc11.i686
GNOME 2.26.3

Dell Latitude D630
Memory: 3 GB
Intel(R) Core(TM) Duo CPU T7500 @ 2.20GHz
Reply With Quote
  #6  
Old 6th September 2008, 04:05 PM
forkbomb's Avatar
forkbomb Offline
Registered User
 
Join Date: May 2007
Location: U.S.
Posts: 4,852
Quote:
Originally Posted by majdi
Thanks guys for the info, the files might be hidden in linux but windows clients can see them. I read up on setting up a Samba server and there are a lot of guides on the net on how to do so, but most of them say you have to create the linux users first before creating the samba users.

Then when configuring samba you will choose the linux user from the list and this will link it to the samba user you are creating. I followed this guide setting up samba.

To reduce the steps in the user and folder setup, instead of creating all the users and then all the shared folders, I thought it would be a good short cut to create the user with his shared folder being his home folder on the attached drive when creating the linux users in one step.



This is news to me, but good news because it will make life easier, as I said most of the guides I read will disagree with this, are you sure each samba user dose not need a corresponding linux user on the same server? If so, what will we do, when adding a samba user in the GUI with that drop down listing all current linux users to choose from?
First, I don't know about the GUI config tools. I learned early on in using Linux that distribuiton-specific GUI config tools for popular daemons can be rather quirky so I avoid them and dive into the config files.

As for users, I was sort of right. Here's how I understand it after a little more reading:
There are local users (on the *nix box) and Samba users (used to authenticate from other machines). Samba users are "mapped" to local user accounts on the Unix-like box. When a Samba user authenticates from another machine (like a Windows machine), the Samba daemon will access the local files (on the server) using the authentication creds of the local users and then push them out over the network to the SMB client.

I don't know how to do it, but it may be possible to "map" multiple Samba users to a single (or more if needed) local (server-side Linux) account.

I'm still confused about what you did. Did you make a user with his home dir set to /media/disk/shamim? If you insist on sharing out the home directory of a user, those dot-files are going to be there. Keep in mind that with Samba you can share out whatever directory you want - not just homes. If you're going to be sharing out the home directory of a user who you might locally log in as on the server box, those dotfiles are just unavoidable.

If you're not going to use the local account (the one with /media/disk/shamim as the home) - IE if you just made the user for use with Samba - you can probably safely delete those particular dotfiles you mentioned (without a .bashrc and .bash_logout, when bash initializes, it will fall back to a global config rather than using the user-specific init and logout scripts). Or change the home directory of the local user to something else (but make sure the user still has access to the dierctory you want to share).
What exactly do you need to accomplish? As for your "short cut," it's not saving time. You still need to 1) define a share using the smb.conf config file (or the GUI if you trust it) and 2) make samba users mapped to Linux users, the latter of which you will have to ensure have local access to the share from 1).
__________________
- Tom
"What is freedom? To have the will to be responsible for one's self." - Stirner
Reply With Quote
  #7  
Old 6th September 2008, 05:12 PM
majdi Offline
Registered User
 
Join Date: Feb 2007
Posts: 160
Thanks tjvanwyk,

I want to have a file share server where windows, linux and mac clients can access specific folders assigned to specific users with one folder being a public share for all users to access.

I'm new to Samba so that's why I chose to use a GUI to configure it. The servers internal HD is not big enough for the number of users and file sizes which will be stored, so I attached an external 2TB HD. When I started creating the linux users on the share server I changed the location of the users home folder to the path seen above.

If you know a better way of doing this, please share your experience with us here.

Thanks again.
__________________
Fedora 11 (Leonidas)

Kernel 2.6.29.6-213.fc11.i686
GNOME 2.26.3

Dell Latitude D630
Memory: 3 GB
Intel(R) Core(TM) Duo CPU T7500 @ 2.20GHz
Reply With Quote
  #8  
Old 6th September 2008, 05:57 PM
forkbomb's Avatar
forkbomb Offline
Registered User
 
Join Date: May 2007
Location: U.S.
Posts: 4,852
Familiarize yourself with the smb.conf file if you can. It will make things clearer as to what's precisely going on.

Each share in the smb.conf (full path is /etc/samba/smb.conf) file is defined by its own share name enclosed in brackets followed by options (note that the [global] section is not a share name but contains general Samba configuration parameters).

Personally, I'd create one directory per user on the external and then one directory for the global share, and define the shares' permissions accordingly.

1 dir per 1 user per 1 Samba user.

No need to set your Linux users to have the /media/disk/shamim/foobar as a home dir (assuming they're not going to be signing in locally on the server machine?).

So, basically, I'd do this:
Say you have five users. Make six dirs under /media/disk/shamim:
/media/disk/shamim/jsmith
/media/disk/shamim/ajones
/media/disk/shamim/jdoe
etc.

As long as you don't have too many users, it shouldn't be too odious to set up five local linux users and five samba users.

#6 for the public share:
/media/disk/public

Then have 6 seperate shares defined in your smb.conf (total of 7 sections once you include the [global] section). chown the directories locally so /media/disk/shamim/jjones is owned by jjones (who is both a Linux user and a Samba user). The pub share can be owned by root but give it appropriate ownership for whatever you need (if it's read only, make it read only, i it needs to be written, use permissions like 1777 for /media/disk/public.

Your gui should be able to handle this. But I've never used it.

If you have a lot of users, enlist some help for writing a script. But even if you have a large number of users, it may be be best to just go with one directory and user per Samba share.
__________________
- Tom
"What is freedom? To have the will to be responsible for one's self." - Stirner

Last edited by forkbomb; 6th September 2008 at 06:07 PM.
Reply With Quote
Reply

Tags
acceses, automatically, created, files, samba, user, windows

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
User created desktop files, getting them in the menu.. jason_f Using Fedora 0 1st June 2008 10:41 PM
Automatically created/deleted mountpoints Hrod Beraht Using Fedora 5 26th October 2007 09:23 PM
backup files(~) created automatically for every file i create kfaday Using Fedora 7 8th May 2005 05:09 PM
Want to refresh Samba shares automatically after Windows reboot emmanuel Servers & Networking 4 7th March 2005 06:17 PM


Current GMT-time: 21:19 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat