安装ssh
sudo apt-get install openssh-server
sudo systemctl enable --now ssh
sudo apt-get install net-tools
ubuntu安装samba
sudo apt update
sudo apt upgrade
sudo apt-get install samba
mkdir /share
sudo chmod 777 /share -R
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
sudo nano /etc/samba/smb.conf
----------文件底部添加----------
[nas]
comment = Samba Share
path = /share
valid users = naser
writable = yes
browsable = yes
guest ok = yes
read only = no
create mask = 0777
directory mask = 0777
添加用户
sudo systemctl restart smbd
sudo useradd -m naser
sudo passwd naser
sudo smbpasswd -a naser
防火墙端口
sudo ufwallow 139/tcp
sudo ufwallow 445/tcp
sudo nano /etc/samba/smb.conf
在[global]下添加
server min protocol = NT1
sudo systemctl restart smbd
sudo systemctl start nmbd
sudo systemctl enable nmbd