LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-29-2007, 01:22 AM   #1
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 274

Rep: Reputation: 30
Mount Windows Share on RHEL4


Hey all,
I know this is a bad subject for a linux forum, but im looking to mount a windows folder from my LAN onto my Linux machine.

I have set to share a folder on my Windows Box. And I ran "findsmb" on my enterprise 4 machine. It found nothing.

Basically im just looking to share certain folders FROM windows TO linux.

THanks so much!
 
Old 07-29-2007, 05:59 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 57
That's because RHEL does not support for some of the older smb utils any more, one as to install rpm packages built from the samba.org source for in order to use the findsmb utility. You should use the IP address of the Windows shares for mounting, you can get this information from the Windows system(s) by typing: ipconfig /all

Remember to use cifs instead of smbfs when mounting also;
Example:
Code:
mount -t cifs //192.168.1.10/D /mnt/Desktop -o credentials=/etc/cifs.txt -rw

Last edited by Lenard; 07-29-2007 at 06:02 AM.
 
Old 07-29-2007, 12:03 PM   #3
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 274

Original Poster
Rep: Reputation: 30
Hey,
I have the 2.6.9-42 kernel. Do i still need CIFS?

I have not heard much about it, and google doesn't seem to know that much either.

DO i need to open firewall rules on the windows box?
when i ran the mount command, it asked for a password. I tried all my passwords, as the remote user and as the admin user. Neither worked.

Thanks for the help
 
Old 07-29-2007, 12:37 PM   #4
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 31
You've got RHEL4 so thats so nice.
As Lenard said you'll need CIFS.

so for example you have a share on windows called test and you use easy filesharing.
The ip of the windows system is 192.168.1.1
then you can do this on your linux rhel4 in order to mount it.

Quote:
Create a Mountpoint
mkdir /mnt/winshare

then do a
mount -t cifs //192.168.1.1/test /mnt/winshare
to see the windows shares you can issue the command
Quote:
smbclient -L 192.168.1.1
you'll be asked for a password (just press enter)
If you don't have simple fileshare enabled on your windows system you'll have to mount like
Quote:
mount -t cifs //192.168.1.1/test /mnt/winshare -o username=yourusername on windows,password=his password
more details man mount.cifs
 
Old 07-29-2007, 01:35 PM   #5
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 274

Original Poster
Rep: Reputation: 30
WOW, FANTASTIC
I had to do the following:

Code:
mount -t cifs //IP/share /mnt/point -o username=user
and that mounted it.
However it asked for the password the username, which is fine now. However how can i automake this in /etc/fstab and make it so I dont need the password??


Thanks so much
 
Old 07-29-2007, 03:56 PM   #6
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 274

Original Poster
Rep: Reputation: 30
For those interested i found the solution to mount in /etc/fstab.

Add password file (anywhere really). I add in /etc/samba/smbpasswd (even though samba has nothing to do with cifs.

Code:
username=user
password=pass
then mount via the following:

Code:
$mount -t cifs //domain/share /mount/point -o credentials=/etc/samba/smbpasswd
 
Old 07-29-2007, 08:42 PM   #7
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 57
And the entry in the /etc/fstab file follows like the examples given already;

//domain/share /mount/point cifs rw,credentials=/etc/samba/smbpasswd 0 0
 
Old 07-30-2007, 12:55 AM   #8
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 31
Talking

Quote:
Originally Posted by Lenard
And the entry in the /etc/fstab file follows like the examples given already;

//domain/share /mount/point cifs rw,credentials=/etc/samba/smbpasswd 0 0


domain...
? better use the host name instead and if dns or the host file isn't setup correct use the IP.

BTW - Don't put the credentials file in a home dir cause it isn't accessible at this time when the fstab is issued.
 
Old 08-03-2007, 08:54 AM   #9
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Rep: Reputation: 15
and what happens if the share is unavable during the linux machine reboot? if the line is added in the fstab? the linux machine will halt boot correct?

somewhere, not sure where. I read a way to set it up where the shared drive is only mounted on demand. or somthing like that.

for example

if you have a linux machine that does a backup at 12 midnight and uses kbackup to do it, when it starts the backup it issues the mount then unmount when done.


am I off base?? sounds nice, but cant find where I read that.

my only concern is the fact that if the share is an external Hard drive on the windows network and the drive isnt attached or its turned off, and fstab dont see it during boot then it would be a pain to get the linux machine to boot. correct?
 
Old 08-03-2007, 07:40 PM   #10
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
Quote:
Originally Posted by blizunt7
Add password file (anywhere really). I add in /etc/samba/smbpasswd (even though samba has nothing to do with cifs.
well - AFAIK, Common Internet File System/CIFS is SAMBA.

why you can mount remote share in /etc/fstab --> it because you already have access from SAMBA : mount -t cifs remember?

cheers
 
Old 08-04-2007, 07:12 AM   #11
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 57
Errr..........credentials=/etc/samba/smbpasswd is simply a path (/etc/samba) to a file named (in this case) smbpasswd which reads like;

username=fred
password=mypassword
 
Old 08-05-2007, 10:20 AM   #12
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Rep: Reputation: 15
ok i got the share to mount with this

mount -t cifs //192.168.1.10/maxtor /mnt/winshare

but like what was stated before i need to hit enter because it asks for a pass, there is not pass so i hit enter and it mounts. (great)

but i want to use fwbackup to run at 2am and i want to set it to mount the drive before it starts backing up and unmount when it is finished,
when i tryed the code below and after i made the smbpasswd file it gives me a ton of option that i am not sure of...also i nothed that when i use

umount -t cifs //192.168.1.10/maxtor /mnt/winshare
to unmount the share ...it wont unmount i can still see it in the /mnt/winshare


Quote:
//domain/share /mount/point cifs rw,credentials=/etc/samba/smbpasswd 0 0
 
Old 08-05-2007, 06:16 PM   #13
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 57
Errr.....no! it is not: umount -t cifs //192.168.1.10/maxtor /mnt/winshare

The proper command is something like: umount /mnt/winshare
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS mount of smb mount of windows share: permission denied problem :( Bagatur Linux - Networking 4 07-07-2009 11:34 AM
Trying to mount a Linux share on Windows sambauser Linux - Server 2 06-01-2007 04:24 AM
Cannot mount Windows Share!! charles20hk Linux - Networking 3 11-29-2006 03:03 AM
when trying to mount a windows share I'm getting jcombs_31 Slackware 11 01-04-2006 06:48 PM
mount windows share in FC2 danielson Linux - Networking 1 02-04-2005 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration