PDA

View Full Version : how to set up samba?


deeps
2005-05-09, 08:29 AM CDT
hey,

i'm a linux n00b and am trying to work out how to configure samba for file sharing.

I've tried google, and have found some stuff, but i'm at an absolute loss.

can someone explain to me how to get this whole thing going?

Thanks in advance

AndyGreen
2005-05-09, 08:33 AM CDT
iptables -I INPUT -p tcp --dport 137:139 -j ACCEPT
service iptables save

yum install samba system-config-samba

chkconfig smb on

system-config-samba

click Add Share...

service smb start

w5set
2005-05-09, 08:33 AM CDT
Don't have a clue myself--(as usual)
but you could try reading here--bookmark it!
http://www.linuxhomenetworking.com/linux-hn/samba.htm#_Toc91165134

deeps
2005-05-09, 09:37 AM CDT
when i type in the iptables command, it says bad command or file name

seems a gd article, i shall give it a read nnow

thanks

deeps
2005-05-09, 10:01 AM CDT
hmm ok, i don't have swat installed and i cant for the life of me work out how to install it, where to dl it from or anything?

i didn't exactly install samba either...i dl'd the rpm and it says "a newer version of samba is already installed"

and there is no swat installed anywhere....

AndyGreen
2005-05-09, 10:31 AM CDT
system-config-samba is a simplified equivalent to swat.

Please make sure you become root by

su -

the - is important. Then iptables will work fine.

deeps
2005-05-09, 10:43 AM CDT
ok cool, i THINK it worked, can't get to the windows box atm... but when i turn off the comp...and turn it back on, do i have to do nething new?

or is this saved?

cheers

AndyGreen
2005-05-09, 10:48 AM CDT
If you did all the steps, it should come back exactly the same on subsequent boots.

deeps
2005-05-09, 11:16 AM CDT
cool, i'll give it a go tomorrow morn

thanks alot!

RHamel
2005-05-09, 11:40 AM CDT
Samba comes with a lot of documentation:

file:///usr/share/doc/samba-3.0.10/htmldocs/index.html

deeps
2005-05-09, 09:00 PM CDT
ok cool, now the winxp comp can see my samba server, but it can't access it

it says "you dont have the required permission to access localhost etcetc."

is there something i have to do to allow permissions?

deeps
2005-05-09, 09:02 PM CDT
oh and i can't see the winxp share


will try with a win98 pc now

deeps
2005-05-09, 09:15 PM CDT
all fixed! i dont know wat i did, but it works ;)

wow

thanks!!!

how do i set linux up to see the winxp box?

the other windows boxes are already working amonst each other (winxp talks to win98 and vice versa)

EDIT:

it died again... i didn't change anything at all, it's coming with the old error again :(

then after a while it fixed itself up, and then immediately died again.... ugh

deeps
2005-05-10, 02:47 AM CDT
/bump

ok here's the situation now

the Linux machine is talking to the win98se machine and vice versa no problems

The win98se and winxp machines are talking to each other no problems (the xp machine is slow when it goes into network neighbour hood for some reason)

The linux box can SEE the XP box, and vice versa...but cannot access the files.

It keeps saying something about permissions


an interesting point is that on my linux box, i can see "localhost" which is the linux box... when i double click i get the following error.

The folder contents could not be displayed.
"Windows Network: localhost" couldn't be found. Perhaps it has recently been deleted.

AndyGreen
2005-05-10, 02:54 AM CDT
"localhost" is a really poor hostname when more than one machine is involved. Where is it coming from? /etc/samba/smb.conf? Or do you need to add a name to /etc/hosts on the 127.0.0.1 line? Eg

127.0.0.1 myhostname localhost.localdomain localhost

Also set HOSTNAME in

/etc/sysconfig/network

Simplest way may be to reboot after that.

deeps
2005-05-10, 03:25 AM CDT
yay! ok now the xp machine can access the linux box

linux still can't access winxp though!

aaalmost there!

AndyGreen
2005-05-10, 03:28 AM CDT
The linux box can SEE the XP box, and vice versa...but cannot access the files.

It keeps saying something about permissionsIt seems you mean that the XP box will not LET the linux box access it. What exactly is the error.

deeps
2005-05-10, 03:38 AM CDT
The folder contents could not be displayed.

You do not have the permissions necessary to view the contents of "Windows Network: computer".



i turned off all firewalls and all

guest account is ON for the xp machine as well

AndyGreen
2005-05-10, 03:45 AM CDT
Where is this message coming from? Some kind of file manager?

Bring up a root terminal window.

mkdir /mnt/xp
mount -t cifs //123.123.123.123/sharename /mnt/xp -orw,username=xpuser,password=password

change 123.123.123.123 to your XP machine IP and xpuser and password to your XP user credentials.

deeps
2005-05-10, 03:52 AM CDT
[root@deeps ~]# mount -t cifs //192.168.0.3/sharename/mnt/xp - orw,username=Deeps,password=hi
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .




the error msg pops up in a error dialogue box

b00st
2005-05-10, 03:54 AM CDT
This may help a few. I had to go to application>system settings>security level

###not sure if this part matters####
click on check box for your network device (for me was eth0)
under trusted devices
########################

then under other ports enter 445:tcp (port windows uses to share files,printers, etc...)

Did that and all a sudden everything worked like a charm.

P.S. I use system-config-samba with authentication set to share (no login required).

AndyGreen
2005-05-10, 03:54 AM CDT
You missed out the space between sharename and /mnt/xp

deeps
2005-05-10, 03:57 AM CDT
[root@deeps ~]# mount -t cifs //192.168.0.3/sharename/ mnt/xp - orw,username=deeps,password=hi
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .
[root@deeps ~]#


same msg :S


i dont have the firewall on at all, so eth0 is already a trusted device i belive?

deeps
2005-05-10, 03:58 AM CDT
something tells me it's an xp error...except that the win98 box can use the xp box with no problems..

AndyGreen
2005-05-10, 04:00 AM CDT
Lol... go back and look at post #19 REALLY CAREFULLY... maybe get a cup of coffee...

deeps
2005-05-10, 04:07 AM CDT
lol i typed it again and still got the same error, so i c+p and changed the stuff i needed, and got myself another error msg!

[root@deeps deeps]# mount -t cifs //192.168.0.3/sharename /mnt/xp -orw,username=Deeps,password=hi
mount error 6 = No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

AndyGreen
2005-05-10, 04:11 AM CDT
You need to change

sharename

into your actual share name.

deeps
2005-05-10, 04:17 AM CDT
ook that one worked! yay!

:S


any way of getting it working normally though?

AndyGreen
2005-05-10, 04:20 AM CDT
Don't know, since you did not define what program was giving you these errors "normally".

One way to come at it is to mount the xp share at boot and access it through /mnt/xp

deeps
2005-05-10, 04:25 AM CDT
hmm

it says "error displaying folder" in the titlebar

and a red stop sign with a white cross across it..... that's all i know as far as what program is displaying it?

AndyGreen
2005-05-10, 04:27 AM CDT
Nope, I reckon you know a bit more if you try... are you using Gnome/Nautilus? Or KDE/Konqueror? or something else? Clicking on the desktop?

Anyway I'll leave that problem to someone else: you can go on with the /mnt/xp method if you like.

deeps
2005-05-10, 04:31 AM CDT
nautilus i believe!

Thanks for all your helP!