LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   Samba success (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/samba-success-306139/)

gvaught 03-25-2005 09:48 PM

Samba success
 
This may be documented elsewhere, but I didn't find it all together.

The first thing I did was spend some time reading the Samba docs. I highly recommend this.
But, if you're a bit ADD like myself these tips could help avoid hours/days/weeks trying to
figure it out by T&E.

I'm not going to go into how to install the programs on your "server", as the docs are pretty
good at going through that AND it's not difficult to get them running. The difficulty comes in
getting them configured. sigh

(1) I installed the Samba server and daemon on my "server" box. When this is done, make
sure BOTH smbd and nmbd are in your process list (ps ax).

(2) Install SWAT on this same system and make sure it is running, also.

(3) When you're sure smbd and nmbd are running on your "server", go to a box with a GUI (I
didn't try this on the same box, so I can't comment on how it works) and a web browser - ON
THE SAME NETWORK. In the address bar, put in the IP address of the "server" and the
Samba port number (901) as follows:
Code:

192.168.1.1:901
Then you should be able to log in as root and make the changes necessary to the Samba
configuration (mostly in General and Shares) and commit them. Once the changes are
commited (written to the smb.conf file) you need to go to the Status section and restart smbd.

Use of SWAT is highly recommended - once I got this working, the rest of configuring
the server fell into place (and the guess work vanished).


(4) When you're pretty sure you have your configuration set on your server, test your setup
with a Windows box. (Start>Run, '//server' should list the shares available in the drop list) If
you don't have a Windows box on your network, you really don't need Samba - you can
use NFS. Once you can mount the shares in Windows, make sure you have samba,
smbfs and smbclient installed on your Linux client/remote computer. I don't know
for sure if they're all necessary for mounting a Samba share, but I did end up with all three on
my box and I believe they're all helpful.
samba - needed to even consider accessing a system with SMB shares
smbfs - without this, you'll never get anything to mount
smbclient - this was a great troubleshooting tool - it allowed me to see that the
shares were there, accessible, and focus on my client-side configuration instead of guessing
that my server was good-to-go

(5) For the sake of all that keeps us sane - get the syntax for mounting the shares correct.
Once I figured out what I was doing incorrect, I could have kicked myself for blowing the
syntax for weeks.
Code:

mount -t smb //server/share /mount/point -o username=xxxxxx,password=xxxxxx
user and name won't work - it has to be username.

This is not, by any means, an exhaustive HOW-TO on Samba - it's meant to show (1) the
stumbling blocks I ran into and (2) how to avoid the pain and suffering I went through.

XavierP 03-27-2005 05:58 AM

Cool. Have you thought about submitting this to the Linux Tutorials section?

gvaught 03-27-2005 06:43 PM

No, I thought the point of "success" stories was to provide guidance and explain how we, the users, got through problems. If it's more appropriate for Tutorials, that's fine.

XavierP 03-28-2005 04:41 AM

It is a ppropriate for this section, but by leaving it here, it will get buried under all the other stories. By putting it in Tutorials, it becomes easy to find.

gvaught 04-02-2005 12:16 AM

I'll look and see if I can find instructions on how to "move" a thread.

Major point of note:
You must add users to your samba server before they will be able to access the shares. I have spent the past three days struggling with a server that was working as Slackware 9.1, then I rebuilt it with Debian Sarge (easier distro from my perspective). I had saved (and reused) my /home fs (which housed all of the shares) and had backed up my samba config files to my home directory. I attempted to re-use these, since I knew they worked. But I continually got this stinkin' dialogue box asking for my username password - and then refused to accept my valid (Linux) username and password.

The key thing to watch for, from my experience, is the dialogue asking for a username and password when you try to open your share (esp. if it *was* working).

I strongly suggest making the Linux, Windows, Samba and/or domain usernames and passwords the same, to reduce the number of logins required. At least, for home or small business networks and while learning. Larger companies may get some benefit from a separate Samba password, but that's more advanced than I am, or what I feel comfortable in advising users on.

Now, for the meat of this post - how to add users to your samba server so they can connect:
Code:

smbpasswd -a <username>
After that, you'll be asked to enter their samba password, twice. Once done, they're in and should be able to mount the share from their Windows box.

Some FYI for folks wondering why I do this. First of all, why am I sharing here? I need to document (somewhere "off site") what I've done so *I* can come back and figure out how to do this, again, when I need to do it again. Plus, I feel I should give back after all of the help I've received here.

Second, the samba server allows me to have access to my files whether I'm in Windows or Linux - the same files. So I don't have to have two copies. I don't have to reboot into Windows to download a file for Windows. And it gives me a great place to store my music and photos (which also happens to be my web and ftp server) to share with everyone else on the network. And them to share their files with me.

I hope this helps SOMEONE besides me. If not, sorry to bore you. :)

XavierP 04-02-2005 11:58 AM

The Tutorial section is seperate from the forums. You will have to submit it anew to Tutorials> It can't even be moved by a Mod.


All times are GMT -5. The time now is 11:50 AM.