$ smbclient -L hostname -U%
params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
No such file or directory
smbclient: Can't load /etc/samba/smb.conf - run testparm to debug it
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.0.5]
tree connect failed: NT_STATUS_ACCESS_DENIED
and
$ smbclient -L hostname --user username
params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
No such file or directory
smbclient: Can't load /etc/samba/smb.conf - run testparm to debug it
Connection to hostname failed (Error NT_STATUS_CONNECTION_REFUSED)
The first error was due to samba not being public and therefore i needed to specify a samba username (who must also be a system user, see here) who was granted samba permissions.
The second error I was receiving simply because I had my firewall set using iptables, and had not opened the correct ports for samba!
I performed the following commands and corrected it.
- sudo iptables -A TCP -p tcp --dport 139 -j ACCEPT
- sudo iptables -A TCP -p tcp --dport 445 -j ACCEPT
- sudo iptables -A UDP -p udp --sport 137 -j ACCEPT
- sudo iptables -A UDP -p udp --dport 137 -j ACCEPT
- sudo iptables -A UDP -p udp --dport 138 -j ACCEPT
- su -c 'iptables-save > /etc/iptables/iptables.rules'
- sudo systemctl restart iptables.service
No comments:
Post a Comment