LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can only connect to Samba shares when logged into SSH (https://www.linuxquestions.org/questions/linux-software-2/can-only-connect-to-samba-shares-when-logged-into-ssh-948618/)

scruffyfox 06-05-2012 07:56 AM

Can only connect to Samba shares when logged into SSH
 
Hi,

Im a bit of a noob when it comes to Linux and servers, but I've got a home server and its running Samba 3.5.8. It was working fine up till a couple days ago.

Basically what happens is, when I try to access the samba shares from my Windows 7 PC, I get an access denied error or permissions error. But it isn't until I log into the server via Putty SSH, it begins working again. I try to restart samba logged in to SSH and accessing it, its fine up till i logout or close the terminal window.

I've literally no idea what the hell has happened for it to do that, i've looked absolutely everywhere for an answer and can't find one.

I've tried reinstalling samba, restoring the config, upgrading the OS but they all have the same issue.

Here is my config
Code:

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

[global]
unix extensions = no
        log file = /var/log/samba/log.%m
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        obey pam restrictions = yes
        follow symlinks = yes
        map to guest = bad user
        encrypt passwords = true
        passwd program = /usr/bin/passwd %u
        wins support = yes
        dns proxy = no
        netbios name = ScruffyServer
        wide links = yes
        server string =
        unix password sync = yes
        workgroup = MSHOME
        os level = 20
        security = user
        syslog = 0
        usershare allow guests = yes
        panic action = /usr/share/samba/panic-action %d
        max log size = 1000
        pam password change = yes
;        passdb backend = tdbsam
;        os level = 20
name resolve order = wins lmhosts hosts bcast

[Public]
        read list = public
        user = public
        path = /home/scruffy/Public

[Music]
browseable = no
        read list = music
        user = music
        path = /home/scruffy/Public/Music
        write list = music

[Movies]
browseable = no
        read list = movies
        user = movies
        path = /home/scruffy/Public/Movies
        write list = movies

[TVShows]
browseable = no
        read list = tvshows
        user = tvshows
        path = /home/scruffy/Public/TVShows
        write list = tvshows

[Web]
browseable = no
        read list = web
        user = web
        path = /home/scruffy/Public/Web
        write list = web

The original problem I had when trying to fix the samba shares before this problem arose was, the samba server started at boot, but could not access till I logged into SSH and started it as my main user, i tried adding the script to chkconfig and various other things but none of them worked, I have reversed the changes I did to try and fix the current problem, but still no luck.

I have no idea what the hell to do

jv2112 06-06-2012 04:33 AM

Your access when you ssh is through ssh not samba. So samba is not working at all. Your config appears after a scan appears to have no settings. You have eberything commented out ( ; / # ).

This will give you a idea of a base config.

https://www.linux.com/learn/tutorial...sy-samba-setup

Hope this helps.

Babertje 06-06-2012 05:50 AM

When no master browser is running on the subnet, potential browsers choose a new master browser among themselves in a process called an election. Try to set your OS Level to 32 this makes your Samba server the PDC rather then W7 looks to itself as domain controller. see: http://www.samba.org/samba/docs/usin...-CHP-7-TABLE-2

scruffyfox 06-06-2012 12:38 PM

Quote:

Originally Posted by jv2112 (Post 4696679)
Your access when you ssh is through ssh not samba. So samba is not working at all. Your config appears after a scan appears to have no settings. You have eberything commented out ( ; / # ).

This will give you a idea of a base config.

https://www.linux.com/learn/tutorial...sy-samba-setup

Hope this helps.

I've removed all the comments to make it a bit easier to read

---------- Post added 06-06-12 at 12:39 PM ----------

Quote:

Originally Posted by Babertje (Post 4696732)
When no master browser is running on the subnet, potential browsers choose a new master browser among themselves in a process called an election. Try to set your OS Level to 32 this makes your Samba server the PDC rather then W7 looks to itself as domain controller. see: http://www.samba.org/samba/docs/usin...-CHP-7-TABLE-2

Still having the same issue.

Whats weird is that when I try to view the server in the networking folder, I can see the main 2 folders that are open for every user (public and private) but can't actually go inside them.

jv2112 06-07-2012 04:27 AM

It is not a question of being able to read. Those "special" characters are indicators to the program not to include in the the programs configuration.

scruffyfox 06-07-2012 10:37 AM

Quote:

Originally Posted by jv2112 (Post 4697668)
It is not a question of being able to read. Those "special" characters are indicators to the program not to include in the the programs configuration.

The global config or the shares were never commented anyway? it was only the example configuration and definitions that were commented.


All times are GMT -5. The time now is 02:13 PM.