Samba command line

Place to discuss Fedora and/or Red Hat

Samba command line

Postby cdhgold » Thu Apr 24, 2003 9:29 am

I'm using Redhat 9 with Samba services running. I used the GUI tools in GNOME to set it up but am still learning how to manage things command line. How can i go about managing my samba config including fileand printer sharing via the command line and not the GUI?

Chris
Thanks in Advance :P
User avatar
cdhgold
administrator
administrator
 
Posts: 382
Joined: Tue Mar 18, 2003 6:11 pm
Location: Texas

Postby Tux » Thu Apr 24, 2003 10:05 am

Use you favourite command line text editor to edit the files in /etc/samba/

EDIT: had to change my post, I was half talking about mysql!!! Damn i'm tired.
Last edited by Tux on Thu Apr 24, 2003 2:09 pm, edited 1 time in total.
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby cdhgold » Thu Apr 24, 2003 10:14 am

can you recommend a editor and how to pull it up hate sounding like complete noob but am not familiar with command utils YET in linux.

Chris
User avatar
cdhgold
administrator
administrator
 
Posts: 382
Joined: Tue Mar 18, 2003 6:11 pm
Location: Texas

Postby Void Main » Thu Apr 24, 2003 10:25 am

I didn't even know there was a Gnome GUI for configuring Samba, in fact I don't seem to have one. Checking over the install CD I notice there is now a "redhat-config-samba" so I installed it. I personally don't use any of the Red Hat GUI tools but I am extremely pleased they are there to help the new people out who wouldn't otherwise touch Linux.

I have always edited the /etc/samba/smb.conf file directly with VIM. I have one linux machine set up as a PDC/WINS/DHCP/DYNDNS server and the rest are set up a "security=SERVER" and authenticate against the PDC (like a PDC and member servers in the M$ world). But I really don't use Samba much at all any more since I don't use Windows any more. I do still use the domain usernames/passwords for proxy authentication though.

Couple of things to note if you want to switch from a GUI configuration tool to editing the config file directly. Most GUI tools will wipe all the good comments out of a default config file and I would suggest you find a copy of the default installed "smb.conf" file and use it as a starting point. It is well documented and has some good examples in it. Also use the man pages starting with this one:

$ man smb.conf

and then look over all the other man pages in the "SEE ALSO" section at the bottom of the above man page.

On a side note, I believe "swat" to be the best GUI for configuring Samba although I still prefer using VIM and directly editing the smb.conf file. But swat gives you "all" the options and is much more complex than the Red Hat supplied GUI. "swat" is actually part of the Samba project so it should be the definitive GUI. It is web based and you must enable the swat service for it to work. If you have it enabled then to access it in your browser you would go to:

http://localhost:901
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Calum » Thu Apr 24, 2003 10:37 am

as void main says, vim is good for editing text files. to start it type "vim", or use "vi" - they're not that intuitive though, i would recommend using "pico", "jpico" or "nano" instead, but nano doesn't come with red hat and pico will only be there if you installed the "pine" package. or there's always "emacs" (or its clones "jove" and "jmacs") which again isn't that intuitive.

to learn how to use vim, simply type "vimtutor" at a command prompt, or for a similar experience in emacs, type "emacs" then Ctrl-h "T") that's control and H then T if you get my meaning).
sorry this has nothing to do with samba, but that's the run down on *nix file editors as i see it. there's a ton of other ones, but i haven't got any further than vim and emacs yet myself.
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby Calum » Thu Apr 24, 2003 10:39 am

Most GUI tools will wipe all the good comments out of a default config file and I would suggest you find a copy of the default installed "smb.conf" file and use it as a starting point. It is well documented and has some good examples in it. Also use the man pages starting with this one:
yes, i noticed this too. when i had red hat, the XF86Config file that anaconda created had a lot less interesting comments in it than the one i generated using xf86config, for example.
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby Doogee » Thu Apr 24, 2003 11:23 am

hey, trying to sound ontopic here.



How can i add a samba user thing?

When my ms using family clicks on my computer (not the MS my computer, literally my computer) they get a password thing.
Doogee
administrator
administrator
 
Posts: 261
Joined: Fri Jan 10, 2003 1:40 am

Postby Void Main » Thu Apr 24, 2003 12:03 pm

Doogee wrote:How can i add a samba user thing?

When my M$ using family clicks on my computer (not the M$ my computer, literally my computer) they get a password thing.


That's way not enough information, but to answer what I think your question is you could go to the tool in this topic "redhat-config-samba" GUI which is a graphical way to configure Samba and add Samba users:

http://www.redhat.com/docs/manuals/linu ... uring.html

Of course it would just use the underlying smbpasswd command.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby cdhgold » Thu Apr 24, 2003 12:22 pm

First of all THANK YOU. You both have given some great info to go on. I apprecaite you both taking the time to write out as much infO as you did. I'm at work now but will use your advice when I get home. Thanks again!! People like you are one of the main reasons I hAve gotten as far as I hAve with linux so far. THanks again long live linux and a horrible death to bill and his kind!

Chris
LONG LIVE LINUX, UNIX, AND NETWARE
User avatar
cdhgold
administrator
administrator
 
Posts: 382
Joined: Tue Mar 18, 2003 6:11 pm
Location: Texas

Postby Doogee » Thu Apr 24, 2003 6:59 pm

Void Main wrote:
Doogee wrote:How can i add a samba user thing?

When my M$ using family clicks on my computer (not the M$ my computer, literally my computer) they get a password thing.


That's way not enough information, but to answer what I think your question is you could go to the tool in this topic "redhat-config-samba" GUI which is a graphical way to configure Samba and add Samba users:

http://www.redhat.com/docs/manuals/linu ... uring.html

Of course it would just use the underlying smbpasswd command.



What more info do you need?

When someone tries to access my computer over MS Network they get a user and pass login box coming up.

i want to either
1: get rid of it
2: set a password and username
Doogee
administrator
administrator
 
Posts: 261
Joined: Fri Jan 10, 2003 1:40 am

Postby Void Main » Thu Apr 24, 2003 7:25 pm

Well, there are several types of M$ networks for one. You have basic share level workgroups (which I never use), you have standalone servers, you have NT domains, you have Active directory, etc.. I use a domain controller and member server type of setup and each person logs in with their own ID and password and then I grant varying levels of access to those users depending on their need. Then you have the Windows client, that is, are you using 9x, NT, 2k, XP or what? Are they configured properly for the type of Windows network you want to set up? But I no longer do Windows so I'm afraid I can't be of much help there. I've never touched XP so I wouldn't know if it will even work with Samba, I assume it does. It helps to already have an understanding of Windows networking.

I suggest you go through the steps in the Red Hat manual as that is one of the simplest Samba configuration pages I have ever seen. If you log onto your Windows machine with username "joblow" and password "password" and have configured Samba with the same username and password according to that Red Hat Samba configuration page it should not prompt you for a password.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Calum » Fri Apr 25, 2003 4:44 am

i was reading my manual for windows for workgroups 3.11 and their networking for that system is total mince, or at least that's the way it is explained. it's all big diagrams and pictures of John accessing a file that Ann has just saved et c. All dumbed down and no actual helpful information about getting it working. Plus all the hardware advice is about thinwire too. I hope more recent windows networks have got better documentation than this (and this is the official WFWG3.11 manual, not just some jumped up rubbish online article). I wouldn't mind finding out about windows networking, just like i wouldn't mind finding out about linux and other networking, as i think networking is intrinsically more platform independent than single machine stuff, it's just protocols and software that can deal with those protocols, on whatever platform, but incomprehensible or patronising documentation isn't a help.

sorry, i think i went off topic again :oops:
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby Void Main » Fri Apr 25, 2003 9:04 am

Yeah, you aren't going to get any useful information from the manuals that come with Windows. If you want useful information you need to purchase the resource kits (which I have). I believe the one I had purchased for NT Server contained around 4 or 5 hefty books and a couple of CDs (and about $125). One large book is on networking where they give a fairly detailed level of information on NetBIOS, NetBEUI, TCP/IP, NetBF, NetBT, DHCP, MSDNS, WINS, WORGROUPS, PDC, BDC, RAS, Master Browser pecking order, etc, etc, etc.

Win 3.11 used "Workgroups" and you could even get "Workgroups for DOS" and the easiest thing to set up out of the box for a small local network using a few Win 3.11 machines is Share Level Workgroups using the NetBEUI protocol. You create shares and you put a password on the share and anyone who wants to connect to that share has to know the share password. This is peer to peer networking because everyone can create a share on their machine and everyone else can connect to it. This is a nightmare to manage if your network is more than just a few machines.

To solve the above nightmare you might have purchased an NT server and created users on that NT server. Instead of putting a password on a share you would specify which users had access to that share. Now the user must log on to their Win3.11 machine with the same username and password that they have configured on the NT server and when the user connects to the NT server a challenge/response will verify that the passwords match between the two systems and grant an appropriate level of access based on the access you have defined for that user.

Now when your network grows to the size where you have many servers and your users can connect to any of them it would be a nightmare to have to set up matching user accounts on all of the servers so this is where Domains came in. You have one primary machine called a Primary Domain Controller (PDC) and if you are smart a Backup Domain Controller (BDC) who's primary responsibility is to manage user and machine accounts. Machine accounts only for Windows NT workstation/server or above, 9x and below can not be domain members but you can still log in to the domain. Basically you have a checkbox on your 9x client to specify that you participate in a domain and on NT and above you make the machine itself a member of the domain. Whichever the case you will need to log into the domain as well as the local machine (if you do it right you will only be prompted for a userid/password once on 9x and below). All other NT servers should be members of the domain and you will then be able to specify which domain users have access to which shares without having to add accounts for those users on every server. Once you have logged in to the domain you will be able to access any shares that you have been give access to based on your domain login ID.

Now this is just a very rough overview and I won't even attempt to go over Active Directory or WINS or details of Workgroups and how they are different if you use NetBEUI vs if you use TCP/IP. Basically what I am trying to get at is Windows Networking can be extremely complex. And to tell you the truth I am not much interested in it at the moment because I no longer use Windows. The easiest thing I can see is to follow the document on Red Hat's site where the go through setting up one type of the above mentioned networking. I didn't see where they took you through configuring the Windows client. This part "should" be in the Windows manual but I'll bet it's not. You can certainly find this information on M$s web site and their Knowlege Base has a wealth of information. I haven't been there for a long time but when I used and supported Windows I was in there constantly. Another good resource was the online O'Reilly Samba manual which did show you how to configure your Windows client but I think it's a little dated and doesn't cover WinXP which if you understand Windows networking shouldn't be that difficult to figure out on your own.

Moral of the story: Just because it says "Microsoft Windows" on the box and no matter how easy they tell you it is, it is not. Microsoft software is more complex and prone to problems because of it's complexity than anything else I have seen.

Note: The above was extremely painful for me. I hate to talk about Windows and in order to talk Samba you have to talk Windows since that is why you want to set it up. I really don't want to talk Windows so I would suggest searching the Internet and keep plugging. All I can say is that you *can* make it work the way you want. I don't have the magic answer to your problem because I don't know enough about your a) smb.conf b) client OS and network settings c) configuration goal. All I can say is keep plugging and Samba can be very hard or very easy depending on your need and your level of understanding of Windows networking. If you have the NT Server resource kit memorized Samba is a breeze. Of course it can also be a breeze if you follow a simple document for a basic setup like the one on Red Hat's site. If it doesn't work I can only assume you do not have your Windows machine configured properly. If you are really stuck I might suggest buying a book on Samba. I have seen several at the book store, some of them pretty sizable. Here is a list of documentation including books:

http://us2.samba.org/samba/docs/
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Fedora/Red Hat

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron