学 点 新 知--做 点 事 情分享 http://blog.sciencenet.cn/u/dabing 平时多记点,东西就多了...

博文

Ubuntu、Mac、Windows文件传输共享

已有 2269 次阅读 2022-4-16 18:38 |个人分类:Ubuntu软件安装|系统分类:科研笔记

Ubuntu、Mac、Windows文件传输共享


建议直接参考原网页的安装介绍:

https://ubuntu.com/tutorials/install-and-configure-samba#1-overview


==以下仅作备份参考============================

  1. Overview

    A Samba file server enables file sharing across different operating systems over a network. It lets you access your desktop files from a laptop and share files with Windows and macOS users.


  2. Installing Samba

    To install Samba, we run:

    sudo apt update

    sudo apt install samba

    We can check if the installation was successful by running:

    whereis samba

    The following should be its output:

    samba: /usr/sbin/samba /usr/lib/samba /etc/samba /usr/share/samba /usr/share/man/man7/samba.7.gz /usr/share/man/man8/samba.8.gz


  3. Setting up Samba

    Now that Samba is installed, we need to create a directory for it to share:

    mkdir /home/<username>/sambashare/


    The command above creates a new folder sambashare in our home directory which we will share later.


    The configuration file for Samba is located at /etc/samba/smb.conf. To add the new directory as a share, we edit the file by running:

    sudo nano /etc/samba/smb.conf


    At the bottom of the file, add the following lines:

    [sambashare]

    comment = Samba on Ubuntu

    path = /home/username/sambashare

    read only = no

    browsable = yes


    Then press Ctrl-O to save and Ctrl-X to exit from the nano text editor.


    Now that we have our new share configured, save it and restart Samba for it to take effect:
    sudo service smbd restart

    Update the firewall rules to allow Samba traffic:
    sudo ufw allow samba


  4. Setting up User Accounts and Connecting to Share

    Since Samba doesn’t use the system account password, we need to set up a Samba password for our user account:

    sudo smbpasswd -a username
    Note: Username used must belong to a system account, else it won’t save.


    Connecting to Share

    On Ubuntu: Open up the default file manager and click Connect to Server then enter: 

    smb://ip-address/sambashare

    On macOS: In the Finder menu, click Go > Connect to Server then enter: 
    smb://ip-address/sambashare


    On Windows, open up File Manager and edit the file path to:
    \\ip-address\sambashare

    Note: ip-address is the Samba server IP address and sambashare is the name of the share.


Reference:

https://ubuntu.com/tutorials/install-and-configure-samba#1-overview


20220416@nc



https://blog.sciencenet.cn/blog-287062-1334188.html

上一篇:Ubuntu install phoebe
下一篇:phoebe install on Ubuntu 20.04.4
收藏 IP: 218.6.128.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

全部作者的其他最新博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-8-1 05:15

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部