If you are reading this article it means you have a network at home or office with Windows and Linux hosts or have created a virtual network using VirtualBox and need to send files between a Linux host to Windows. File transfer between Linux and Windows can be done using SAMBA which is an open source software suite that provides seamless file and print services to SMB/CIFS clients, allowing interoperability between Unix/Linux based system and Windows-based system. 
 
 

How To Configure SAMBA Server And Transfer Files Between Linux & Windows

 

How To Install Samba Server On Ubuntu Linux?

​To configure SAMBA  first step is to install it using the command below -
$ sudo apt install samba
​After the installation finishes, all you have to do is configure it. The configuration file is located in /etc/samba/ on a file named smb.conf.
 
When messing with system files, it is always better to make a backup of the file we are about to change. To backup, the file before changing it, make a copy of the file.
$ sudo cp /etc/samba/smb.conf ~
​This command will make the backup file in your home directory or alternatively -
$ sudo cp /etc/samba/smb.conf /etc/samba/smb_bkp.conf
​Creating a copy of the file in the same folder as the original file.
If you are setting this on a Ubuntu server you can use vim or nano to edit smb.conf file, for Ubuntu desktop just use the default text editor file. Note that all commands (Server or Desktop) must be run as a root.
$ sudo nano /etc/samba/smb.conf
​Then add the information below to the very end of the file -
[share]
comment = Ubuntu File Server Share
path = /srv/samba/share
browsable = yes
guest ok = yes
read only = no
create mask = 0755
Comment: is a short description of the share.
Path: the path of the directory to be shared.
 
This example uses /srv/samba/share because, according to the Filesystem Hierarchy Standard (FHS), /srvis where site-specific data should be served. Technically Samba shares can be placed anywhere on the filesystem as long as the permissions are correct, but adhering to standards is recommended.
 
browsable: enables Windows clients to browse the shared directory using Windows Explorer.
guest ok: allows clients to connect to the share without supplying a password.
read only: determines if the share is read only or if write privileges are granted. Write privileges are allowed only when the value is no, as is seen in this example. If the value is yes, then access to the share is read only.
create mask: determines the permissions new files will have when created.

Now that Samba is configured, the directory /srv/samba/share needs to be created and the permissions need to be set. Create the directory and change permissions from the terminal -

sudo mkdir -p /srv/samba/share
sudo chown nobody:nogroup /srv/samba/share/
​The -p switch tells mkdir to create the entire directory tree if it does not exist.
 
Finally, restart the samba services to enable the new configuration:
sudo systemctl restart smbd.service nmbd.service
​From a Windows client, you should now be able to browse to the Ubuntu file server and see the shared directory. If your client doesn't show your share automatically, try to access your server by its IP address, e.g. \\192.168.1.1 or hostname in a Windows Explorer window. To check that everything is working try creating a directory from Windows.
 
To create additional shares simply create new [dir] sections in /etc/samba/smb.conf, and restart Samba. Just make sure that the directory you want to share actually exists and the permissions are correct.
 

Conclusion

​That is it. You have your first SAMBA server created for sharing with windows based system. Have a different approach for creating SAMBA server? Share with us.

How To Configure SAMBA Server And Transfer Files Between Linux & Windows的更多相关文章

  1. How to configure Samba Server share on Debian 9 Stretch Linux

    Lubos Rendek Debian 13 June 2017 Contents 1. Objective 2. Operating System and Software Versions 3.  ...

  2. samba server install

    要求: create vnc service for win7 access it via vnc viewer. 1TB disk for this Centos PC is used as Sam ...

  3. Samba: Server setup..

    To make samba shard folder permission clear, there are 3 kind of permission need to be paid attentio ...

  4. I can connect to an FTP site but I can't list or transfer files.

    原文 FTP sessions use two network connections: The control channel is for user authentication and send ...

  5. [转]Android与电脑局域网共享之:Samba Server

    大家都有这样的经历,通过我的电脑或网上邻居访问另一台计算机上的共享资源,虽然电脑和手机之间可以有多种数据传输方式,但通过Windows SMB方式进行共享估计使用的人并不是太多,下面我就简单介绍一下, ...

  6. samba server 设置

     samba server  设置yum install samba.x86_64systemctl start smb.servicesystemctl enable smb.servicesamb ...

  7. The Guideline of Setting Up Samba Server on linux(Ubuntu)

    The Guideline of Setting Up Samba Server on linux(Ubuntu) From terminate command window, install the ...

  8. Samba Server possible problem and solving

    Configured samba server at RHEL7, problem encountered and solved. 1, yum install samba*, RHEL7 syste ...

  9. How to install Samba server on Ubuntu 12.04

    Part 1: Configuring anonymous share with samba server To install the samba package,enter the followi ...

随机推荐

  1. Controlled Components

    [Controlled Components] In HTML, form elements such as <input>, <textarea>, and <sele ...

  2. yum update 自动忽略内核更新

    系统每天凌晨 3 点自动执行 yum update 任务 但升级内核后,会出现下面情况 一些编译软件需要内核模块才能够被调用, 而内核模块需要与当前版本内核编译后才能够使用, 假设内核升级后,之前软件 ...

  3. 使用solr界面管理工具创建core 不能用的解决方法

    可以用命令行进行创建  首先要先进入 solr所属的 用户 solr 中 ./solr create -c solr_sample 然后创建 你的core  显示以下信息 就创建成功了 成功之之后可以 ...

  4. 在 Android Studio 上调试数据库 ( SQLite ) (转)

    转自:http://c.colabug.com/thread-1781696-1-1.html 以前 Eclipse 时代,调试 SQLite 都是将数据库文件导出到电脑,然后再用软件打开查看.现在我 ...

  5. contextlib 上下文管理器

    在Python中,读写文件这样的资源要特别注意,必须在使用完毕后正确关闭它们.正确关闭文件资源的一个方法是使用try...finally: try: f = open('/path/to/file', ...

  6. eCharts 折线图,动态绑定数据不更新图表的问题,

    官方文档 : http://echarts.baidu.com/tutorial.html npm install echarts --save let lineChart = echarts.ini ...

  7. NumPy Ndarray 对象

    NumPy Ndarray 对象 NumPy 最重要的一个特点是其 N 维数组对象 ndarray,它是一系列同类型数据的集合,以 0 下标为开始进行集合中元素的索引. ndarray 对象是用于存放 ...

  8. Python+Selenium学习--前进和后退

    场景 这两个功能一般不太常用.所能想到的场景大概也就是在几个页面间来回跳转,省去每次都get url. 代码 #!/usr/bin/env python # -*- coding:utf-8 -*- ...

  9. Fibonacci again and again

    Fibonacci again and again http://acm.hdu.edu.cn/showproblem.php?pid=1848 Time Limit: 1000/1000 MS (J ...

  10. sourceforge

    sourceforge SourceForge.net,又称SF.net,是开源软件开发者进行开发管理的集中式场所. SourceForge.net由VA Software提供主机,并运行Source ...