PDA

View Full Version : FIle Share on Windows


carlwill
2005-02-03, 01:02 PM CST
This is my last Linux project before I am 100% happy in Linux, besides lack of games :( but none the less. I have a Windows XP machine on my Lan (192.168.1.103). This XP machine name is winux (it's a un-original dual boot name) & it has all my files, videos, and mp3's on it.

My main machine in my office is Fedora Core 3 (192.168.1.101). I was told that on this machine, I need to edit /etc/fstab, which happens to look like this.

# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/hdc /media/cdrecorder auto pamconsole,exec,noauto,fscontext=system_u:object_r :removable_t,managed 0 0

I have made a share dir called share in the /mnt dir. mkdir /mnt/share

I read the FAQ and it says I need to add a line in the above file like so:

//server/share /mnt/share cifs exec, credentials=/etc/cifspw,uid=carlos

(I don't know if the //server needs to be the windows server name (winux) and the /share needs to be the share folder name on the windows machine (share)?

Then I create a file called cifspw and saved that in /etc (saved as /etc/cifspw)

username=mywindowsusername
password=mywindowspassword

Can someone comment on my steps in mounting this windows file share?

jayemef
2005-02-03, 03:00 PM CST
The first part is what you are trying to access, and the second is where you want to mount it. So for the first part, you would want it to read //winux/windows_shared directory. The second would be /mnt/share. So your line should read something like
//winux/windows_shared_directory /mnt/share cifs credentials=/etc/cifspw,uid=carlos 0 0

I don't think you need the exec in there. Keep a close eye on whitespace though, as that's how fstab differentiates between the sections. I use tab to keep it all clear and aligned.

Finally, I would suggest running as root
chmod 600 /etc/cifspw
This will change the permissions on your credentials file so that only root can view it. That way others can't come on your machine and find your passwords.

If you fstab works, you should be able to mount your windows directory with the command
mount /mnt/share

If it doesn't work, you can always use the long way:
mount -t cifs //winux/shared_directory_name /mnt/share -o user=your_windows_username

carlwill
2005-02-04, 12:15 PM CST
ok, so now my /etc/fstab dir looks like this...

# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
//winux/share /mnt/share cifs credentials=/etc/cifspw,uid=carlos 0 0


/dev/hdc /media/cdrecorder auto pamconsole,exec,noauto,fscontext=system_u:object_r :removable_t,managed 0 0

I also changed the permissions of the cifspw file like you suggested, I just hope that does not cause a conflict when trying to access the share since it has a restrictive persmission to access the file. I can't test these settings untill I get my new CPOU fan for this Windows machine I am trying to mount but if I have issues, I will be back.

Thanks for your help and if anyone else would like to comment on anything I did, please do so.

jayemef
2005-02-04, 02:15 PM CST
Cool, good luck with it. One word of caution though: I have seen several reports of cifs auto-mounting causing boot time lock-up (and a possible solution going to the graphical boot sequence and pressing enter if it does). I personally always leave my stuff commented out, and just uncomment them when needed (and for the common stuff, I actually wrote scripts and aliased them with commands to mount them quickly and easily). I would recommend testing with the mount /mnt/share command before actually attempting to auto-mount with bootup.

As for the permissions with /etc/cifspw, don't worry. It won't effect anything on the windows side. It just prevents others from getting onto the linux machine and checking the file. Mount will be the only thing reading it, and you need to be root to mount files anyway.