如何在ubuntu下使用samba创建共享,ubuntusamba


快速简单的创建共享,比网上那些乱七八糟过时的文档强太多

原文地址: https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share%20Via%20Samba%20Via%20CLI%20%28Command-line%20interface/Linux%20Terminal%29%20-%20Uncomplicated,%20Simple%20and%20Brief%20Way!

How to Create a Network Share Via Samba Via CLI (Command-line interface/Linux Terminal) - Uncomplicated, Simple and Brief Way!

In this text, I teach how to create a network share via Samba using the CLI (Command-line interface/Linux Terminal) in an uncomplicated, simple and brief way targeting Windows users.

Procedures

All commands must be done as root (precede each command with 'sudo' or use 'sudo su').

  • Set a password for your user in Samba
  • Create a directory to be shared

    mkdir /home/<user_name>/<folder_name>

  • Make a safe backup copy of the original smb.conf file to your home folder, in case you make an error

    sudo cp /etc/samba/smb.conf ~

  • Edit the file "/etc/samba/smb.conf"

    sudo nano /etc/samba/smb.conf

  • Restart the samba:

    sudo service smbd restart

  • Once Samba has restarted, use this command to check your smb.conf for any syntax errors

    testparm

  • To access your network share

    To access your network share use your username (<user_name>) and password through the path "smb://<HOST_IP_OR_NAME>/<folder_name>/" (Linux users) or "\\<HOST_IP_OR_NAME>\<folder_name>\" (Windows users). Note that "<folder_name>" value is passed in "[<folder_name>]", in other words, the share name you entered in "/etc/samba/smb.conf".

  • Source

    相关内容