Logo Hardware.com.br
jgama
jgama Ubbergeek Registrado
7.1K Mensagens 65 Curtidas

Compartilhamento usando Linux Ubuntu 12.04

#1 Por jgama 10/04/2016 - 11:19
Pessoal estou com a versão do samba
teste@srv-ubuntu2:~$ smbd -V
Version 4.1.6-Ubuntu

Não estou conseguindo fazer as maquinas windows com Win7 Prof. acessar as pastas compartilhadas no Samba, sempre que tento aparece a mensagem padrão;
"Windows cannot access \\192.168.0.17"

fiz o teste em duas maquinas com Window na minha humilde rede doméstica, abaixo segue o smb.conf que montei.

#======================= Global Settings =======================

[global]

workgroup = JGAMASYSTEM
server string = %h server (Samba, Ubuntu)
dns proxy = no
interfaces = 127.0.0.0/8 eth1
bind interfaces only = yes
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
security = user [HASHTAG]#tentei[/HASHTAG] também com share e nada

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no


[Dados]
comment = Documentos Gerais
path = /home/dados
available = yes
browseable = yes
public = yes
writable = yes
create mask = 0777
directory mask = 0770

[Valdir]
comment = Documentos do Valdir
path = /home/valdir/Desktop
available = yes
writable = yes
locking = no
public = yes
browseable = yes
force user = j00740463,valdir
force group = j00740463,valdir
hosts deny = ALL
hosts allow = 192.168.0.14

[J00740463]
comment = Pasta Particular
path = /home/j00740463/Backup
writable = yes
available = yes
public = yes
browseable = yes
force user = j00740463
force group = j00740463
create mask = 0770
directory mask = 0770

OBS: Em termo de ping as duas maquinas Windows pinga a Maquina com Linux

C:\Users\J00740463>ping 192.168.0.17

Pinging 192.168.0.17 with 32 bytes of data:
Reply from 192.168.0.17: bytes=32 time<1ms TTL=64
Reply from 192.168.0.17: bytes=32 time=1ms TTL=64
Reply from 192.168.0.17: bytes=32 time=1ms TTL=64
Reply from 192.168.0.17: bytes=32 time=1ms TTL=64

Ping statistics for 192.168.0.17:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms

OBS2: consigo acessa a maquian Linux via Putty.

Os usuários das Maquinas Windows então criados tanto no Linux como no samba.

Pergunto o que pode está barrando os acessos as pastas compartilhadas, nem seque mostra aos compartilhamentos?

Abraço
Responder
jqueiroz
jqueiroz Cyber Highlander Registrado
104K Mensagens 5.7K Curtidas
#4 Por jqueiroz
10/04/2016 - 16:16
syslog = 0

Mantenha um nível mínimo de log até resolver o problema. Se não quiser fazer log via syslog, pelo menos defina "log level = 3" pra acompanhar via arquivos em /var/log/samba.

server role = standalone server

Hmmm. Comente essa linha, de forma que volte ao padrão ("server role = auto"). Reinicie tanto o serviço smbd quanto o nmbd.

Mais uma informação... na máquina windows, execute os comandos abaixo e cole o resultado aqui.

nbtstat -A
nbtstat -a
nbtstat -n
"chmod 777 nunca ajudou ninguém" (c) 2002-2021 JQueiroz/FGdH
Conheça o Blog do Zekke
jgama
jgama Ubbergeek Registrado
7.1K Mensagens 65 Curtidas
#5 Por jgama
10/04/2016 - 18:17
Segue o resultado no nbtstat

C:\Users\J00740463>nbtstat -A 192.168.0.17

Local Area Connection 2:
Node IpAddress: [192.168.0.25] Scope Id: []

Host not found.

Bluetooth Network Connection:
Node IpAddress: [0.0.0.0] Scope Id: []

Host not found.

Wireless Network Connection:
Node IpAddress: [0.0.0.0] Scope Id: []

Host not found.

C:\Users\J00740463>nbtstat -a 192.168.0.17

Local Area Connection 2:
Node IpAddress: [192.168.0.25] Scope Id: []

Host not found.

Bluetooth Network Connection:
Node IpAddress: [0.0.0.0] Scope Id: []

Host not found.

Wireless Network Connection:
Node IpAddress: [0.0.0.0] Scope Id: []

Host not found.

C:\Users\J00740463>nbtstat -n

Local Area Connection 2:
Node IpAddress: [192.168.0.25] Scope Id: []

NetBIOS Local Name Table

Name Type Status
---------------------------------------------
J00740463AC <00> UNIQUE Registered
CHINA <00> GROUP Registered
J00740463AC <20> UNIQUE Registered
CHINA <1E> GROUP Registered

Bluetooth Network Connection:
Node IpAddress: [0.0.0.0] Scope Id: []

No names in cache

Wireless Network Connection:
Node IpAddress: [0.0.0.0] Scope Id: []

No names in cache

C:\Users\J00740463>

Alterei os log no smb.conf par syslog 3, pelo vizo no log o smbd mostra algo errado no lib

Log do nmbd

Samba name server SRV-UBUNTU2 is now a local master browser for workgroup JGAMASYSTEM on subnet 192.168.0.17

*****
[2016/04/10 19:06:54, 0] ../source3/nmbd/nmbd.c:57(terminate)
Got SIGTERM: going down...
[2016/04/10 19:06:54, 0] ../source3/nmbd/nmbd.c:902(main)
nmbd version 4.1.6-Ubuntu started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
[2016/04/10 19:07:17, 0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
*****

Samba name server SRV-UBUNTU2 is now a local master browser for workgroup JGAMASYSTEM on subnet 192.168.0.17

log do smbd

[2016/04/10 19:12:45.900751, 0] ../lib/util/pidfile.c:153(pidfile_unlink)
Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory
[2016/04/10 19:12:45, 0] ../source3/smbd/server.c:1198(main)
smbd version 4.1.6-Ubuntu started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
[2016/04/10 19:12:45.958218, 0] ../source3/smbd/server.c:1278(main)
standard input is not a socket, assuming -D option
" O DVD Pirata de hoje é a bala perdida de amanhã"
Autoria: Bárbara Gancia - Jornalista

Valdir
Sumaré - SP
jqueiroz
jqueiroz Cyber Highlander Registrado
104K Mensagens 5.7K Curtidas
#8 Por jqueiroz
10/04/2016 - 21:18
Faz um double check na questão do Firewall. Outro dia eu tive problema num servidor SuSE, eu que instalo todos eles, nunca ativo o firewall, não sei o que deu na máquina que o firewall do SLES ativou sozinho (SuSEfirewall2). Tive que reinstalar o pacote e forçar a reconfiguração, e tudo isso em acesso remoto. Sorte que a máquina tinha um modo de console remoto in-band.

Outro check que vc pode fazer é se o "nmbd" está conseguindo se comunicar com as outras máquinas da rede. Se sua máquina não for Master Browser, vc pode ver se o nmbd consegue localizar esse nó:

nmbdlookup -M -

E se tudo mais falhar... parte pro tcpdump, confirma que há tráfego da rede Samba entrando e saindo da máquina. Tente rodar o WireShark nas máquinas windows pra ver esse mesmo tráfego.
"chmod 777 nunca ajudou ninguém" (c) 2002-2021 JQueiroz/FGdH
Conheça o Blog do Zekke
jgama
jgama Ubbergeek Registrado
7.1K Mensagens 65 Curtidas
#9 Por jgama
10/04/2016 - 21:58
root@srv-01:~# testparm -s /etc/samba/smb.conf pc 192.168.0.25 <--- este é o IP da maquina cliente.
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Processing section "[Dados]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Allow connection from pc (192.168.0.25) to printers
Allow connection from pc (192.168.0.25) to print$
Allow connection from pc (192.168.0.25) to Dados

root@srv-01:~# tcpdump -i eth0 src 192.168.0.25
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
22:01:08.312181 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 2827168829, win 16425, length 0
22:01:09.679590 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 149, win 16388, length 0
22:01:10.689606 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 297, win 16351, length 0
22:01:11.689651 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 445, win 16314, length 0
22:01:11.862078 ARP, Request who-has 192.168.0.17 (00:25:11:c5:20:c0 (oui Unknown)) tell 192.168.0.25, length 46
22:01:12.481078 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 757, win 16236, length 0
22:01:13.682198 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 905, win 16199, length 0
22:01:14.682332 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 1053, win 16162, length 0
22:01:15.682402 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 1201, win 16125, length 0
22:01:16.686382 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 1349, win 16088, length 0
22:01:17.685241 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 1497, win 16425, length 0
22:01:18.687331 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 1645, win 16388, length 0
22:01:19.687464 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 1793, win 16351, length 0
22:01:20.687407 IP 192.168.0.25.4640 > 192.168.0.17.2222: Flags [.], ack 1941, win 16314, length 0
^C
14 packets captured
16 packets received by filter
0 packets dropped by kernel

root@srv-01:~# smbclient '\\192.168.0.17\Dados'
Enter root's password:
Domain=[JGAMASYSTEM] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]
smb: \> ls
. D 0 Sun Apr 10 22:20:20 2016
.. D 0 Sun Apr 10 21:36:48 2016
Drives D 0 Sun Apr 10 22:19:49 2016
Projetos D 0 Sun Apr 10 22:20:20 2016
Programas D 0 Sun Apr 10 22:19:56 2016
Documentos D 0 Sun Apr 10 22:20:09 2016
Videos D 0 Sun Apr 10 22:20:02 2016

37289 blocks of size 8388608. 34804 blocks available
smb: \>

root@srv-01:~# cat /var/log/samba/log.smbd
[2016/04/10 21:44:10.216623, 0] ../lib/util/pidfile.c:153(pidfile_unlink)
Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory
[2016/04/10 21:44:10, 0] ../source3/smbd/server.c:1198(main)
smbd version 4.1.6-Ubuntu started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
[2016/04/10 21:44:10.247161, 0] ../source3/smbd/server.c:1278(main)
standard input is not a socket, assuming -D option
root@srv-01:~#

Reinstalei o Ubuntu 14.04 e continua com o mesmo problema.

quero minha mãe.
" O DVD Pirata de hoje é a bala perdida de amanhã"
Autoria: Bárbara Gancia - Jornalista

Valdir
Sumaré - SP
jgama
jgama Ubbergeek Registrado
7.1K Mensagens 65 Curtidas
#13 Por jgama
11/04/2016 - 12:54
My friend não estou no local e nem consigo no momento fazer um remoto, mas eu já tinha feito essa consulta veja abaixo

root@srv-01:~# smbclient '\\192.168.0.17\Dados'
Enter root's password:
Domain=[JGAMASYSTEM] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]
smb: \> ls
. D 0 Sun Apr 10 22:20:20 2016
.. D 0 Sun Apr 10 21:36:48 2016
Drives D 0 Sun Apr 10 22:19:49 2016
Projetos D 0 Sun Apr 10 22:20:20 2016
Programas D 0 Sun Apr 10 22:19:56 2016
Documentos D 0 Sun Apr 10 22:20:09 2016
Videos D 0 Sun Apr 10 22:20:02 2016

37289 blocks of size 8388608. 34804 blocks available
smb: \>
" O DVD Pirata de hoje é a bala perdida de amanhã"
Autoria: Bárbara Gancia - Jornalista

Valdir
Sumaré - SP
jgama
jgama Ubbergeek Registrado
7.1K Mensagens 65 Curtidas
#15 Por jgama
11/04/2016 - 23:03
segue

teste@srv-01:~$ sudo smbclient -L localhost
[sudo] password for teste:
Enter root's password:
Domain=[JGAMASYSTEM] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]

Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (srv-01 server (Samba, Ubuntu))
J00740463 Disk Pasta Usuario
Dados Disk Pasta publica
print$ Disk Printer Drivers
Domain=[JGAMASYSTEM] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]

Server Comment
--------- -------
SRV-01 srv-01 server (Samba, Ubuntu)

Workgroup Master
--------- -------
JGAMASYSTEM SRV-01
teste@srv-01:~$
" O DVD Pirata de hoje é a bala perdida de amanhã"
Autoria: Bárbara Gancia - Jornalista

Valdir
Sumaré - SP
Responder Tópico
© 1999-2024 Hardware.com.br. Todos os direitos reservados.
Imagem do Modal