Linux 명령어 - 삼바(Samba) 상태 및 설정 확인

     

     

    이번 포스팅에서는 SMABA 서버 상태 및 설정확인에 대해서 알아보도록 하겠습니다.

     

     

     

       Linux SAMBA 이전글

     

     

     

    https://server-talk.tistory.com/460- Linux 명령어 - SAMBA 알아보기(파일공유)

     

    https://server-talk.tistory.com/461- Linux 명령어 - SAMBA 파일 공유설정

     

    https://server-talk.tistory.com/462- Linux 명령어 - 삼바(Samba) 서버 접속 클라이언트 - Windows

     

    https://server-talk.tistory.com/463- Linux 명령어 - 삼바(Samba) 서버 접속 클라이언트 - Linux

     

     

     

     

     

     

       Linux - SAMBA 서버 설정 및 상태 확인 알아보기

     

     

     

    1. testparm - SAMBA 서버 설정파일 체크

     

    SAMBA 서버의 설정파일에 오류가 있는지 확인할때 사용하는 명령어이고 smb.conf 만 점검하므로, 옵션을 사용하지 않아도 됩니다.

     

     

    # testparm 
    Load smb config files from /etc/samba/smb.conf
    Loaded services file OK.
    Weak crypto is allowed
    Server role: ROLE_STANDALONE
    
    Press enter to see a dump of your service definitions
    
    # Global parameters
    [global]
    	log file = /var/log/samba/log.%m
    	logging = file
    	map to guest = Bad User
    	max log size = 1000
    	obey pam restrictions = Yes
    	pam password change = Yes
    	panic action = /usr/share/samba/panic-action %d
    	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    	passwd program = /usr/bin/passwd %u
    	server role = standalone server
    	server string = %h server (Samba, Ubuntu)
    	unix password sync = Yes
    	usershare allow guests = Yes
    	idmap config * : backend = tdb
    
    
    [printers]
    	browseable = No
    	comment = All Printers
    	create mask = 0700
    	path = /var/spool/samba
    	printable = Yes
    
    
    [print$]
    	comment = Printer Drivers
    	path = /var/lib/samba/printers
    
    
    [share_user]
    	hide dot files = No
    	path = /samba_disk
    	read only = No
    	valid users = share_user

     

    testparm 명령어를 실행하면 smb.conf 파일의 오류가 있는지 검사하고 오류가 없을 경우 OK 메시지를 보여주고나서 키보드 입력 대기상태가 됩니다 이때 ENTER 키 입력하면 공유 설정 항복이 출력됩니다.

     

     

     

    2. smbstatus : SAMBA 서버 접속자 및 상태확인

     

     

    # smbstatus 
    
    Samba version 4.13.17-Ubuntu
    PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing              
    ----------------------------------------------------------------------------------------------------------------------------------------
    2873    share_user   share_user   192.168.0.183 (ipv4:192.168.0.183:49850)  SMB3_11           -                    partial(AES-128-CMAC)
    
    Service      pid     Machine       Connected at                     Encryption   Signing     
    ---------------------------------------------------------------------------------------------
    share_user   2873    192.168.0.183 Wed Feb  9 04:00:01 PM 2022 UTC  -            -           
    
    Locked files:
    Pid          User(ID)   DenyMode   Access      R/W        Oplock           SharePath   Name   Time
    --------------------------------------------------------------------------------------------------
    2873         1001       DENY_NONE  0x100081    RDONLY     NONE             /samba_disk   .   Wed Feb  9 16:02:13 2022
    2873         1001       DENY_NONE  0x100081    RDONLY     NONE             /samba_disk   .   Wed Feb  9 16:02:11 2022
    2873         1001       DENY_NONE  0x100081    RDONLY     NONE             /samba_disk   .   Wed Feb  9 16:00:39 2022

     

    smbstatus 명령어는 현재 SAMBA 서버의 연결된 서버 및 PC의 연결정보를 상세하게 확인할 수 있습니다.

    Posted by 서버이야기