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. 简单的实现微信获取openid

    微信公众平台获取openid在公众号的开发中有很多用途,前段时间为实现用户使用公众号在登录一次以后可以免密登陆而使用了openid.开发过程中遇到了一些问题,在这里向需要且还没有获取到openid的米 ...

  2. chrome 扩展 调试

    开发chrome扩展,有时候需要输出console.log 通常调试的popup.html.content_script.backgroup.html等 但是有一些是没有这些的 1.推荐一个扩展: h ...

  3. User-Defined Components Must Be Capitalized

    [User-Defined Components Must Be Capitalized] When an element type starts with a lowercase letter, i ...

  4. 【C++】STL算法之remove_if

    之前写过这样一段代码: auto iter=remove_if(AllEdges.begin(),AllEdges.end(),[&](Edge* edge){return _isEedge( ...

  5. df.dropna()函数和df.ix(),df.at(),df.loc()

  6. Hadoop特点

    一:HDFS 1.HDFS上传数据,会将文件切分成指定大小的数据块,并以多副本的数据块存储在机器上. 2. part0是指  副本有2个而且1,2有两个副本 二.YARN 1.负责整个集群的管理和调度 ...

  7. Unity之MVC 模式

    MVC 模式代表 Model-View-Controller(模型-视图-控制器) 模式.这种模式用于应用程序的分层开发. Model(模型) - 模型代表一个存取数据的对象或 JAVA POJO.它 ...

  8. Django的Rbac介绍2

    上一篇博客我们记录了一下Django中使用Rbac,但是上一篇博客中的方法有一点不好,就是,因为我要在html文件中控制:如果用户有某个权限,则显示这个权限所代表的按钮,但是我现在只有1张表的增删改查 ...

  9. jQuery 与js判断是否单选复选选中

    js判断复选:这段代码昨天网上查看的资料没保存出处,抱歉 var obj=document.getElementsByName("diseaseSet"); //选择所有name= ...

  10. web中CookieUtils的工具类

    该类中包含Web开发中对Cookie的常用操作,如需要Copy带走 package com.project.utils; import java.io.UnsupportedEncodingExcep ...