---
title: "Samba problem!"
type: "forum-thread"
url: "https://www.webforum.nu/amne/linux-bsd/120717-samba-problem"
topic: "Linux & BSD"
topic_url: "https://www.webforum.nu/amne/linux-bsd"
author: "Sjodahl"
published: "2005-01-21T18:09:09.000Z"
updated: "2005-01-21T22:04:39.000Z"
replies: 30
views: 719
page: 1
pages: 2
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/linux-bsd/120717-samba-problem"
---

# Samba problem!

_Sida 1 av 2._

## #1 — Sjodahl, 2005-01-21T18:09Z

Hej!

Satt upp en samba server på Redhat 9.0 (eller försökt iallafall)

smb.conf
\======================
\[global\]
workgroup = MIDEARTH
netbios name = HOBBIT
security = share
\[data\]
browsable = yes
comment = Data
path = /ftproot
read only = Yes
guest ok = Yes
\======================

Hur ser jag att samba är igång?
Försöker mappa upp den med min windows burk med följande:

net use i: \\\\192.168.0.1\\data

Men får detta felmeddelandet:
"System error 51 has occurred.

Windows cannot find the network path. Verify that the network path is correct an
d the destination computer is not busy or turned off. If Windows still cannot fi
nd the network path, contact your network administrator."

Antar att samba inte är igång på ett korrekt sätt. Men kör jag typ "ps -aux" så ser jag att samba finns där.

Permalänk: https://www.webforum.nu/p/120717

## #2 — stoffe-2k, 2005-01-21T18:22Z

Det här kanske hjälper, så här ser min konfiguration ut.

smb.conf

```
[global]
        dns proxy = no
        log file = /var/log/samba/log.%m
        log level = 1
        smb passwd file = /etc/samba/private/smbpasswd
        server string = " comment"
        netbios name = "name"
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        workgroup = MSHOME
        os level = 20
        map to guest = bad user
        encrypt passwords = yes
        security = user
        max log size = 50

[homes]
   comment = Home Directories
   browseable = no
   writable = yes

[disk1]
        writeable = yes
        path = /mnt/disk1
```

Om någon har tips och komentarer så är de välkommna...

Permalänk: https://www.webforum.nu/p/1534164

## #3 — Sjodahl, 2005-01-21T18:30Z

ingen skilllnad, hur ser jag att samba servern är uppe?

Permalänk: https://www.webforum.nu/p/1534171

## #4 — front, 2005-01-21T18:37Z

Kör en "netstat -ln" och kolla om port 139 lyssnar efter anslutningar.

Permalänk: https://www.webforum.nu/p/1534179

## #5 — Sjodahl, 2005-01-21T18:38Z

\[root@RSERVER root\]# netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:139             0.0.0.0:\*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:\*               LISTEN
tcp        0      0 0.0.0.0:21              0.0.0.0:\*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:\*               LISTEN
tcp        0      0 0.0.0.0:3128            0.0.0.0:\*               LISTEN
tcp        0      0 0.0.0.0:443             0.0.0.0:\*               LISTEN
udp        0      0 0.0.0.0:32769           0.0.0.0:\*
udp        0      0 0.0.0.0:3130            0.0.0.0:\*
udp        0      0 0.0.0.0:68              0.0.0.0:\*

Permalänk: https://www.webforum.nu/p/1534183

## #6 — stoffe-2k, 2005-01-21T18:40Z

du kan även köra:

```
x samba # /etc/init.d/samba status 
 * status:  started
x samba #
```

har du kört "testparm" för att kolla så din config fil är OK ?

Permalänk: https://www.webforum.nu/p/1534186

## #7 — Sjodahl, 2005-01-21T18:41Z

\[root@RSERVER root\]# /etc/init.d/smb status
smbd (pid 12272) kÃ¶r...
nmbd Ã€r stoppad
\[root@RSERVER root\]#

Permalänk: https://www.webforum.nu/p/1534188

## #8 — Sjodahl, 2005-01-21T18:44Z

funderar om det kan ha ngt att göra med att jag kör 2st nätverkskort i linux server, och kör min windows burk direkt till linux. Ngt som stoppar?

iptables -F
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d 62.119.159.228 --dport 3389 -j DNAT --to 192.168.0.2
iptables -t nat -A PREROUTING -p tcp -d 62.119.159.228 --dport 5000 -j DNAT --to 192.168.0.2
iptables -t nat -A PREROUTING -p tcp -d 62.119.159.228 --dport 6112 -j DNAT --to 192.168.0.2

echo 1 \> /proc/sys/net/ipv4/ip_forward

Permalänk: https://www.webforum.nu/p/1534192

## #9 — front, 2005-01-21T18:47Z

Testa att connecta till SAMBA lokalt på linuxdatorn med hjälp av **smbclient**

Permalänk: https://www.webforum.nu/p/1534194

## #10 — Sjodahl, 2005-01-21T18:49Z

hmmm inte riktigt säkert på hur man gör det

\[root@RSERVER root\]# smbclient //RSERVER/disk1
added interface ip=62.119.159.228 bcast=62.119.159.255 nmask=255.255.254.0
added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
Password:
Domain=\[MIDEARTH\] OS=\[Unix\] Server=\[Samba 2.2.7a-security-rollup-fix\]
tree connect failed: NT_STATUS_WRONG_PASSWORD
\[root@RSERVER root\]#

vad är det för pass man skall skriva i ?

Permalänk: https://www.webforum.nu/p/1534196

## #11 — Sjodahl, 2005-01-21T18:53Z

\[root@RSERVER root\]# smbpasswd johan
Failed to open /etc/samba/private/secrets.tdb
New SMB password:
Retype new SMB password:
unable to open passdb database.
Failed to find entry for user johan.
Failed to modify password entry for user johan
\[root@RSERVER root\]#

Permalänk: https://www.webforum.nu/p/1534197

## #12 — front, 2005-01-21T19:01Z

smbpasswd -a johan

Om du ska lägga till ett lösenord för användaren johan.

Permalänk: https://www.webforum.nu/p/1534204

## #13 — Sjodahl, 2005-01-21T19:03Z

\[root@RSERVER samba\]# smbpasswd -a johan
Failed to open /etc/samba/private/secrets.tdb
New SMB password:
Retype new SMB password:
unable to open passdb database.
startsmbfilepwent_internal: too many race conditions creating file /etc/samba/private/smbpasswd
add_smbfilepwd_entry: unable to open file.
Failed to add entry for user johan.
Failed to modify password entry for user johan
\[root@RSERVER samba\]#

Permalänk: https://www.webforum.nu/p/1534205

## #14 — stoffe-2k, 2005-01-21T19:10Z

resultat från: 
 smbclient -U% -L localhost

Permalänk: https://www.webforum.nu/p/1534211

## #15 — front, 2005-01-21T19:12Z

Har du en användare på linuxdatorn som heter johan?
Om inte så lägg till en genom **useradd**.

Permalänk: https://www.webforum.nu/p/1534212

## #16 — Sjodahl, 2005-01-21T19:12Z

\[root@RSERVER samba\]# smbclient -U% -L localhost
added interface ip=62.119.159.228 bcast=62.119.159.255 nmask=255.255.254.0
added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
Domain=\[MIDEARTH\] OS=\[Unix\] Server=\[Samba 2.2.7a-security-rollup-fix\]

        Sharename      Type      Comment
        \---------      ----      -------
        disk1          Disk
        IPC$           IPC       IPC Service ("servernamn")
        ADMIN$         Disk      IPC Service ("servernamn")

        Server               Comment
        \---------            -------
        HOBBIT               Samba 2.2.7a-security-rollup-fix

        Workgroup            Master
        \---------            -------
        MIDEARTH             HOBBIT

Permalänk: https://www.webforum.nu/p/1534213

## #17 — Sjodahl, 2005-01-21T19:34Z

japp har en användare som heter johan

lite mer framsteg kanske, kan nog logga in lokalt på den nu.

\[root@RSERVER johan\]# smbclient //RSERVER/disk1 -U johan
added interface ip=62.119.159.228 bcast=62.119.159.255 nmask=255.255.254.0
added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
Password:
Domain=\[HOME-NETWORK\] OS=\[Unix\] Server=\[Samba 2.2.7a-security-rollup-fix\]
smb: \\\> dir
  .                                   D        0  Fri Jan 21 20:03:03 2005
  ..                                  D        0  Wed Jan 19 21:33:14 2005
  .bash_logout                        H       24  Tue Feb 11 14:34:44 2003
  .bash_profile                       H      191  Tue Feb 11 14:34:44 2003
  .bashrc                             H      124  Tue Feb 11 14:34:44 2003
  .gtkrc                              H      120  Thu Feb 27 00:15:12 2003
  firewall                            A     3854  Tue Jan 11 21:16:04 2005
  .bash_history                       H        5  Fri Jan 21 20:03:03 2005

                38042 blocks of size 1048576. 33705 blocks available
smb: \\\>

när jag skall connecta ifrån min windows burk:
C:\\Windows\\Settings\\Johan\>net use i: \\\\192.168.0.1\\disk1 /USER:johan
System error 51 has occurred.

Windows cannot find the network path. Verify that the network path is correct an
d the destination computer is not busy or turned off. If Windows still cannot fi
nd the network path, contact your network administrator.

Permalänk: https://www.webforum.nu/p/1534232

## #18 — Sjodahl, 2005-01-21T19:45Z

slog igång på "Enable NetBIOS over TCP/IP" och får detta meddelandet istället:

C:\\Windows\\Settings\\Johan\>net use i: \\\\192.168.0.1\\disk1 /USER:johan
System error 53 has occurred.

The network path was not found.

Permalänk: https://www.webforum.nu/p/1534237

## #19 — front, 2005-01-21T20:32Z

Grejer jag skulle testat:
\* Pinga datorerna för att vara säker på att det inte är nått fel med nätverket.
\* Kört en "net use i: \\\\192.168.0.**99**\\disk1 /USER:johan" för att se vilket felmeddelande man får då.
\* Loggat in som användaren johan på windowsmaskinen, med samma lösenord som på linuxburken
\* Skrivit in "\\\\192.168.0.1" i utforskaren

EDIT:
Jag svamlade

Permalänk: https://www.webforum.nu/p/1534268

## #20 — Sjodahl, 2005-01-21T20:50Z

RESULTAT:

\====================================
C:\\Windows\\Settings\\Johan\>ping 192.168.0.1

Pinging 192.168.0.1 with 32 bytes of data:

Reply from 192.168.0.1: bytes=32 time\<1ms TTL=64
Reply from 192.168.0.1: bytes=32 time\<1ms TTL=64
Reply from 192.168.0.1: bytes=32 time\<1ms TTL=64
Reply from 192.168.0.1: bytes=32 time\<1ms TTL=64

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

C:\\Windows\\Settings\\Johan\>

\====================================
C:\\Windows\\Settings\\Johan\>net use i: \\\\192.168.0.1\\disk1 /USER:johan
System error 53 has occurred.

The network path was not found.

C:\\Windows\\Settings\\Johan\>

\====================================

Förstår inte varför jag inte kan söka upp datorn, går inte med, \\\\192.168.0.1 eller att söka efter den. Undrar om det kan ha ngt med mina iptables att göra?

iptables -F
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d 62.119.159.228 --dport 3389 -j DNAT --to 192.168.0.2
iptables -t nat -A PREROUTING -p tcp -d 62.119.159.228 --dport 5000 -j DNAT --to 192.168.0.2
iptables -t nat -A PREROUTING -p tcp -d 62.119.159.228 --dport 6112 -j DNAT --to 192.168.0.2

echo 1 \> /proc/sys/net/ipv4/ip_forward

Permalänk: https://www.webforum.nu/p/1534284

---

Tråden på webben: https://www.webforum.nu/amne/linux-bsd/120717-samba-problem  
Nästa sida: https://www.webforum.nu/amne/linux-bsd/120717-samba-problem/page2.md
