service smb start
netstat -tpln

Proto    Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp       0 0 0.0.0.0:139    0.0.0.0:* LISTEN 3796/smbd
tcp       0 0 127.0.0.1:6379   0.0.0.0:* LISTEN 3194/redis-server 1
tcp       0 0 0.0.0.0:80     0.0.0.0:* LISTEN 3160/nginx
tcp       0 0 0.0.0.0:8080    0.0.0.0:* LISTEN 3151/nginx
tcp       0 0 0.0.0.0:8081 0.0.0.0:* LISTEN 3151/nginx
tcp       0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1991/sshd
tcp       0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1843/cupsd
tcp       0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3055/master
tcp       0 0 0.0.0.0:445 0.0.0.0:* LISTEN 3796/smbd
tcp       0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 1978/php-fpm
tcp       0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 3201/mongod
tcp       0 0 :::139 :::* LISTEN 3796/smbd
tcp       0 0 :::22 :::* LISTEN 1991/sshd
tcp       0 0 ::1:631 :::* LISTEN 1843/cupsd
tcp       0 0 ::1:25 :::* LISTEN 3055/master
tcp       0 0 :::445 :::* LISTEN 3796/smbd
tcp       0 0 :::3306 :::* LISTEN 3108/mysqld

1.开启服务139,445
smb 对应的端口是
2.开启端口,把用到的端口设置开机启动
/etc/rc.local 这个文件开机启动时读取,把下面两行放进rc.local便可
iptables -I INPUT -p tcp --dport 445 -j ACCEPT
iptables -I INPUT -p tcp --dport 139 -j ACCEPT
也可以直接手动临时添加,但重启机器之后失效