Jump to content

Samba


ozgeek

Recommended Posts

G'Day ! I want to be able to communicate with my Windows box and I think that involves setting up Samba - am I right?I now have my linux apps on a separate computer to WindowsXP Do I need to configure Samba on my Windows box tooWhat Samba files do I need to install on my Linux?I've tried reading various articles that I found on Google and also the Samba site. However, I'm finding them "over my head". Is there a simple straightforward way to do this? TIA Jan

Link to comment
Share on other sites

  • Replies 88
  • Created
  • Last Reply

Top Posters In This Topic

  • daveydoom

    35

  • nlinecomputers

    24

  • ozgeek

    7

  • Bruno

    6

Hi JanThe easiest way I thik is if you install the "drakwizard" in Drake MCC . . .colose the MCC and re-open it . . then you will find an additional section called "servers" . . in that section there is a wizard to set up Samba. ( should be easy )Name: drakwizardVersion: 2.12-3mdkSize: 2891 KBBecause i do not run wiondows, I do not use Samba myself so I can not help you any further then that, but usually the wizards in the server section are pretty straightforward.For aditional ( background ) info, I did find an easy to read guide on the net: http://www.linuxorbit.com/howto/sambahowto.php3and a somewhat more complicated one: http://samba.netfirms.com/B) BrunoPS: Peachy and Nathan are our samba experts :'(

Link to comment
Share on other sites

Thanks, Bruno, I've got the Samba server and client software added and I can see the Samba localhost icon in the windows Network computers. I still haven't worked out the password puzzle. Perhaps Peachy or Nathan might be able to help there. I've downloaded the article from Linux Orbit but the examples they use are from Redhat so aren't the same for Mandrake. Regards Jan

Link to comment
Share on other sites

nlinecomputers
I still haven't worked out the password puzzle.
Hey Jan,Ok what steps did you take to get where you are at now? I use webmin to setup samba some use swat and some just manually edit the smb.conf file.Can you post your smb.conf file?
Link to comment
Share on other sites

I use the same userid and password on my linux box as the account on my win2K box and that seems to let me in without difficulty to the shared directories. Did you add the user and password to Samba (I did it via CLI smbpasswd -a)? Another helpful CLI is smbclient to see the available shares.

Link to comment
Share on other sites

Well done Jan, . . well if you came this far I am sure you will get the last part as well . . for sure if you have the help from Nathan and Elizabeth.( It can not be that difficult either because, remember, samba was written for Windows users ^_^ ;) :worthy: );):worthy: Bruno

Link to comment
Share on other sites

nlinecomputers

The samba password is more important then the Linux passwords. You can force samba to access the Linux file system using a single user or group. But that is overly complicated. I setup a samba group in Linux, grant 770 or 774 rights to the share with the group set to samba. I create both Linux and windows users with matching logon names and passwords and make those users part of the samba group.

Link to comment
Share on other sites

I'm attaching my samba config file. I've put a user password on my Windows system but I've found that the samba icon has disappeared from my Network folder. I don't know whether there's a connection. I'm really at sea with this so any hellp is appreciated.# 1. Server Naming Options:# workgroup = NT-Domain-Name or Workgroup-Name workgroup = MSHOME# netbios name is the name you will see in "Network Neighbourhood", # but defaults to your hostname; netbios name = <name_of_this_server># server string is the equivalent of the NT Description field server string = Samba Server %v# 2. Printing Options:# CHANGES TO ENABLE PRINTING ON ALL CUPS PRINTERS IN THE NETWORK# (as cups is now used in linux-mandrake 7.2 by default)# if you want to automatically load your printer list rather# than setting them up individually then you'll need this printcap name = lpstat load printers = yes# It should not be necessary to spell out the print system type unless# yours is non-standard. Currently supported print systems include:# bsd, sysv, plp, lprng, aix, hpux, qnx, cups printing = cups# Samba 2.2 supports the Windows NT-style point-and-print feature. To# use this, you need to be able to upload print drivers to the samba# server. The printer admins (or root) may install drivers onto samba.# Note that this feature uses the print$ share, and not the printers share,# so you will need to enable it below.# This parameter works like domain admins:# printer admin = @<group> <user>; printer admin = @adm# 3. Logging Options:# this tells Samba to use a separate log file for each machine# that connects log file = /var/log/samba/log.%m# Put a capping on the size of the log files (in Kb). max log size = 50# Set the log (verbosity) level (0 <= log level <= 10); log level = 3# 4. Security Options:# This option is important for security. It allows you to restrict# connections to machines which are on your local network. The# following example restricts access to two C class networks and# the "loopback" interface. For more examples of the syntax see# the smb.conf man page. Do not enable this if (tcp/ip) name resolution does# not work for all the hosts in your network.; hosts allow = ; hosts deny = # Uncomment this if you want a guest account, you must add this to /etc/passwd# otherwise the user "nobody" is used; guest account = pcguest# Security mode. Most people will want user level security. See# security_level.txt for details. security = user# Use password server option only with security = server or security = domain# When using security = domain, you should use password server = *; password server = <NT-Server-Name># Password Level allows matching of _n_ characters of the password for# all combinations of upper and lower case.; password level = 8; username level = 8# You may wish to use password encryption. Please read# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.# Do not enable this option unless you have read those documents# Encrypted passwords are required for any use of samba in a Windows NT domain# The smbpasswd file is only required by a server doing authentication, thus# members of a domain do not need one. encrypt passwords = yes smb passwd file = /etc/samba/smbpasswd# The following are needed to allow password changing from Windows to# also update the Linux system password.# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.# NOTE2: You do NOT need these to allow workstations to change only# the encrypted SMB passwords. They allow the Unix password# to be kept in sync with the SMB password. unix password sync = Yes passwd program = /usr/bin/passwd %u passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*# Unix users can map to different SMB User names; username map = /etc/samba/smbusers# Using the following line enables you to customise your configuration# on a per machine basis. The %m gets replaced with the netbios name# of the machine that is connecting; include = /etc/samba/smb.conf.%m# 5. Browser Control and Networking Options:# Most people will find that this option gives better performance.# See speed.txt and the manual pages for details socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192# Configure Samba to use multiple interfaces# If you have multiple network interfaces then you must list them# here. See the man page for details.; interfaces = 192.168.12.2/24 192.168.13.2/24 # Configure remote browse list synchronisation here# request announcement to, or browse list sync from:# a specific host or from / to a whole subnet (see below); remote browse sync = 192.168.3.25 192.168.5.255# Cause this host to announce itself to local subnets here; remote announce = 192.168.1.255 192.168.2.44# set local master to no if you don't want Samba to become a master# browser on your network. Otherwise the normal election rules apply; local master = no# OS Level determines the precedence of this server in master browser# elections. The default value should be reasonable; os level = 33# Domain Master specifies Samba to be the Domain Master Browser. This# allows Samba to collate browse lists between subnets. Don't use this# if you already have a Windows NT domain controller doing this job; domain master = yes # Preferred Master causes Samba to force a local browser election on startup# and gives it a slightly higher chance of winning the election; preferred master = yes# 6. Domain Control Options:# Enable this if you want Samba to be a domain logon server for # Windows95 workstations or Primary Domain Controller for WinNT and Win2k; domain logons = yes# if you enable domain logons then you may want a per-machine or# per user logon script# run a specific logon batch file per workstation (machine); logon script = %U.bat# run a specific logon batch file per username; logon script = %U.bat# Where to store roaming profiles for WinNT and Win2k# %L substitutes for this servers netbios name, %U is username# You must uncomment the [Profiles] share below; logon path = \\%L\Profiles\%U# Where to store roaming profiles for Win9x. Be careful with this as it also # impacts where Win2k finds it's /HOME share; logon home = \\%L\%U\.profile# The add user script is used by a domain member to add local user accounts# that have been authenticated by the domain controller, or by the domain # controller to add local machine accounts when adding machines to the domain.# The script must work from the command line when replacing the macros,# or the operation will fail. Check that groups exist if forcing a group.# Script for domain controller for adding machines:; add user script = /usr/sbin/useradd -s /bin/false %u# Script for domain member for addig local accounts for authenticated users:; add user script = /usr/sbin/useradd -s /bin/false %u# 7. Name Resolution Options:# All NetBIOS names must be resolved to IP Addresses# 'Name Resolve Order' allows the named resolution mechanism to be specified# the default order is "host lmhosts wins bcast". "host" means use the unix# system gethostbyname() function call that will use either /etc/hosts OR# DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf# and the /etc/resolv.conf file. "host" therefore is system configuration# dependant. This parameter is most often of use to prevent DNS lookups# in order to resolve NetBIOS names to IP Addresses. Use with care!# The example below excludes use of name resolution for machines that are NOT# on the local network segment# - OR - are not deliberately to be known via lmhosts or via WINS.; name resolve order = wins lmhosts bcast# Windows Internet Name Serving Support Section:# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server; wins support = yes# WINS Server - Tells the NMBD components of Samba to be a WINS Client# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both; wins server = w.x.y.z# WINS Proxy - Tells Samba to answer name resolution queries on# behalf of a non WINS capable client, for this to work there must be# at least one WINS Server on the network. The default is NO.; wins proxy = yes# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names# via DNS nslookups. The built-in default for versions 1.9.17 is yes,# this has been changed in version 1.9.18 to no. dns proxy = no # 8. File Naming Options:# Case Preservation can be handy - system default is _no_# NOTE: These can be set on a per share basis; preserve case = no; short preserve case = no# Default case is normally upper case for all DOS files; default case = lower# Be very careful with case sensitivity - it can break things!; case sensitive = no# Enabling internationalization:# you can match a Windows code page with a UNIX character set.# Windows: 437 (US), 737 (GREEK), 850 (Latin1 - Western European),# 852 (Eastern Eu.), 861 (Icelandic), 932 (Cyrillic - Russian),# 936 (Japanese - Shift-JIS), 936 (Simpl. Chinese), 949 (Korean Hangul),# 950 (Trad. Chin.).# UNIX: ISO8859-1 (Western European), ISO8859-2 (Eastern Eu.),# ISO8859-5 (Russian Cyrillic), KOI8-R (Alt-Russ. Cyril.)# This is an example for french users:; client code page = 850; character set = ISO8859-1#============================ Share Definitions ============================== [homes] comment = Home Directories browseable = no writable = yes# Un-comment the following and create the netlogon directory for Domain Logons; [netlogon]; comment = Network Logon Service; path = /var/lib/samba/netlogon; guest ok = yes; writable = no; share modes = no#Uncomment the following 2 lines if you would like your login scripts to#be created dynamically by ntlogon (check that you have it in the correct#locationn (the default of the ntlogon rpm available in contribs);root preexec = /usr/bin/ntlogon -u %U -g %G -o %a -d /var/lib/samba/netlogon;root postexec = rm -f /var/lib/samba/netlogon/%U.bat# Un-comment the following to provide a specific roving profile share# the default is to use the user's home directory;[Profiles]; path = /var/lib/samba/profiles; browseable = no; guest ok = yes# NOTE: If you have a CUPS print system there is no need to # specifically define each individual printer.# You must configure the samba printers with the appropriate Windows# drivers on your Windows clients. On the Samba server no filtering is# done. If you wish that the server provides the driver and the clients# send PostScript ("Generic PostScript Printer" under Windows), you have# to swap the 'print command' line below with the commented one. [printers] comment = All Printers path = /var/spool/samba browseable = no# to allow user 'guest account' to print. guest ok = yes writable = no printable = yes create mode = 0700# =====================================# print command: see above for details.# ===================================== print command = lpr-cups -P %p %s # using cups own drivers (use generic PostScript on clients). print command = lpr-cups -P %p %s # using cups own drivers (use generic PostScript on clients). lpq command = lpstat -o %p lprm command = cancel %p-%j# This share is used for Windows NT-style point-and-print support.# To be able to install drivers, you need to be either root, or listed# in the printer admin parameter above. Note that you also need write access# to the directory and share definition to be able to upload the drivers.# You must disable (by commenting out) the share above if you enable this.# For more information on this, please see the Printing Support Section of# /usr/share/doc/samba-2.2.1a/docs/Samba-HOWTO-Collection.pdf # Please note that this has not yet been tested as packaged here with CUPS.;[print$]; path = /var/lib/samba/printers; browseable = yes; read only = yes; write list = @adm root# This one is useful for people to share files;[tmp]; comment = Temporary file space; path = /tmp; read only = no; public = yes# A publicly accessible directory;[public];comment = Public Stuff;path = /home/samba/public;write list = @wheel;read list = nobody, @users;guest ok = no

Link to comment
Share on other sites

nlinecomputers

Jan,Most of your needed functions are present in the file but commented out. The ";" or the "#" makes the line a comment and thus is ignored by samba.

# netbios name is the name you will see in "Network Neighbourhood",# but defaults to your hostname; netbios name = <name_of_this_server>

You need a netbios name for your computer. For example my computer is named "ares" so my line is

netbios name = ares

Most of the rest of the file looks ok as is but you don't have any shares defined and working other then your /home directories. Is that all you wish to share?This is my smb.conf file you might want to compare it to yours. My is clean and without comments so that might make it easier to read:

# smb.conf is the main Samba configuration file. You find a full commented# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE# Date: 2004-07-21[global]   workgroup = mshome   printing = cups   printcap name = cups   printcap cache time = 750   cups options = raw   printer admin = @ntadmin, root, administrator   username map = /etc/samba/smbusers   map to guest = Bad User   logon path = \\%L\profiles\.msprofile   logon home = \\%L\%U\.9xprofile   logon drive = P:   security = user   encrypt passwords = yes   server string = Samba Server   netbios name = ares   add machine script =    domain master = false   domain logons = no   local master = no   preferred master = auto   load printers = no   ldap suffix = dc=example,dc=com[homes]   comment = Home Directories   valid users = %S   browseable = no   read only = No   inherit permissions = Yes   guest ok = no   printable = no[profiles]   comment = Network Profiles Service   path = %H   read only = No   store dos attributes = Yes   create mask = 0600   directory mask = 0700   browseable = yes   guest ok = no   printable = no[users]   comment = All users   path = /home   read only = No   inherit permissions = Yes   veto files = /aquota.user/groups/shares/   browseable = yes   guest ok = no   printable = no[groups]   comment = All groups   path = /home/groups   read only = No   inherit permissions = Yes   browseable = yes   guest ok = no   printable = no[pdf]   comment = PDF creator   path = /var/tmp   printable = yes   print command = /usr/bin/smbprngenpdf -J '%J' -c %c -s %s -u '%u' -z %z   create mask = 0600   browseable = yes   guest ok = no;; [printers];;   comment = All Printers;;   path = /var/tmp;;   printable = yes;;   create mask = 0600;;   browseable = no;;   guest ok = no[print$]   comment = Printer Drivers   path = /var/lib/samba/drivers   write list = @ntadmin root   force group = ntadmin   create mask = 0664   directory mask = 0775   browseable = yes   guest ok = no   printable = no[data]	force user = root	comment = Data Store	writeable = yes	write list = @users	path = /data	force group = users[winlaser]   browseable = yes   path = /var/tmp   printable = yes

Note the sections labeled [homes] and the [users] section above. [Homes] limits the user to his personal home directory. [users] allows everyone to browse the other users home directories but Linux file access rules will limit the damage you can do. I have one file share and one printer share. [data] is my file share. [winlaser] is my printer share I have a HP4L printer hooked into my server. I've found that for windows printing to that printer is was better to just set up a RAW print driver in CUPS and let windows handle the print drivers locally.Also I ask again. What steps did you do so far? Did you run Mandrake's MCC tool? Did you use SWAT? Have you edited the /etc/samba/smbusers file and the /etc/samba/smbpasswd file?

Link to comment
Share on other sites

Also I ask again.  What steps did you do so far?  Did you run Mandrake's MCC tool?  Did you use SWAT?  Have you edited the /etc/samba/smbusers file and the /etc/samba/smbpasswd file?
Hi Nathan, I've installed the Drake sever wizards and configured Samba. I haven't edited the /etc/samba/smbusers or the /etc/samba/smbpasswd mainly because I don't know what to enter in those files.I'll go through your samba.conf file and compare with mine and uncomment those lines that need this.I install SWAT but don't know what to do with it or where to find it. Many thanks for your help, Jan
Link to comment
Share on other sites

nlinecomputers

Open a browser like firefox and goto http://localhost:10000 or you might need https://localhost:10000login as root with your root password. if that don't work try a blank password.Once in webmin you'll see a tab marked servers.After that you should get an icon marked Samba Windows File Sharing.Once there you get a big control panel for samba. At the bottom is a samba user section. You can create and edit samba users there.If you look around at all the settings you should see that functions match what is in your smb.conf file. It is a whole lot easier to setup samba with webmin.

Link to comment
Share on other sites

Nathan, I got in OK. I need to put in a Samba user but there doesn't appear to be the means to do that. Do I have to edit the samba.conf file first? Jan

Link to comment
Share on other sites

nlinecomputers

Sorry forgot that webmin only lets you edit existing users when you have encrypted passwords. But you can make all of your Unix users into samba users.On the main samba page there should be a icon for "Convert Unix Users to Samba Users"Run that and select "For newly created users, set the password to: No password"Once you do that go back to the Edit samba users and passwords icon. You should now see your Unix users. You can then edit each one so that the samba password is the same as your Unix password.After you do that you might want to use the Configure Automatic Unix and Samba Synchronization so that any changes to a user you make in Webmin will also change in Samba. Do that and if you use webmin to edit or create a user then that user is updated with the correct passwords and rights in Samba. Is webmin cool or what? :w00tx100:

Link to comment
Share on other sites

  • 3 weeks later...
logon as root or su and do this:/etc/webmin/startnow try it.
All righty then :P . I'm trying to get Samba up and going also.I've installed webmin but when I browse to /etc/webmin there's nothing in that directory. Did I do something wrong?? :P :url:
Link to comment
Share on other sites

Good :url: . Now, any reason why there are no files in /etc/webmin? Because there is nothing there, when I type /etc/webmin/start in the konsole nothing happens :P

Link to comment
Share on other sites

Well, you can type "ps -A" in a Konsole window and see if the Webmin process is running.By nothing happening, you meant you did not get an error, right?

Link to comment
Share on other sites

Using "ps -A" shows a bunch of things but not webmin.Actually, I did get an error when I typed in /etc/webmin/start. It was No such file or directory. I assumed that happened simply because there are no files in that directory, so it can't start.

Link to comment
Share on other sites

Hmm.. I installed webmin and started it, but I did not see anything when using ps -A. Are you sure it is installed? I have a whole mess of files here in the /etc/webmin dir. You always could try uninstalling it and reinstalling.

Link to comment
Share on other sites

You couls also do this:

From the "K" menu (or SuSE menu) select Control Centre -> Yast2 Modules -> Network Services -> Network Services (inetd). Go into Administrator mode with your root password. It will also allow you to install any services that didn't get installed originally.
See if Webmin is listed, and if it is, start it.
Link to comment
Share on other sites

I had already tried uninstalling webmin and then reinstalling again with the same results. I'm trying inetd right now ;)EDIT: it wasn't listed, so I added it. Unfortunately there are still no files in the webmin directory. Am at a loss here. Any ideas what I should do next?

Link to comment
Share on other sites

nlinecomputers

AAAUUUGHHH! :bounce:Sorry but everybody is leading you down the wrong path. You aren't going to see on a suse box webmin running because you haven't finished installing it yet. SuSE unlike most distros doesn't prep the webmin package for use. (only real gripe I've got with Suse...) On SuSE you've got to do this your self.You've done the first step.Now take a shell prompt and type su then the root password to setup yourself as the super userthen type:/usr/lib/webmin/setup.shFollow the prompts. Most prompts should be obvious or the default.When the script is finished THEN you can do the command /etc/webmin/start Once webmin is running open your favoriate web browser and do http://localhost:10000

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...