zoukankan      html  css  js  c++  java
  • LINUX开启SAMBA服务

    samba,用于网络文件共享,类似于nfs,

    samba多用于win和linux之间

    linux之间多用nfs

    c/s架构

    smb协议

    samba主要是两个服务,核心启动服务SMB,监听139TCP端口,NMB服务类似DSN功能,如果不启,只能以ip来访问,监听137 138UDP端口

    使用

    yum -y install samba
    

    然后防火墙

    systemctl stop firewalld.service
    

    然后selinux

    [root@localhost ~]# sestatus
    SELinux status:                 enabled
    SELinuxfs mount:                /sys/fs/selinux
    SELinux root directory:         /etc/selinux
    Loaded policy name:             targeted
    Current mode:                   enforcing
    Mode from config file:          enforcing
    Policy MLS status:              enabled
    Policy deny_unknown status:     allowed
    Max kernel policy version:      31
    [root@localhost ~]# setenforce 0
    [root@localhost ~]# sestatus
    SELinux status:                 enabled
    SELinuxfs mount:                /sys/fs/selinux
    SELinux root directory:         /etc/selinux
    Loaded policy name:             targeted
    Current mode:                   permissive
    Mode from config file:          enforcing
    Policy MLS status:              enabled
    Policy deny_unknown status:     allowed
    Max kernel policy version:      31
    [root@localhost ~]#
    

    启动下smb

    [root@localhost ~]# service smb status
    Redirecting to /bin/systemctl status smb.service
    ● smb.service - Samba SMB Daemon
       Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled)
       Active: inactive (dead)
         Docs: man:smbd(8)
               man:samba(7)
               man:smb.conf(5)
    [root@localhost ~]# systemctl start smb
    [root@localhost ~]# service smb status 
    Redirecting to /bin/systemctl status smb.service
    ● smb.service - Samba SMB Daemon
       Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled)
       Active: active (running) since Mon 2019-04-01 15:34:00 CST; 5s ago
         Docs: man:smbd(8)
               man:samba(7)
               man:smb.conf(5)
     Main PID: 3137 (smbd)
       Status: "smbd: ready to serve connections..."
        Tasks: 4
       CGroup: /system.slice/smb.service
               ├─3137 /usr/sbin/smbd --foreground --no-process-group
               ├─3140 /usr/sbin/smbd --foreground --no-process-group
               ├─3141 /usr/sbin/smbd --foreground --no-process-group
               └─3142 /usr/sbin/smbd --foreground --no-process-group
    
    Apr 01 15:34:00 localhost.localdomain systemd[1]: Starting Samba SMB Daemon...
    Apr 01 15:34:00 localhost.localdomain smbd[3137]: [2019/04/01 15:34:00.812166,  0] ../lib/util/become_daemon.c:138(daemon_ready)
    Apr 01 15:34:00 localhost.localdomain smbd[3137]:   daemon_ready: STATUS=daemon 'smbd' finished starting up and ready to serve connections
    Apr 01 15:34:00 localhost.localdomain systemd[1]: Started Samba SMB Daemon.
    [root@localhost ~]#
    

    配置文件/etc/samba/smb.conf,就默认配置吧 然后添加用户

    [root@localhost samba]# pdbedit -a oracle
    new password:
    retype new password:
    Unix username:        oracle
    NT username:          
    Account Flags:        [U          ]
    User SID:             S-1-5-21-3894974451-2409427747-3149240937-1000
    Primary Group SID:    S-1-5-21-3894974451-2409427747-3149240937-513
    Full Name:            
    Home Directory:       \localhostoracle
    HomeDir Drive:        
    Logon Script:         
    Profile Path:         \localhostoracleprofile
    Domain:               LOCALHOST
    Account desc:         
    Workstations:         
    Munged dial:          
    Logon time:           0
    Logoff time:          Wed, 06 Feb 2036 23:06:39 CST
    Kickoff time:         Wed, 06 Feb 2036 23:06:39 CST
    Password last set:    Mon, 01 Apr 2019 15:49:50 CST
    Password can change:  Mon, 01 Apr 2019 15:49:50 CST
    Password must change: never
    Last bad password   : 0
    Bad password count  : 0
    Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
    [root@localhost samba]# pdbedit -L
    oracle:54321:
    [root@localhost samba]#
    

    image

    win中入网账号密码就可以了

  • 相关阅读:
    mysql常用技巧
    java中集成CKEditor和CKFinder
    Linux_C++内存分配方式详解——堆、栈、自由存储区、全局/静态存储区和常量存储区
    Linux_内存分配中的堆和栈
    mysql中的text,mediumtext,longtext在Hibernate中的类型映射
    循环神经网络LSTM RNN回归:sin曲线预测
    什么?语音合成开源代码不会跑,follow me!
    华为云GaussDB:发挥生态优势,培养应用型DBA
    对话华为云专家,摆脱无意义“内卷”
    带你读AI论文丨用于细粒度分类的Transformer结构—TransFG
  • 原文地址:https://www.cnblogs.com/yongestcat/p/11438648.html
Copyright © 2011-2022 走看看