sudo su
mkdir /mnt/teste
apt install cifs-utils -y
vim /root/senharede.txt
username=NomedoUsuario password=SenhaDoUsuario
chmod 400 /root/senharede.txt
mount.cifs //servername/teste /mnt/teste -o username=usuario,password=SenhaDoUsuario OU mount.cifs //192.168.1.1/teste /mnt/teste -o username=usuario,password=SenhaDoUsuario
echo "# Diretório de rede" >> /etc/fstab echo "//192.168.1.1/teste /mnt/teste cifs uid=1000,gid=1000,nofail,credentials=/root/senhaderede.txt 0 0" >> /etc/fstab
mount /mnt/teste
umount /mnt/teste
apt install autofs -y
id -u nomedousuario
echo "/mnt /etc/auto.teste" >> /etc/auto.master
echo "teste -fstype=cifs,rw,credentials=/root/.smbpass,uid=988 ://192.168.1.1/teste" >> /etc/auto.teste
systemctl restart autofs