Samba

sudo apt-get install -y samba samba-common samba-client
dpkg -l samba*
sudo cp -p /etc/samba/smb.conf /etc/samba/smb.conf.backup
sudo vim /etc/samba/smb.conf
[global]

   workgroup = WORKGROUP
        security = user

        passdb backend = tdbsam

        printing = cups
        printcap name = cups
        load printers = yes
        cups options = raw

[share]
        path = /home/watanabe/Samba/share
        writeable = yes
        browseable = yes
        guest ok = yes
        available = yes
        public = yes
mkdir Samba
mkdir Samba/share

sudo chown -R nobody:nogroup Samba/
sudo chown -R nobody:nogroup Samba/share

sudo chmod -R 777 Samba
sudo chmod -R 777 Samba/share
sudo systemctl enable smbd.service
sudo systemctl enable nmbd.service

sudo touch /etc/samba/smbpasswd
sudo smbpasswd -a watanabe


sudo systemctl restart smbd.service
sudo systemctl restart nmbd.service

sudo ufw allow 8080

watanabe@hayato:~/Samba$ sudo ufw status
[sudo] password for watanabe: 
Status: active

To                         Action      From
--                         ------      ----
3306                       ALLOW       Anywhere                  
8080                       ALLOW       Anywhere                  
80                         ALLOW       Anywhere                  
139                        ALLOW       Anywhere                  
445                        ALLOW       Anywhere                  
137                        ALLOW       Anywhere                  
138                        ALLOW       Anywhere                  
Anywhere                   ALLOW       192.168.199.0/24          
Anywhere                   ALLOW       192.168.1.0/24            
3306 (v6)                  ALLOW       Anywhere (v6)             
8080 (v6)                  ALLOW       Anywhere (v6)             
80 (v6)                    ALLOW       Anywhere (v6)             
139 (v6)                   ALLOW       Anywhere (v6)             
445 (v6)                   ALLOW       Anywhere (v6)             
137 (v6)                   ALLOW       Anywhere (v6)             
138 (v6)                   ALLOW       Anywhere (v6)  

 

posted @ 2017-12-24 00:00  _hayato  阅读(83)  评论(0)    收藏  举报