18
SAMBA Integrating Linux and Window

SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Embed Size (px)

Citation preview

Page 1: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

SAMBA

Integrating Linux and Window

Page 2: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

What is Samba?

• Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2 and Windows, as both a server and a client

• As a server, Samba shares Linux files and printers with Windows systems.

• As a client, Samba gives Linux users access to files on Windows systems

Page 3: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Shares

• Under Samba, an exported directory hierarchy is called a share.

• Samba derived from SMB – protocol for file and printer sharing in Windows

Page 4: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Samba Users, User Maps, and Passwords

• For a Windows user to gain access to Samba services on a Linux system, the user must provide a Windows username and a Samba password. It is also possible to authenticate using other methods such as LDAP or PAM

Page 5: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Usernames• The supplied username must be the same as a Linux

username or must map to a Linux username. • Samba keeps the username maps

in/etc/samba/smbusers.• Users with the same username on Windows and Samba

do not need to appear in this file, but still need a Samba password

• When you install Samba, /etc/samba/smbusers has 2 entries: – root = administrator admin– Nobody = guest pcguest smbguest

Page 6: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Passwords

• Samba uses Samba passwords, not Linux passwords to authenticate users.

• When you attempt to connect from Windows to a Samba server, Windows presents your Windows username and password to Samba. If your windows username is the same as or maps to your Linux username, and if your Windows and Samba passwords are the same, you do not have to enter a username and password to connect to the Samba server.

• Samba keeps passwords in /etc/samba/smbpasswd

Page 7: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

To add Samba access for the Win user sam:

• vi smbuserssls = sam

• # smbpasswd –a sls New SMB password: Retype new SMB password: Added user slsNow when sam uses the username sam to log in to

the Samba server, Samba maps sam to sls and looks up sls in smbpasswd. Sam logs on as sls.

Page 8: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Configuring a Samba Server

• system-config-samba – can set up only basic features of a Samba server.

• Performs 3 functions:– Configuration of server

– Configuration of users

– Setting up shares that are exported to Windows machines

• Overwrites /etc/samba/smb.conf. Make backup copy before running system-config-samba

Page 9: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Configuring samba using system-config-samba

• System-config-samba– Set workgroup to workgroup in use on

Windows machines.– Make sure authentication is set to user– Set encrypted passwords to Yes– Add Samba users– Add shares

Page 10: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Swat: Configures a Samba server

• Samba Web Administration Tool – is a browser-based GUI for the smb.conf file.

• Swat is run from /etc/xinetd.d/swat

• Turn on by changing disable = yes to disable=no.

• Add any remote names or Ips of other systems that will access swat

• Chkconfig swat on

• Service xinetd restart

• To access, enter http://127.0.0.1:901 or http://localhost:901

Page 11: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Manually configuring a Samba server

• Edit the /etc/samba/smb.conf• Can set up:

– Global parameters– Security parameters– Logging parameters– Browser parameters– Communication parameters– Share parameters

Page 12: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Sharing user’s home directories

• Often, users like to share their home directories with a Windows machine. To make this easier, Samba provides the [homes] share. When you define this share, each user’s home directory is shared with the specified parameters.

• For example:[homes]

comment = Home Directoriesbrowseable = nowritable = yes

This prevents users other than the owners from browsing home directories while allowing logged-in owners full access.

Page 13: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Accessing Windows Shares from Linux

• As a client, samba enables you to view and work with files on a Windows system from a Linux system.

• smbtree – displays windows shares in a hierarchical tree. When prompted for a password, hit enter to view shares available to guest. Enter password to view restricted shares.

Page 14: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Smbclient: Connects to Windows Shares

• Smbclient functions similarly to ftp and connects to a windows share.

• $ smbclient //PB/mark connects to a windows share

Page 15: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Mounting Windows Shares

• On the Linux computer, you can mount a Windows share so that you can write files to it.

• Mount –t cifs //host/sharedir /share –o username=mark, password=pizza

• Ls /

Page 16: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Troubleshooting

• Samba provides 3 utilities to troubleshoot a connection:– Smbstatus – displays a report on open Samba

connections– Testparm – checks the syntax of

/etc/samba/smb.conf and displays its contents– Testprns – checks the validity name of a printer

Page 17: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Troubleshooting

1. Restart the smbd and nmbd daemons– Service smb restart

2. Run testparm to check that the smb.conf is syntactically correct

3. Ping from both sides of the connection to make sure that the network is up.

4. From Windows, net view \\servername to display a list of shares available from the server.

5. Try to map the drive with a net use x: \\pb\tmp

Page 18: SAMBA Integrating Linux and Window. What is Samba? Free suite of programs that enables flavors of UNIX to work with other operating systems such as OS/2

Troubleshooting cont.

6. Sbclient –L pb

List all available shares