configuring linux samba

Upload: rtimuas

Post on 10-Jan-2016

7 views

Category:

Documents


0 download

DESCRIPTION

SMB information

TRANSCRIPT

  • CONFIGURING LINUX SAMBA (SMB) - HOW TO SETUP SAMBA(LINUX WINDOWS FILE SHARING)WRITTEN BY ADMINISTRATOR. POSTED IN LINUX SYSTEM AND NETWORK SERVICES (HTTP://WWW.FIREWALL.CX/LINUX-KNOWLEDGEBASE-TUTORIALS/SYSTEM-AND-NETWORK-SERVICES.HTML)

    Resource sharing, like file systems and printers, in Microsoft Windows systems, is accomplished using a protocol called the ServerMessage Block or SMB. For working with such shared resources over a network consisting of Windows systems, an RHEL system mustsupport SMB. The technology used for this is called SAMBA. This provides integration between the Windows and Linux systems. Inaddition, this is used to provide folder sharing between Linux systems. There are two parts to SAMBA, a Samba Server and a SambaClient.

    When an RHEL system accesses resources on a Windows system, it does so using the Samba Client. An RHEL system, by default, hasthe Samba Client installed.

    When an RHEL system serves resources to a Windows system, it uses the package Samba Server or simply Samba. This is not installedby default and has to be exclusively set up.

    INSTALLING SAMBA ON LINUX REDHAT/CENTOS

    Whether Samba is already installed on your RHEL, Fedora or CentOS setup, it can be tested with the following command:"

    $ rpm -q samba

    The result could be - package samba is not installed, or something like samba-3.5.4-68.el6_0.1.x86_64 showing the version ofSamba present on the system.

    To install Samba, you will need to become root with the following command (give the root password, when prompted):

    $ su -

    Then use Yum to install the Linux Samba package:

    (http://www.firewall.cx/)

    TUESDAY, 28 OCTOBER 2014Home (http://www.firewall.cx/) Linux (http://www.firewall.cx/linux-knowledgebase-tutorials.html)System and Network Services (http://www.firewall.cx/linux-knowledgebase-tutorials/system-and-network-services.html)Configuring Linux Samba (SMB) - How to Setup Samba (Linux Windows File Sharing)

    FIREWALL.CX TEAM

    (HTTP://WWW.FIREWALL.CX/MEET-THE-TEAM.HTML)

    NEWS

    (HTTP://WWW.FIREWALL.CX/NEWS.HTML)

    ALTERNATIVE MENU

    (HTTP://WWW.FIREWALL.CX/SITE-MAP.HTML)

    RECOMMENDED SITES

    (HTTP://WWW.FIREWALL.CX/RECOMMENDED-SITES.HTML)

    CONTACT US - FEEDBACK

    (HTTP://WWW.FIREWALL.CX/CONTACT-US.HTML)

    HOME(http://www.firewall.cx/)

    NETWORKING(http://www.firewall.cx/networking-topics.html)

    CISCO(http://www.firewall.cx/cisco-technical-knowledgebase.html)

    MICROSOFT(http://www.firewall.cx/microsoft-knowledgebase.html)

    LINUX(http://www.firewall.cx/linux-knowledgebase-tutorials.html)

    MORE CONTENT(http://www.firewall.cx/general-topics-reviews.html)

    DOWNLOADS(http://www.firewall.cx/downloads.html)

    FORUM(http://www.firewall.cx/forums.html)

    HOT DOWNLOADS

    (http://clixtrac.com/goto/?179823)

    Rating 4.29 (7 Votes)

    TweetTweetShare 26 people like this.LikeLike ShareShare

    Configuring Linux Samba (SMB) - How to Setup Samba (Linu... file:///Users/saumitre/other/read/tech/Configuring Linux Samba...

    1 of 6 9/11/15, 12:17 PM

  • # yum install samba

    This will install the samba package and its dependency package, samba-common.

    Before you begin to use or configure Samba, the Linux Firewall (iptables) has to be configured to allow Samba traffic. From thecommand-line, this is achieved with the use of the following command:

    # firewall-cmd --enable --service=samba

    CONFIGURING LINUX SAMBA

    The Samba configuration is meant to join an RHEL, Fedora or CentOS system to a Windows Workgroup and setting up a directory on theRHEL system, to act as a shared resource that can be accessed by authenticated Windows users.

    To start with, you must gain root privileges with (give the root password, when prompted):

    $ su -

    Edit the Samba configuration file:

    # vi /etc/samba/smb.conf

    THE SMB.CONF [GLOBAL] SECTION

    An smb.conf file is divided into several sections. the [global] section, which is the first section, has settings that apply to the entire Sambaconfiguration. However, settings in the other sections in the configuration file may override the global settings.

    To begin with, set the workgroup, which by default is set as MYGROUP:

    workgroup = MYGROUP

    Since most Windows networks are named WORKGROUP by default, the settings have to be changed as:

    workgroup = workgroup

    CONFIGURE THE SHARED RESOURCE

    In the next step, a shared resource that will be accessible from the other systems on the Windows network has to be configured. Thissection has to be given a name by which it will be referred to when shared. For our example, lets assume you would like share a directoryon your Linux system located at /data/network-applications. Youll need to entitle the entire section as [NetApps] as shown below in oursmb.conf file:

    [NetApps]

    path = /data/network-applicationswriteable = yesbrowseable = yesvalid users = administrator

    When a Windows user browses to the Linux Server, theyll see a network share labeledNetApps.

    This concludes the changes to the Samba configuration file.

    CREATE A SAMBA USER

    Any user wanting to access any Samba shared resource must be configured as a Samba User and assigned a password. This is achievedusing the smbpasswd command as a root user. Since you have defined administrator as the user who is entitled to access the /data/network-applications directory of the RHEL system, you have to add administrator as a Samba user.

    You must gain root privileges with the following command (give the root password, when prompted):

    $ su -

    Add administrator as a Windows user -

    # smbpasswd -a administrator

    (http://feeds.feedburner.com

    /firewallcx)

    (http://twitter.com

    /firewallcx)

    (https://www.facebook.com

    /firewallcx)

    (http://www.linkedin.com

    /groups?home=&

    gid=1037867)

    CONNECT:

    NETWORK SECURITYSCANNER

    (http://clixtrac.com/goto/?99232)

    Notify me of new articles

    Subscribe

    RSS SUBSCRIPTION

    Subscribe to Firewall.cx RSSFeed by Email(http://feedburner.google.com/fb/a/mailverify?uri=firewallcx&loc=en_US)

    HYPER-V BACKUP

    (http://clixtrac.com/goto/?181631)

    RECOMMENDEDDOWNLOADS

    Web Security(http://clixtrac.com/goto/?99233)

    Server AntiSpam(http://clixtrac.com/goto/?99234)

    Network Scanner(http://clixtrac.com/goto/?99235)

    IDS Security Manager(http://clixtrac.com/goto/?99236)

    Web-Proxy Monitor(http://clixtrac.com/goto/?99237)

    FTP / TFTP Servers(http://www.firewall.cx/downloads/ftp-tftp-servers-a-clients.html)

    Cisco VPN Client(http://www.firewall.cx/downloads/cisco-tools-a-applications.html)

    Network Fax Server(http://clixtrac.com

    Configuring Linux Samba (SMB) - How to Setup Samba (Linu... file:///Users/saumitre/other/read/tech/Configuring Linux Samba...

    2 of 6 9/11/15, 12:17 PM

  • The system will respond with

    New SMB password: Retype new SMB password:

    This will result into the following message:

    Added user administrator

    It will also be necessary to add the same account as a simple linux user, using the same password we used for the samba user:

    # adduser administrator# passwd administratorChanging password for user administratorNew UNIX password: ********Retype new UNIX password: ********passwd: all authentication tokens updated successfully.

    Now it is time to test the samba configuration file for any errors. For this you can use the command line tool testparm as root:

    # testparm

    Load smb config files from /etc/samba/smb.conf

    Rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)

    Processing section [NetApps]

    Loaded services file OK.

    Server role: ROLE_STANDALONE

    Press enter to see a dump of your service definitions

    If you would like to ensure that Windows users are automatically authenticated to your Samba share, without prompting for ausername/password, all thats needed is to add the samba user and password exactly as you Windows clients usernames and password.When a Windows system accesses a Samba share, it will automatically try to log in using the same credentials as the user logged into theWindows system.

    STARTING SAMBA AND NETBIOS NAME SERVICE ON RHEL

    The Samba and NetBios Nameservice or NMB services have to be enabled and then started for them to take effect:

    # systemctl enable smb.service# systemctl start smb.service# systemctl enable nmb.service# systemctl start nmb.service

    In case the services were already running, you may have to restart them again:

    # systemctl restart smb.service# systemctl restart nmb.service

    If you are not using systemctl command, you can alternatively start the Samba using a more classic way:

    [root@gateway] service smb startStarting SMB services: [OK]

    To configure your Linux system to automatically start the Samba service upon boot up, the above command will need to be inserted in the/etc/rc.local file. For more information about this, you can read our popular Linux Init Process & Different run levels article

    ACCESSING THE SAMBA SHARES FROM WINDOWS

    Now that you have configured the Samba resources and the services are running, they can be tested for sharing from a Windows system.For this, open the Windows Explorer and navigate to the Network page. Windows should show the RHEL system. If you double-click on theRHEL icon, you will be prompted for the username and password. The username to be entered now is administrator with the passwordthat was assigned.

    Again, if you are logged on your Windows workstation using the same account and password as that of the Samba service (e.g

    /goto/?100607)

    Free Hyper-V Backup(http://clixtrac.com/goto/?163765)

    LINUX MENU

    INTRODUCTION TO LINUX

    (http://www.firewall.cx/linux-knowledgebase-tutorials/introduction-to-linux.html)

    LINUX ADMINISTRATION

    (http://www.firewall.cx/linux-knowledgebase-tutorials/linux-administration.html)

    SYSTEM AND NETWORKSERVICES

    (http://www.firewall.cx/linux-knowledgebase-tutorials/system-and-network-services.html)

    OPENMOSIX- LINUXSUPERCOMPUTER

    (http://www.firewall.cx/linux-knowledgebase-tutorials/openmosix-linux-supercomputer.html)

    CISCO PRESS REVIEWPARTNER

    (http://www.firewall.cx/site-news/316-firewall-ciscopress.html)

    POPULAR CISCOARTICLES

    DMVPN Configuration(http://www.firewall.cx/cisco-technical-knowledgebase/cisco-routers/901-cisco-router-dmvpn-configuration.html)Cisco IP SLA(http://www.firewall.cx/cisco-technical-knowledgebase/cisco-routers/813-cisco-router-ipsla-basic.html)VLAN Security(http://www.firewall.cx/cisco-technical-knowledgebase/cisco-switches/818-cisco-switches-vlan-security.html)4507R-E Installation(http://www.firewall.cx/cisco-technical-knowledgebase/cisco-switches/948-cisco-switches-4507re-ws-x45-sup7l-e-installation.html)CallManager Express Intro(http://www.firewall.cx/cisco-technical-knowledgebase/cisco-voice/371-cisco-ccme-part-1.html)Secure CME - SRTP & TLS(http://www.firewall.cx/cisco-technical-knowledgebase/cisco-voice/956-cisco-voice-cme-secure-voip.html)Cisco Password Crack(http://www.firewall.cx/cisco-

    Configuring Linux Samba (SMB) - How to Setup Samba (Linu... file:///Users/saumitre/other/read/tech/Configuring Linux Samba...

    3 of 6 9/11/15, 12:17 PM

  • Administrator), you will not be prompted for any authentication as the Windows operating system will automatically authenticate to theRHEL Samba service using these credentials.

    ACCESSING WINDOWS SHARES FROM RHEL WORKSTATION OR SERVER

    To access Windows shares from your RHEL system, the package samba-client may have to be installed, unless it is installed by default.For this you must gain root privileges with (give the root password, when prompted):

    $ su -

    Install samba-client using the following commands:

    # yum install samba-client

    To see any shared resource on the Windows system and to access it, you can go to Places > Network. Clicking on the Windows Networkicon will open up the list of workgroups available for access.

    Add a comment

    View 3 more

    Facebook social plugin

    9 comments

    Kennedy P. Morris Monrovia, Liberiait's cool to get along with linux.Reply Like 1 April 2012 at 03:28

    Osama Tariq NetOps Engineer at WebSoulshow to configure ldapsmb tools?Reply Like 26 May 2012 at 07:47

    Mohamed Baligh Top commenter VMwareTechnical Support Engineer at VMwarethanksReply Like 18 June 2012 at 17:14

    Destiny CallGood OneReply Like 31 July 2012 at 02:011

    Smail Jeo Rabat, Moroccothank you very much! it will be tested!Reply Like 30 August 2012 at 23:54

    ARTICLES TO READ NEXT:

    IMPLEMENTING VIRTUAL SERVERSAND LOAD BALANCING CLUSTER...(HTTP://WWW.FIREWALL.CX/LINUX-KNOWLEDGEBASE-TUTORIALS/SYSTEM-AND-NETWORK-SERVICES/855-LINUX-SERVICES-VIRTUAL-SERVERS.HTML)

    CONFIGURING LINUX SAMBA (SMB) -HOW TO SETUP SAMBA (LIN...(HTTP://WWW.FIREWALL.CX/LINUX-KNOWLEDGEBASE-TUTORIALS/SYSTEM-AND-NETWORK-SERVICES/848-LINUX-SERVICES-SAMBA.HTML)

    CONFIGURING LINUX TO ACT AS AFIREWALL - LINUX IPTABLES...(HTTP://WWW.FIREWALL.CX/LINUX-KNOWLEDGEBASE-TUTORIALS/SYSTEM-AND-NETWORK-SERVICES/850-LINUX-SERVICES-FIREWALL.HTML)

    technical-knowledgebase/cisco-routers/358-cisco-type7-password-crack.html)Site-to-Site VPN(http://www.firewall.cx/cisco-technical-knowledgebase/cisco-routers/867-cisco-router-site-to-site-ipsec-vpn.html)

    FREE CISCO LABPARTNER

    (http://clixtrac.com/goto/?99238)

    POPULAR LINUXARTICLES

    Linux Init & RunLevels(http://www.firewall.cx/linux-knowledgebase-tutorials/linux-administration/845-linux-administration-runlevels.html)Linux Groups & Users(http://www.firewall.cx/linux-knowledgebase-tutorials/linux-administration/842-linux-groups-user-accounts.html)Linux Performance Monitoring(http://www.firewall.cx/linux-knowledgebase-tutorials/linux-administration/837-linux-system-resource-monitoring.html)Linux Vim Editor(http://www.firewall.cx/linux-knowledgebase-tutorials/linux-administration/836-linux-vi.html)Linux Samba(http://www.firewall.cx/linux-knowledgebase-tutorials/system-and-network-services/848-linux-services-samba.html)Linux DHCP Server(http://www.firewall.cx/linux-knowledgebase-tutorials/system-and-network-services/849-linux-services-dhcp-server.html)Linux Bind DNS(http://www.firewall.cx/general-topics-reviews/linuxunix-related/829-linux-bind-introduction.html)Linux File & FolderPermissions(http://www.firewall.cx/general-topics-reviews/linuxunix-related/introduction-to-linux/299-linux-file-folder-permissions.html)Linux OpenMosix(http://www.firewall.cx/general-topics-reviews/linuxunix-related/openmosix-linux-supercomputer.html)Linux Network Config(http://www.firewall.cx/linux-knowledgebase-tutorials/linux-administration/851-linux-services-tcpip.html)

    Configuring Linux Samba (SMB) - How to Setup Samba (Linu... file:///Users/saumitre/other/read/tech/Configuring Linux Samba...

    4 of 6 9/11/15, 12:17 PM

  • BANDWIDTHMONITORING

    (http://clixtrac.com/goto/?99758)

    Configuring Linux Samba (SMB) - How to Setup Samba (Linu... file:///Users/saumitre/other/read/tech/Configuring Linux Samba...

    5 of 6 9/11/15, 12:17 PM

  • CCENT/CCNAROUTER BASICS

    (HTTP://WWW.FIREWALL.CX

    /CISCO-TECHNICAL-

    KNOWLEDGEBASE/CISCO-

    ROUTERS/250-CISCO-

    ROUTER-BASICS.HTML)

    SUBNETTING

    OSI MODEL

    IP PROTOCOL

    CISCO ROUTERSSSL WEBVPN

    SECURING ROUTERS

    POLICY BASED ROUTING

    ROUTER ON-A-STICK

    VPN SECURITYUNDERSTAND DMVPN

    GRE/IPSEC

    CONFIGURATION

    SITE-TO-SITE IPSEC VPN

    IPSEC MODES

    CISCO HELPVPN CLIENT WINDOWS 8

    VPN CLIENT WINDOWS 7

    CCP DISPLAY PROBLEM

    CISCO SUPPORT APP.

    WINDOWS 2012NEW FEATURES

    LICENSING

    HYPER-V / VDI

    INSTALL HYPER-V

    LINUXFILE PERMISSIONS

    WEBMIN

    GROUPS - USERS

    SAMBA SETUP

    FIREWALL.CX TEAM(HTTP://WWW.FIREWALL.CX/MEET-THE-TEAM.HTML)

    NEWS(HTTP://WWW.FIREWALL.CX/NEWS.HTML)

    ALTERNATIVE MENU(HTTP://WWW.FIREWALL.CX/SITE-MAP.HTML)

    RECOMMENDED SITES(HTTP://WWW.FIREWALL.CX/RECOMMENDED-SITES.HTML)

    CONTACT US - FEEDBACK(HTTP://WWW.FIREWALL.CX/CONTACT-US.HTML)

    Copyright 2000-2014 Firewall.cx - All Rights ReservedInformation and images contained on this site is copyrighted material.

    Firewall.cx - Cisco Networking, VPN - IPSec, Security, Cisco Switching, Cisco Routers, Cisco VoIP- CallManager Express & UC500, Windows Server, Virtualization, Hyper-V Linux Administration

    Configuring Linux Samba (SMB) - How to Setup Samba (Linu... file:///Users/saumitre/other/read/tech/Configuring Linux Samba...

    6 of 6 9/11/15, 12:17 PM