---
# System prepended metadata

title: SMB

---

# SMB
> [NFS note](https://hackmd.io/@Phoebe61G/NFS)

## What is SMB?
- A kind of **File System** could run on **Windows**
- 網路上的芳鄰
- Often used on the school's computer(for each student can sign in their account on any host)
## SOP
### Samba Server
  - Step 1:
```shell=
sudo apt-get install samba
```
  - Step 2:
```shell=
sudo adduser smbuser --shell /bin/false
sudo smbpasswd -a smbuser
```
>or add the /bin/false in /etc/shells
  - Step 3:
```shell=
sudo vi /etc/samba/smb.conf
```
```
[share_name]
path = /home/smbuser
valid users = smbuser
browseable = yes
read only = no
writable = yes
public = yes
```

  - Step 4:
```shell=
sudo samba restart
```


### Samba Client
  - Step 1:
```shell=
sudo apt install smbclient
```
>type ==smbtree==
  - Step 2:
```shell=
sudo mkdir -p /mnt/share
```
  - Step 3:
```shell=
sudo mount -t cifs //{Samba Server IP}/share /mnt/share -o username=smbuser,password=123456789
```
>type ==df== to see device
  - Step 4:
```shell=
sudo umount /mnt/share
```