LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 04-16-2003, 05:10 AM   #1
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Rep: Reputation: 30
sharing directories - samba help!


OK, I just got a router a few days ago.

Here is my setup:

Linksys router - dhcp

I have two computers hooked up already

they are 1- win xp pro/ red hat 7.3 2 - suse 81. pro

I already have the first system setup so I can see all of my windows files in red hat 7.3 What I would like to do is be able to see my windows files in suse 8.1 pro on the other computer (I have a ton of mp3's on there and it would be nice to play them while on the other computer)

I know this is probably not difficult but I have never done this before thru linux. I have done it thru windows to windows, but I have progressed nicely into a linux guy since then.

Any help would be appreciated.

Last edited by yowwww; 04-16-2003 at 04:58 PM.
 
Old 04-16-2003, 05:51 AM   #2
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
You want samba!

With samba installed you can use mount to mount the remote share on your suse machine.

from memory it would go something like this

mount -t smbfs -o username,password //remotepc/share /mnt/dir

Rich
 
Old 04-16-2003, 06:03 AM   #3
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Original Poster
Rep: Reputation: 30
OK, great, I have heard tons about samba but never really knew what it was about, only that it had to do with servers or filesharing - neither of which I was doing at the time.
I will read up on Samba and figure it out.

Thanks a lot for your response.
 
Old 04-16-2003, 02:41 PM   #4
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Original Poster
Rep: Reputation: 30
OK, some more questions...

Do I need to install Samba on all distros I plan to use?

Right now I have this setup

computer one

hda1 - win xp pro
hdb1 - my mp3's
hdb2 and so on - red hat 7.3

computer two

hda1 - suse 8.1


So here's what I want - I want to be able to see my Windows (hda1) and mp3 (hdb1) partitions while on suse 8.1. I already have access to those same partitions on my red hat 7.3 install cause I mounted those thru fstab.

So how do I get access to them in suse?
I installed samba on my red hat - do I need to install it on suse too?

Please be simple yet specific with this as I am new to Samba.
Thank you.
 
Old 04-16-2003, 07:01 PM   #5
azornoz
Member
 
Registered: Apr 2003
Posts: 52

Rep: Reputation: 15
From suse you only need to do one of the following commands to access the shares on your windows:
smbmount
mount -t smbfs
smbclient //remotepc/share
The last one is the one that I use, in the ftp style: you just get into the remote machine and get the files to a local dir.
The two first commands are likely the same, you already were told. Take a look at the man pages about the usage.
You are going to use samba in suse only like client, perhaps u don't need to install full samba, nevertheless it's good to be able to serve files from suse to windows, but it's not the only solution, you have ftp too.
 
Old 04-17-2003, 12:29 AM   #6
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Original Poster
Rep: Reputation: 30
ok, I have the windows part done. I have also selected which folders I want to share and configured them to do so.

Now what I want to do is enable suse on my other system to be able to see them. Will that be really complicated? How do I do that? Is there an easy to use how-to on this till I get the hang of it?
 
Old 04-17-2003, 12:39 AM   #7
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
as azornoz said you can use smbmount or mount -t smbfs

smbmount is deprecated, basically replaced by mount -t smbfs which is a good thing coz you can use that in your fstab on the suse box.

you need to create a share on the windows xp machine and then connect to that share from the suse box. If you are running in redhat then you can mount those drivers and share them with NFS. The tricky part is with file permissions.

On my machine at home I have a similar setup with mp3 files on a vfat partition that I have to mount locally using the gid option in fstab. The probel mis when I try to mount this from another linux box over NFS I stuggle with permissions need to have matching groups and uid's, bit of a pain to set up to be honest. I have been tempted to try setting up this drive as a share off the linux box and mount it with mount -t smbfs on the other box but that just seems wrong ;-)
 
Old 04-17-2003, 12:57 AM   #8
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Original Poster
Rep: Reputation: 30
ok, so here are a few things to add and ask...

1 - so do I need to install samba on my suse box or not?
2 - I can add "mount -t smbfs" to my suse fstab and it will see the folders I have designated as shared in windows? once done - how do I access those folders on my suse machine that are on windows? where do i look for them?
3 - I don't have to do anything with my red hat because I have already mounted my windows and mp3 partitions in fstab and have full read/write access as user in it.
4 - I only want to be able to see the files and use them in suse I don't need r/w permissions so if that is a hassle, I just won't do it.
5 - I will be adding another box at some point probably with a dual boot red hat and win xp pro on it. I'm thinking that will win xp pro I will just have to install the network software and then I will automatically see those folders as shared - but what about red hat on that dual boot system I may add.

Thanks a lot for the information.

Last edited by yowwww; 04-17-2003 at 01:30 AM.
 
Old 04-17-2003, 01:45 AM   #9
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
Quote:
Originally posted by yowwww
ok, so here are a few things to add and ask...
1 - so do I need to install samba on my suse box or not?
yup you do, you will need it to do other stuff espicially when you are first setting it up and testing with smbclient.
Quote:
2 - I can add "mount -t smbfs" to my suse fstab and it will see the folders I have designated as shared in windows?
ummm soft of, if you have a look at the example above it gives you the basic syntax, depends whether you need a password or not, whether it can find the win xp machine based on its ip or wether it needs to be specified etc. You best bet is to start with smbclient and work your way up. have a look at the samba website under documentation there is a collection of howto's which pretty much cover everything you need to know.
Quote:
3 - I don't have to do anything with my red hat because I have already mounted my windows and mp3 partitions in fstab and have full read/write access as user in it.
ok so hopefully you can export these as NFS shares, you probably have NFS installed, if not chuck it on and check out the HOWTO at The Linux Dcoumentation Project
Quote:
4 - I only want to be able to see the files and use them in suse I don't need r/w permissions so if that is a hassle, I just won't do it.
I have problems with read permissions as well, but see how you go it may not be a problem for you (I run gentoo linux so everything is built from scratch, the RPM's no doubt have pre-configured setups that may work out of the box).
Quote:
5 - I will be adding another box at some point probably with a dual boot red hat and win xp pro on it. I'm thinking that will win xp pro I will just have to install the network software and then I will automatically see those folders as shared - but what about red hat on that dual boot system I may add.
ok well same thing as the suse box set up samba, mount the remote shares etc.

it does get kinda tricky to have a bunch of rebootable pc's that you need to mount (if you don't umount them before you reboot the other pc then mount will probably lock).

Are any of the PC's on all the time? If you it may be easier to set up a central file store rather than having bits and pieces all over the place. I have thrre desktops at home and a notebook that gets connected every so often, two of these are on all the time and one has two large hard drives so this has become a central file store for the whole network. This file server has samba and NFS setup so it can easily share with both windows and linux without fuss, same shares, always on, easy.
 
Old 04-17-2003, 01:53 AM   #10
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Original Poster
Rep: Reputation: 30
ok, so is smbclient the interface that i need to use to set everything up? I've never used it before so I would I just open it after I have installed samba with "smbclient" in the term or as a run command?

Also, yes, there is one system at least that will be on all the time. It is the one with suse on it.
 
Old 04-17-2003, 12:17 PM   #11
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Original Poster
Rep: Reputation: 30
ok, I installed all of these files in suse:

http://master.samba.org/samba/ftp/Bi...SuSE/i386/8.1/

and I also added this to my fstab:

mount -t smbfs -o //remotepc/share /mnt/mainframe

I created the dir /mnt/mainframe in suse

do I leave "remotepc" as the same or do I change it to the name of that computer, I took out the user name and password cause I don't want to be prompted for that.

thanks for all the assistance on this.
 
Old 04-17-2003, 08:10 PM   #12
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
Quote:
Originally posted by yowwww
ok, I installed all of these files in suse:

http://master.samba.org/samba/ftp/Bi...SuSE/i386/8.1/

and I also added this to my fstab:

mount -t smbfs -o //remotepc/share /mnt/mainframe

I created the dir /mnt/mainframe in suse

do I leave "remotepc" as the same or do I change it to the name of that computer
ok some basic info. Windows uses the SMB network file system (hence the name SaMba) which uses the following concept for connections

\\computer_name\service

the computer_name is the name giving to the pc (in control panel, networking, identification). The service refers to the share (this could be a file share or a printer)

if you have a pc called bob and have shared c:\mp3 on this pc and called the share mp3 then you could access it from another windows pc by hitting start,run and typing in \\bob\mp3.

this concept can be taken to the linux smb clients as well. Literally from smbclient you can type

smbclient //bob/mp3 and you should end up connected to the remote machine as you would have been from the windows pc. now the windows pc will open up a explorer window and show you the files contained on bob in the c:\mp3 directory. the linux interface is a little different because you are running a command line client you get an ftp style interface (not unlike the command prompt interface under windows if you are used to that).

Now for the slightly tricky part, win xp pro has two different file sharing techniques, and I can't remember the names off hand, basically on is called simple file sharing (or something like that), the other is called professional or advanced file sharing (ok I am guessing now I really can't remember ;-)) anyway the simple file sharing is like the old win 98 style, give it a name, tell it whether on not a password is required and that is that. The advanced style is a little more involved needing a matching username/password pair on each login. This can actually be cached by windows so you type it in the first time and that is that. There is no caching capability in linux so you need to type this username/password pair in each time.

This is where smbclient comes in. If you type in the example above (obviously changing the computer_name and share to suit your setup) it will ask for a password. If there is no password simply hit enter. If there is a password then you will need to enter one.
NOTE: the user name it will use is the username you are currently logged in to linux with. So if you are looged on as yowwww then unless yo have a matching username on your windows box you will not get in. There is commandline option to smbclient that allows you to specify a different username (it is -U username) so you may need this.

Once you have managed to log in you will know what you need to use the mount command.

Quote:
I took out the user name and password cause I don't want to be prompted for that.
OK well as I mentioned above you will need to have something here. You need to replace the username with a valid username and may need to replace the password with a valid password.

play with smbclient first and get your head around the way that works before tring to get mount to work.

Rich
 
Old 04-17-2003, 08:21 PM   #13
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Original Poster
Rep: Reputation: 30
Thanks for all that info.

I don't have a username that I log on as in windows that I know of - if I do, it is just "default" or something like that. I can check that later to be sure.

The name of the computer for windows is "Mainframe" (meant to be funny)

When I set up the folders I wanted to share, I opted to not use a username and password for them. However, I think I only granted read access to them (I'm pretty sure I remember an option to grant higher privs but I chose not to).
When I was done, I had three folders that were shared:
1- My Shared Folder (the deafault one)
2- Picture Shows
3- D:\ (my whole D drive which has my mp3's on it)

I didn't have to name any of these folders. I use windows xp professional.
In redhat linux 7.3, my logon name is 'charles'
I am not sure about windows, I didn't specify anything.
 
Old 04-18-2003, 12:14 AM   #14
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
if you have the simple network sharing setup then I am pretty sure that the username is arbitrary so you may not need to specify anything, I would recommend setting the shares to be one word, makes it much easier to attach to otherwise you will have to use escape characters to type in the share name,

so maybe called picture show, pictures and d drive just d for example.

this way you can mount say the d drive with

smbclient //mainframe/d

(note that when I have been refering to linux i have used forward slashes and when I have been referring to windiws I have backslashes, don't mix them up!).

oh, and if you didn't name the shares windows will have named them smething, nornally what the folder is called.
 
Old 04-18-2003, 12:30 AM   #15
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Original Poster
Rep: Reputation: 30
ok, I am starting to get this now (finally)

I ran smbclient on my suse machine and it displayed the IP,bcast, and nmask.
It listed a bunch of commands which was nice to see.

I have renamed the folder on my windows box from "Picture Shows" to "movies".
My username on the windows box is "User" and the computer name is "downstairs", the workgroup is "HOME".

Now, I want to mount those two folders, so I have created on my suse box /mnt/mainframe - will both of the folders on the windows box automatically go into this directory or should i create /mnt/mainframe/movies and /mnt/mainframe/d

also I am sharing my whole "d" so it doesn't really have a name like the other folder. It shows MUSIC (D on the windows box - so what would it's name be when I mount it in fstab? I know it might be easier if I just created a folder in D: and call it "music" and then deposit all of my folders in there. If that is not necessary, I would like to leave things the same.

I am rather confused with the fstab entry actually. Does it not work the same way as it does for mounting drives from windows to linux on the same box - ie: "mount hda1 /mnt/windows"?

don't you need to tell it where to put the folder and which one in windows so it can be directed to linux?
or does samba just know which ones because they are automatically designated as shared?

Last edited by yowwww; 04-18-2003 at 12:33 AM.
 
  


Reply



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
Sharing directories with NFS paddyjoy Linux - Newbie 6 08-14-2005 03:06 AM
Sharing directories outside of /home... AudioMechanic Linux - Networking 1 03-16-2005 08:18 PM
Sharing MS-Win directories with Linux guarriman Linux - Newbie 5 01-04-2005 08:35 AM
sharing directories not in $HOME GTBlackwell Linux - Networking 2 10-23-2003 06:21 PM
Sharing directories between XP and Mandy 9.1 AnandKM Linux - Newbie 2 09-18-2003 02:33 AM

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

All times are GMT -5. The time now is 06:29 AM.

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