Oct 08

The reason i make this article is because i want to connect windows sharing folder and i need to copy my backup to windows SAN storage, you need samba to connect

logo-samba

What is SAMBA ?

Samba is the standard Windows interoperability suite of programs for Linux and Unix.

Samba is Free Software licensed under the GNU General Public License, the Samba project is a member of the Software Freedom Conservancy.

Since 1992, Samba has provided secure, stable and fast file and print services for all clients using the SMB/CIFS protocol, such as all versions of DOS and Windows, OS/2, Linux and many others.

Samba is an important component to seamlessly integrate Linux/Unix Servers and Desktops into Active Directory environments using the winbind daemon.

Okay let’s start the connection .

First, you need to install samba first

on Ubuntu

# apt-get install samba smbfs

on CentOS

# yum install samba samba-client

Then to make it easier, edit your /etc/hosts file and give the Windows machine a name:

#vim /etc/hosts

10.21.21.105  storage.test.com       storage

Create a directory where the share will appear on your local filesystem.

# mkdir /mnt/storage

Edit /etc/fstab and add a line for the mount. Here “storage” is the name of the machine and “backuplinux$” is the name of the share.

# vim /etc/fstab

//storage\backuplinux$ /mnt/storage cifs exec,credentials=/etc/cifspw 0 0

Create a password file /etc/cifspw with the login credentials for your Windows account.

# vim /etc/cifspw

username=storage/backuplinux

password=passwrod

And secure the file:

# chmod 600 /etc/cifspw

Then the last thing

mount -a

or

mount /mnt/storage

Now you copy the backup to /mnt/storage

One Response to “how to connect windows sharing from Ubuntu / CentOS Server”

  1. Adityo Says:

    @Polprav, yes sure 🙂

Leave a Reply