samba setup

New to Debian (Or Linux in general)? Ask your questions here!

samba setup

Postby DeirdeReilly » 2009-12-03 18:16

Hey guys,

Im completely new to linux, learning on debian... and trying to find out howto set up a samba server, i want to be able to set up a NetBIOS server name with the name deirde

And then how would I be able to setup a share on this so I can share files?

Thanks guys! :D
DeirdeReilly
 
Posts: 5
Joined: 2009-12-03 18:10

Re: samba setup

Postby Absent Minded » 2009-12-03 18:27

Hello and welcome to Debian and the Forum. There are several ways to accomplish what you want. Will you be running a GUI or just the CLI or headless? I personally like to use a package called Webmin to configure SAMBA. However, if you are upto the challenge you can do it all by hand after reading the SMABA config file.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012
User avatar
Absent Minded
 
Posts: 3758
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.

Re: samba setup

Postby DeirdeReilly » 2009-12-03 18:35

yes I'm trying to do it by manually editing the smb.conf through command line.
DeirdeReilly
 
Posts: 5
Joined: 2009-12-03 18:10

Re: samba setup

Postby csaba » 2009-12-03 18:53

The fastest way (and also the most unsecure) for me to make a working samba configuration on debian stable/lenny is as follows:

As root:
Code: Select all
# apt-get install samba
# vi /etc/samba/smb.conf

Instead of vi you could use whichever editor you preffer.

here search for the line which starts with
Code: Select all
# security=

and after the equals sign enter the word "share" and delete the # sign from the begining of the line

now you must also define your shares by inserting a few lines for every share like this:
Code: Select all
[samba-rw-share]
comment = RW share
browseable = yes
writable = yes
path = /path/to/folder/you/want/to/share
guest ok = yes


samba-rw-share will be the name of the share, browseable and guest ok lines are required for samba to not ask for any passwords whatsoever when connecting to the share. path is the path to folder which you would like to share. and also if you include the writeable line your share will be writable also. There are a bunch of other options also, i suggest reading man smb.conf.

I would like to empasize again that this is the most unsecure way one could set up samba (but the fastest), but if you have a home network with a few machines only for your own usage, there is no particular danger setting up samba like this. At least this works for me.

cheers..

Edit: i forgot, after you make these changes you must restart samba. As root:
Code: Select all
# /etc/init.d/samba restart
Omnes homines natura scire desiderant.
User avatar
csaba
 
Posts: 127
Joined: 2007-08-02 05:30

Re: samba setup

Postby DeirdeReilly » 2009-12-03 19:05

Ok, I'll give that a go, Thanks!
DeirdeReilly
 
Posts: 5
Joined: 2009-12-03 18:10

Re: samba setup

Postby dilberts_left_nut » 2009-12-03 20:49

Also the SWAT pkg (Samba Web Admin Tool) is an easy (and with good help) way to set up your basic config and administer shares & users.
Runs on port 901 (by default) and access it with any browser.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 5086
Joined: 2009-10-05 07:54
Location: enzed

Re: samba setup

Postby DeirdeReilly » 2009-12-04 13:31

csaba wrote:


That work perfectly thanks!
Now I just need to be able to change the netbios name, any ideas?
I tried putting in netbios name = Deirde but when I restart the server it doesnt change?
DeirdeReilly
 
Posts: 5
Joined: 2009-12-03 18:10

Re: samba setup

Postby DeirdeReilly » 2009-12-04 16:46

oh I cant seem to mount it on my other machine

I put

//ipaddres/media/ /mnt/media smbfs defaults 0 0

but it says

mount: wrong fs type, bad option, bad superblock on //ipaddres/media/,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

any ideas?
DeirdeReilly
 
Posts: 5
Joined: 2009-12-03 18:10

Re: samba setup

Postby csaba » 2009-12-04 17:50

I presume that you have already installed the smbfs package with the package manager of your choice, so that cannot be the issue in your setup.

i use this format in /etc/fstab to mount a share and it works for me:
Code: Select all
192.168.1.3:media /media/loop smbfs defaults 0 0


But i also tried your format of giving //ip.address/share, and that works for me too flawlessly.

You could try mounting the share manually also and not from fstab to see what it sais, by:
Code: Select all
# mount -t smbfs //ip.address/sharename /some/where

or

# mount -t smbfs ip.address:sharename /some/where


Also you could try swapping everywhere smbfs for cifs, to see will that work out for you.
You could also post the result of dmesg | tail, just after you've tried to execute the mounting of the share, to see what is the exact error message.

Good luck..
Omnes homines natura scire desiderant.
User avatar
csaba
 
Posts: 127
Joined: 2007-08-02 05:30


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable