TOPIC: Samba Configuration - Linux/Windows Connectivity

Samba Configuration - Linux/Windows Connectivity 16 Mar 2008 02:41 #79155

  • sadistikal's Avatar Topic Author
  • sadistikal
  • Online
  • Senior Boarder
  • Senior Boarder
  • Posts: 424
  • Thanks: 0
Samba Configuration - Linux/Windows Connectivity

by Tammy Fox
Last Modified: Wednesday, 19-May-2004 11:54:13 EDT

Introduction
Samba can be used to allow connectivity between Linux and Windows(95,98,NT,2000). Samba can be used to share printers, share directories, connect to an NT domain, and many other useful features. However, this tutorial explains the steps involved in basic configuring Samba for file and print sharing. For more complex topics, visit the Samba website or type the command man smb.conf on a Linux machine with Samba installed. Configuring Samba is done by editing the configuration file /etc/smb.conf that is usually located under the /etc directory. Everytime you modify this file, Samba must be restarted for the changes to take effect.
Basic Samba Information
Starting, Stopping, and Restarting Samba
Most Linux distributions come with scripts to start, stop, and restart Samba properly. If yours does not, use the commands under the Optional Commands column

Runlevel Script Optional Command
Start Samba /etc/rc.d/init.d/samba start /usr/sbin/smbd -D and /usr/sbin/nmbd -D
Stop Samba /etc/rc.d/init.d/samba stop killall -TERM smbd and killall -TERM nmbd
Restart Samba /etc/rc.d/init.d/samba restart killall -HUP smbd and killall -HUP nmbd
Samba Log Files
All Samba actions such as login attempts and file transfers can be logged in the /var/log/samba directory. Under this directory the actions are logged by machine name. For example, all actions from the machine named \"Morpheus\" are logged in the file /var/log/samba/log.morpheus. User actions can also be logged under two files named /var/log/log.smb and /var/log/log.nmb. This is configured in the smb.conf file using the option log file. For example, to log actions by machine name use the following line:
log file = /var/log/samba/log.%m
Windows Workgroup
You can specify which Windows Network Neighborhood Workgroup your Linux machine is seen in and the description of the machine by editing the following lines in smb.conf:
workgroup = WORKGROUPNAME
server string = MACHINE DESCRIPTION
Access Control
smb.conf can be used to allow and deny access by IP addresses. This is done by listing IP addresses or subnets on the lines beginning with hosts allow and hosts deny. Examples:
Example Explanation
hosts allow 192.168.10.0/255.255.255.0 Allow all hosts in the given network/netmask
hosts allow 160.210 EXCEPT 160.210.24.56 Allow all hosts beginning with 160.210 except 160.210.24.56
hosts allow 192.168.10 192.168.20 allow all hosts beginning with 192.168.10 or 192.168.20
hosts deny 130.74 deny all hosts beginning with 130.74


Using Samba with Windows NT 4.0 Service Pack 3 or higher
Samba can be configured to send plain-text passwords or encrypted passwords. The Microsoft SMB protocol originally used plain-text passwords. However, with Service Pack 3 or higher for Windows NT 4.0, they changed the protocol to use encrypted passwords. Samba must be configured for this to connect to Windows NT 4.0 machines. One way to do this is to modify the NT registry; however, if you choose this option all NT machines must be configured to use plain-text passwords which is time-consuming and might cause conflicts elsewhere. The easy way to handle this is to configure Samba to send encrypted passwords. This can be done with the following steps:

1. Create a separate password file for Samba based on your /etc/passwd file. This will create Samba users for every user that already exists on your system. To do this by executing the command cat /etc/passwd | mksmbpasswd.sh > /etc/smbpasswd. The script should be in the /usr/bin directory or you can get it here.
2. Make sure only root has permission to read and write to the Samba password file with the command chmod 600 smbpasswd.
3. The script does not copy the passwords. To set the Samba password for each users thus enabling their Samba accounts, use the command smbpasswd username for each user.
4. Edit the smb.conf file to include the two lines
encrypt passwords = yes
smb passwd file = /etc/smbpasswd
5. Restart Samba with /etc/rc.d/init.d/smb restart


Print Sharing from Linux to Windows
The following section is usually included in the sample smb.conf that allows printers defined in the /etc/printcap file to be shared. If not add/uncomment the following lines in smb.conf:
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no

Then, just restart Samba and add the Linux printer to a Windows machine as you would any other Window's shared printer. The printer name will be the same name specified in the /etc/printcap file such as lp.

Creating a Common Share Directory for Multiple Users
You can create a share directory more than one user has permission to view. This is similar to a Linux/Unix group definition. The best way to explain this is to show an example:
[myshare]
comment = Share for John and Sam
path = /usr/share
valid users = john sam
public = no
writable = yes
printable = no
create mask = 0765

This shares the directory /usr/share for only the users john and sam. It is writable which means both john and sam have write permissions to the shared directory. Any files/directories created in the shared directory will have the permission 0765.

Connecting to a Samba Machine in Linux
To connect to a Samba machine (Windows or Linux running Samba) from the command line, execute the command (replace MACHINENAME and sharename with the appropriate values)
smbclient //MACHINENAME/sharename

If you want to pass a different username to the Samba Server, execute the command (replace username with your username).
smbclient //MACHINENAME/sharename -U username

If a password is associated with the username, you will be prompted for it. Once you are authorized by the SMB protocol, you will be at a smb: \> prompt. This is similar to an ftp session where get, put, pwd, ls, etc. can be used to navigate. Type help for a list of commands.

Configuring Windows Machines
Connect to a Linux machine running Samba the same way you connect to any Windows machine - browse through Network Neighboorhood or Windows Explorer entering a password if required. Note: Windows 95/98 only prompts for a password and assumes the Windows Login name as the username. You need to either create a user on your Linux box with your Windows Login or create a Windows Login with the same username on your Linux machine. Optionally, you can have the Windows Login and password for Windows 95/98/NT/2000 be the same as your Linux Samba username and password and it will not prompt for a password. Obviously, this is a security issue if others have access to your system. Your call.

Please Log in or Create an account to join the conversation.

Re:Samba Configuration - Linux/Windows Connectivity 16 Mar 2008 03:01 #79157

  • sadistikal's Avatar Topic Author
  • sadistikal
  • Online
  • Senior Boarder
  • Senior Boarder
  • Posts: 424
  • Thanks: 0
additional help on setting up linux follow the link www.linuxheadquarters.com/index.shtml

Please Log in or Create an account to join the conversation.

Re:Samba Configuration - Linux/Windows Connectivity 16 Mar 2008 19:13 #79203

  • battousai16
  • Online
  • Expert Boarder
  • Expert Boarder
  • Posts: 829
  • Thanks: 1
Bossing, nagana na yung buy mo sa ICC na SUSE Linux? ok ba sya?

Please Log in or Create an account to join the conversation.

Re:Samba Configuration - Linux/Windows Connectivity 17 Mar 2008 05:28 #79245

  • sadistikal's Avatar Topic Author
  • sadistikal
  • Online
  • Senior Boarder
  • Senior Boarder
  • Posts: 424
  • Thanks: 0
mejo nahihirapan ako sa SUSE ehehehehe mas prepare ko ubuntu

Please Log in or Create an account to join the conversation.

Re:Samba Configuration - Linux/Windows Connectivity 18 Mar 2008 00:34 #79349

  • jaimecanchela
  • Online
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thanks: 0
Ubuntu + Samba + Webmin the best yan try it kung ayaw nyu maniwala

Please Log in or Create an account to join the conversation.

Re:Samba Configuration - Linux/Windows Connectivity 26 Mar 2008 16:17 #80385

  • dodimar
  • Online
  • Junior Boarder
  • Junior Boarder
  • Posts: 153
  • Thanks: 1
jaimecanchela wrote:

Ubuntu + Samba + Webmin the best yan try it kung ayaw nyu maniwala


ano po yung Webmin?

Please Log in or Create an account to join the conversation.

Re: Samba Configuration - Linux/Windows Connectivity 31 Jul 2012 18:30 #561191

  • kyohisro's Avatar
  • kyohisro
  • Online
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 5444
  • Thanks: 213
sir nag tuturo po kayo sa linux gusto ko matuto samba parang mag join mga winxp ko sa linux server AD at DC

ty how much kaya

Please Log in or Create an account to join the conversation.

Re: Samba Configuration - Linux/Windows Connectivity 31 Jul 2012 18:39 #561196

  • Darkvice's Avatar
  • Darkvice
  • Online
  • Gold Boarder
  • Gold Boarder
  • Posts: 1370
  • Thanks: 77

kyohisro wrote: sir nag tuturo po kayo sa linux gusto ko matuto samba parang mag join mga winxp ko sa linux server AD at DC

ty how much kaya


sir try mo muna yung tutorial sa taas or ibang free instruction resources sa internet, kung may problem/error naman post mo lang dito, para matulungan ka nang mga linux users na nakapag setup na successfully nang samba winxp-linux

Please Log in or Create an account to join the conversation.

Re: Samba Configuration - Linux/Windows Connectivity 31 Jul 2012 19:07 #561210

  • kjshoot2ill's Avatar
  • kjshoot2ill
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 5416
  • Thanks: 813

Please Log in or Create an account to join the conversation.

Re: Samba Configuration - Linux/Windows Connectivity 01 Aug 2012 02:59 #561386

  • kyohisro's Avatar
  • kyohisro
  • Online
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 5444
  • Thanks: 213

kjshoot2ill wrote: www.unixmen.com/howto-install-and-config...mba-share-in-ubuntu/



maraming salamat po try ko po ngayon

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: Itwarehouse Speclin
Time to create page: 0.091 seconds