• Samba-跨平台共享


    1、Samba服务,windows与Linux跨平台的共享

    1.1 安装samba软件

    yum install -y samba
    rpm -q samba
    

    1.1.1 创建共享用户

    专门用于Samba服务验证的用户称之为:samba共享账户
    专门用于Samba服务验证的用户密码:samba独立的密码与系统密码不同

    -bash: userad: command not found
    [root@localhost ~]# useradd harry
    [root@localhost ~]# pdbedit -a harry # 密码123
    new password:
    retype new password:
    Unix username:        harry
    NT username:          
    Account Flags:        [U          ]
    User SID:             S-1-5-21-3674061486-3834496461-345525531-1000
    Primary Group SID:    S-1-5-21-3674061486-3834496461-345525531-513
    Full Name:            
    Home Directory:       \localhostharry
    HomeDir Drive:        
    Logon Script:         
    Profile Path:         \localhostharryprofile
    Domain:               LOCALHOST
    Account desc:         
    Workstations:         
    Munged dial:          
    Logon time:           0
    Logoff time:          Wed, 06 Feb 2036 10:06:39 EST
    Kickoff time:         Wed, 06 Feb 2036 10:06:39 EST
    Password last set:    Wed, 23 Jun 2021 16:29:19 EDT
    Password can change:  Wed, 23 Jun 2021 16:29:19 EDT
    Password must change: never
    Last bad password   : 0
    Bad password count  : 0
    Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
    
    

    1.1.2 修改配置文件

    共享名:客户端通过网络看到的名字,可以与文件夹名相同,也可以不同。
    linux:

    [root@localhost ~]# mkdir -p /opt/ldy
    [root@localhost ldy]# echo 123 > 1.txt
    [root@localhost ldy]# ls
    1.txt
    [root@localhost ldy]# cat 1.txt 
    123
    # 修改配置文件
    [root@localhost ldy]# vi /etc/samba/smb.conf
    [ldy]               # 设置共享名
      path = /opt/ldy/    # 实际共享的路径
    

    windows

    1.1.3 重启服务

    [root@localhost ldy]# systemctl start smb
    [root@localhost ldy]# systemctl enable smb
    Created symlink from /etc/systemd/system/multi-user.target.wants/smb.service to /usr/lib/systemd/system/smb.service.
    

    1.2 linux客户端访问

    1.2.1 安装cifs-utils软件,支持cifs文件系统

    [root@localhost ~]# yum install -y cifs-utils
    

    1.2.2 挂载访问

    nfs 共享格式:mount 192.168.6.129:共享路径 挂载点
    samba 共享格式: mount -o username=harry,password=123 //192.168.6.129/共享名 挂载点

    所有的事都会过去,我们所有的人都是从小白开始,坚持下去。
  • 相关阅读:
    Spring Boot 快速入门
    mySql 主从复制linux配置
    Neural Networks for Machine Learning by Geoffrey Hinton (1~2)
    DIV浮动IE文本产生3象素的bug
    Leet Code OJ 338. Counting Bits [Difficulty: Medium]
    Unity3D:Gizmos画圆(原创)
    科学世界的人文关怀:开源科学与人工智能
    使用c#訪问Access数据库时,提示找不到可安装的 ISAM
    Android API Guides---Services
    《从0到1》读书笔记第一章"未来的挑战"第2记:做老子还是做孙子
  • 原文地址:https://www.cnblogs.com/li-dy/p/15004720.html
Copyright © 2020-2023  润新知