Basic configuration of SAMBA, add accounts etc (LMDE)

Write tutorials and howtos in here
More tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please, Before you post please read this

Basic configuration of SAMBA, add accounts etc (LMDE)

Postby linXea on Thu Dec 09, 2010 6:53 am

Samba – How-to (Linuxmint Debian)

First of all you need samba installed which it usually is by default. If it shouldn’t be installed please open a terminal now.

    $ sudo apt-get install samba


Now we’re going to work with the configuration of samba. Before you start, make sure that samba isn’t running. To make sure it isn’t running you can perform following command.

    $ sudo /etc/init.d/samba stop

The samba-config file can be found in /etc/samba/smb.conf. If you open the file already there you’ll see that it is a template. We’re going to use it as base for further configuration. It can be a good idea to make a backup of the file before you start.

    $ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf-orginal

To start the configuration we need to start an editor. Using gnome, use gedit and if you’re using kde, use kate or kwrite. If you prefer cli-enviroment nano and VIM will work just fine. I am going to use kate here.

    $ sudo kate /etc/samba/smb.conf


Now edit the file appropriate to your desired settings. Set workgroup and so on. When you’re finished remember to save the file of course. After that you need to start samba.

    $ sudo /etc/init.d/samba start

Now add yourself as an user. When you’re prompted for a password, use the same as you use for your login.

    $ sudo smbpasswd -L -a yourusername
    $ sudo smbpasswd -L -e yourusername

If you need other users to be able to access the share you need to add them to your computer and to samba as well. Make sure you use the same windows username and password.
Example

    $ sudo useradd -s /bin/true user2
    $ sudo smbpasswd -L –a user2
    $ sudo smbpasswd -L -e user2

The "-s /bin/true" in the first line prevents the users from being able to access the commandline of your linux box ("-s" stands for "shell Don't change that setting to a valid login-shell unless you really know what you are doing)
Last edited by Oscar799 on Fri Dec 10, 2010 12:32 pm, edited 1 time in total.
Reason: Made sticky
Image
Dektop: AMD Quad-Core, 4GB RAM, ATI HD3650silent, 33TB harddrive
Laptop: Lenovo Thinkpad x201, Intel core2centrino P9600, 4GB RAM, 750gb
User avatar
linXea
Level 3
Level 3
 
Posts: 182
Joined: Mon Aug 31, 2009 7:06 am
Location: Uppsala, Sweden

Linux Mint is funded by ads and donations.
 

Re: Basic configuration of SAMBA, add accounts etc

Postby altair4 on Thu Dec 09, 2010 8:06 am

I really don't like to go into another persons HowTo because I think that's rude and more importantly I wouldn't want that to happen to me :wink: Having said that I hope you don't mind some constructive criticism.

Your post would be 100% accurate only for Linux Mint Debian Edition and I would recommend stating that at the beginning. The reasons for that are as follows:

[1] There is no "samba" service in Ubuntu-based Mint only in Debian-based Mint. In regular Mint samba has been replaced with it's component daemons: smbd and nmbd

[2] In Ubuntu-based Mint smbd is not controlled by Sytem V - it's controlled by Upstart. If you did a "sudo /etc/init.d/smbd stop" it will fail with an error message telling you it's now an Upstart job. So for Ubuntu-based Mint to stop samba it would look like this:
Code: Select all
sudo service smbd stop


[3] This is more a difference of opinion rather than criticism.
Now add yourself as an user. When you’re prompted for a password, use the same as you use for your login.

$ sudo smbpasswd -L -a yourusername
$ sudo smbpasswd -L -e yourusername

I don't think a person should ever add himself to the samba password database and if he does so it should not have the same password as his login password. It's probably my obsession with security and privacy :wink: . Also there's no need to add ( -a ) and enable ( -e ) using smbpasswd since the -a operator does both by default.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6080
Joined: Tue Feb 03, 2009 10:27 am

Re: Basic configuration of SAMBA, add accounts etc

Postby linXea on Thu Dec 09, 2010 9:55 am

Your post would be 100% accurate only for Linux Mint Debian Edition and I would recommend stating that at the beginning.


Indeed it was written to be used on debian. I wrote it years ago and since I've got a lot of questions about it lately on the IRC-channels I thought I would upload it. I appreciate your "constructive criticism". I will further add new stuff to this how-to later on like interaction between Linux & Windows using WINS. I will also attach a custom simplified smb.conf.

cheers
Image
Dektop: AMD Quad-Core, 4GB RAM, ATI HD3650silent, 33TB harddrive
Laptop: Lenovo Thinkpad x201, Intel core2centrino P9600, 4GB RAM, 750gb
User avatar
linXea
Level 3
Level 3
 
Posts: 182
Joined: Mon Aug 31, 2009 7:06 am
Location: Uppsala, Sweden

Re: Basic configuration of SAMBA, add accounts etc (LMDE)

Postby oobetimer on Thu Dec 09, 2010 12:38 pm

I made a very simple instruction about installing a samba server .. :lol:

Click the picture and watch a video .. :D

Image
Last edited by oobetimer on Sat Jan 22, 2011 4:30 am, edited 1 time in total.
User avatar
oobetimer
Level 7
Level 7
 
Posts: 1889
Joined: Tue Jun 01, 2010 12:53 pm
Location: Finland / above the Arctic Circle

Re: Basic configuration of SAMBA, add accounts etc (LMDE)

Postby pythagorean on Sat Dec 11, 2010 8:56 pm

I just copyied the conf file from my Mint 10 virtual box over to my LDME install and it works fine.
pythagorean
Level 3
Level 3
 
Posts: 150
Joined: Tue Mar 23, 2010 2:36 am
Location: Chicago

Re: Basic configuration of SAMBA, add accounts etc (LMDE)

Postby kwisher on Sun Dec 12, 2010 12:58 pm

Here is a link to my Samba Server How-To. It is based from my Mint-5 Gnome install so it is a little dated, but can still be adapted for Mint/Ubuntu/Debian. The only thing I do differently now is that I do not use the Samba GUI system-config-samba. In fact, this GUI is not available in LMDE.

http://www.kwdesign-consulting.com/Files/Samba%20How-To.zip

linXea,

I am not trying to hijack your post here and I apologize for posting a link for my how-to. I see a lot of posts in regards to Samba/Windows file sharing. I wish there was an easier way for new users to accomplish this and would not have to always post new questions to the forum.
The instructions suggested Windows XP or better, so I installed Linux :)
User avatar
kwisher
Level 5
Level 5
 
Posts: 635
Joined: Wed Mar 05, 2008 12:54 pm
Location: Greentown, Indiana USA

Re: Basic configuration of SAMBA, add accounts etc (LMDE)

Postby linXea on Sun Dec 12, 2010 1:36 pm

I am not trying to hijack your post here and I apologize for posting a link for my how-to. I see a lot of posts in regards to Samba/Windows file sharing. I wish there was an easier way for new users to accomplish this and would not have to always post new questions to the forum.


I appreciate it, anything to make it easier for new users. The reason I posted it was to be able to use the link on #linuxmint-help (IRC). I know there are others (probably much better how-to's around) but for me to be able to more effectively help on IRC I wanted to post my own.

Cheers
Image
Dektop: AMD Quad-Core, 4GB RAM, ATI HD3650silent, 33TB harddrive
Laptop: Lenovo Thinkpad x201, Intel core2centrino P9600, 4GB RAM, 750gb
User avatar
linXea
Level 3
Level 3
 
Posts: 182
Joined: Mon Aug 31, 2009 7:06 am
Location: Uppsala, Sweden

Linux Mint is funded by ads and donations.
 

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 0 guests