Can't access share with username & password

Hi all,

I have a Pi in our Windows network. I created a share on my Pi. I installed samba. In /etc/samba/smb.conf there is:

[pishare] comment = Pi Shared Folder path = /home/pi browseable = yes guest ok = yes writeable = yes create mask=0777 directory mask=0777 public = no only guest = no

I created a user and password by sudo smbpasswd -a pi. When I try to access this share from a Windows machine, with using the pi name and password, I don't have access. What can be wrong?

Fokke Nauta

Reply to
Fokke Nauta
Loading thread data ...

What happens if you try public guest access (ie without needing to specify a username and password)

[cumulus] Comment = Cumulus weather station data and web pages Path = /home/pi/CumulusMX Browseable = yes Writeable = Yes only guest = no create mask = 0777 directory mask = 0777 Public = yes Guest ok = yes mangled names = no

The only significant different between your entry and mine is public=yes/no.

I notice that you have guest ok=yes. I'd have thought if you wanted to make Windows users have to specify a username/password to connect, you'd want to turn off guest access - but I may be wrong.

Reply to
NY

are the daemons smbd and nmbd running? Can you see the pi in a network browser?

--
No Apple devices were knowingly used in the preparation of this post.
Reply to
The Natural Philosopher

How can I check that?

When I type sudo /etc/init.d/samba restart, it says Restarting nmbd (via systemctl): nmbd.service. The same for smbd.

No

Reply to
Fokke Nauta

I tried. Still no access.

It was "no", but I turned it into "yes" while I hoped it would improve the situation.

Fokke

Reply to
Fokke Nauta

Ok, that probably means they are.

ps is the command to display running processes.

so

ps -eadf | grep mbd' ought to reveal them...

Mmm. Then if the daemons are running its not binding to the network maybe.

here is an smb.conf that works for my Intel server

# # Sample configuration file for the Samba suite for Debian GNU/Linux. # # # This is the main Samba configuration file. You should read the # smb.conf(5) manual page in order to understand the options listed # here. Samba has a huge number of configurable options most of which # are not shown in this example # # Some options that are often worth tuning have been included as # commented-out examples in this file. # - When such options are commented with ";", the proposed setting # differs from the default Samba behaviour # - When commented with "#", the proposed setting is the default # behaviour of Samba but the option is considered important # enough to be mentioned here # # NOTE: Whenever you modify this file you should run the command # "testparm" to check that you have not made any basic syntactic # errors.

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

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of workgroup = WORKGROUP

# server string is the equivalent of the NT Description field server string = %h server (Samba, Linux Mint)

# Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server # wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both ; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS. dns proxy = no

#### Networking ####

# The specific set of interfaces / networks to bind to # This can be either the interface name or an IP address/netmask; # interface names are normally preferred ; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the # 'interfaces' option above to use this. # It is recommended that you enable this feature if your Samba machine is # not protected by a firewall or is a firewall itself. However, this # option cannot handle dynamic or non-broadcast interfaces correctly. ; bind interfaces only = yes

#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine # that connects log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB). max log size = 1000

# If you want Samba to only log through syslog then set the following # parameter to 'yes'. # syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log # through syslog you should set the following parameter to something higher. syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace panic action = /usr/share/samba/panic-action %d

####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible # values are "standalone server", "member server", "classic primary # domain controller", "classic backup domain controller", "active # directory domain controller". # # Most people will want "standalone sever" or "member server". # Running as "active directory domain controller" will require first # running "samba-tool domain provision" to wipe databases and create a # new domain. server role = standalone server

# If you are using encrypted passwords, Samba will need to know what # password database type you are using. ; passdb backend = tdbsam

obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix # password with the SMB password when the encrypted SMB password in the # passdb is changed. unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following # parameters must be set (thanks to Ian Kahan

Reply to
The Natural Philosopher

Thanks, that worked well. There is 1 nmbd process, and 5 smbd.

I guess so. But I read that there seem to be issues with Windows 10 and the Pi.

It's quit similar to mine. A difference is wins support = yes. And the content under my share is a bit more extensive then the content under your VIDEO and LIBRARY.

Reply to
Fokke Nauta

Perhaps blocked by a firewall running on the pi?

Reply to
Joe Beanfish

Ahah. have you another *linux* or OS/X client to inspect them with?

Windows started being arsey with LAN shares as far back as Win7 IIRC. Needed to do stuff to allow it to work at all...

Ah, This

formatting link

suggest windows no longer auto discovers stuff on the LAN, and you have to make a manual entry for the Pi on the PC

Those are bare minimum to allow guests (real human guests) access to my Video and book collection when they stay.

I SHOULD make them RO.

--
A lie can travel halfway around the world while the truth is putting on  
its shoes.
Reply to
The Natural Philosopher

I've had a bog-standard Windows 10 installation able to access shares on both Windows 7 and RasPi "servers" without any problem.

What happens if you open a DOS Command Prompt in Windows, and do

net view \\raspi

(substituting the Pi's hostname and then its IP address)

and

net use z: \\raspi\sharename

(likewise with substitutions)

That will eliminate everything to do with workgroups, and using the IP address will even eliminate NetBIOS name resolution problems.

When I installed SAMBA on my Pi, everything "just worked" when I added a suitable set of lines for a share. I don't remember having to do anything special.

After my Pi developed a serious problem with booting, I had to reinstall everything, so I made notes the second time round of what I did. I also take an image of the SD card every few months so I can go back to a working state if the boot problem (SD card corruption?) ever happens again.

My notes for SAMBA are:

Install SAMBA

formatting link

sudo apt-get update sudo apt-getupgrade sudo apt-get install samba samba-common-bin edit /etc/samba/smb.conf and create sections (as described on web page) for [pi-rec], Path=/home/pi/Videos, mangled names = no [cumulus], Path=/home/pi/CumulusMX, mangled names = no chmod 777 /home/pi/Videos (make it writable by everyone) sudo /etc/init.d/samba restart

My complete smb.conf is

# # Sample configuration file for the Samba suite for Debian GNU/Linux. # # # This is the main Samba configuration file. You should read the # smb.conf(5) manual page in order to understand the options listed # here. Samba has a huge number of configurable options most of which # are not shown in this example # # Some options that are often worth tuning have been included as # commented-out examples in this file. # - When such options are commented with ";", the proposed setting # differs from the default Samba behaviour # - When commented with "#", the proposed setting is the default # behaviour of Samba but the option is considered important # enough to be mentioned here # # NOTE: Whenever you modify this file you should run the command # "testparm" to check that you have not made any basic syntactic # errors.

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

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of workgroup = WORKGROUP

# Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server # wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both ; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS. dns proxy = no

#### Networking ####

# The specific set of interfaces / networks to bind to # This can be either the interface name or an IP address/netmask; # interface names are normally preferred ; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the # 'interfaces' option above to use this. # It is recommended that you enable this feature if your Samba machine is # not protected by a firewall or is a firewall itself. However, this # option cannot handle dynamic or non-broadcast interfaces correctly. ; bind interfaces only = yes

#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine # that connects log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB). max log size = 1000

# If you want Samba to only log through syslog then set the following # parameter to 'yes'. # syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log # through syslog you should set the following parameter to something higher. syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace panic action = /usr/share/samba/panic-action %d

####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible # values are "standalone server", "member server", "classic primary # domain controller", "classic backup domain controller", "active # directory domain controller". # # Most people will want "standalone sever" or "member server". # Running as "active directory domain controller" will require first # running "samba-tool domain provision" to wipe databases and create a # new domain. server role = standalone server

# If you are using encrypted passwords, Samba will need to know what # password database type you are using. passdb backend = tdbsam

obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix # password with the SMB password when the encrypted SMB password in the # passdb is changed. unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following # parameters must be set (thanks to Ian Kahan

Reply to
NY

No, unfortunately not.

I've been there. Added a network machine as \\raspberrypi\pishare. There's the login screen, but with the username and password I can't login!

Reply to
Fokke Nauta

I didn't install any. Is there a firewall by default on the pi?

Reply to
Fokke Nauta

Net view \\raspberrypi showed error 53, network path not found. The same with \\IP address.

net use w: \\raspberrypi\pishare returned invalid user name and password.

I did: sudo apt-get update sudo apt-get install samba

In my config file there is no mangled names = no. I'll add it. And there is wins support = yes

Reply to
Fokke Nauta

So not 'server not found' nor 'server not running samba' but 'invalid name or password?

This does not gybe with your report that 'net view' returns *machine* not found..

sniff sniff. Strong smell of troll?

--
"What do you think about Gay Marriage?" 
"I don't." 
"Don't what?" 
"Think about Gay Marriage."
Reply to
The Natural Philosopher

You can check. Log in on the pi, sudo to root and type

iptables -nvL

--

-TV
Reply to
Tauno Voipio

Read this. Disabling IPV6 on the windows worked for him

formatting link

What has IPV6 got to do with this? Ask Bill Gates.

Reply to
The Natural Philosopher

net use w: \\raspberrypi\pishare The password or user name is invalid for \\raspberrypi\pishare.

Somewhat later: Enter the username for 'raspberrypi': pi Enter the password for raspberrypi: System error 1326 has occurred.

The user name or password is incorrect.

This is the message in my command screen.

Gybe? Don't know that word.

[C:\Program Files\JPSoft\TCCLE14x64]net view \\raspberrypi System error 53 has occurred.

The network path was not found.

Whatever you like. Sniff ahead. I ask for help. If you have a problem with that you'd better quit.

Reply to
Fokke Nauta

[C:\Program Files\JPSoft\TCCLE14x64]nbtstat -A 192.168.1.2 returns:

NetBIOS Remote Machine Name Table

Name Type Status --------------------------------------------- RASPBERRYPI UNIQUE Registered RASPBERRYPI UNIQUE Registered RASPBERRYPI UNIQUE Registered ??__MSBROWSE__? GROUP Registered WORKGROUP GROUP Registered WORKGROUP UNIQUE Registered WORKGROUP GROUP Registered

MAC Address = 00-00-00-00-00-00

Disabeling IPV6 did not work for me.

Fokke

Reply to
Fokke Nauta

sudo iptables -nvL Returns:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination

Does this mean anything to you?

Fokke

Reply to
Fokke Nauta

You haven't got any firewall rules blocking traffic.

Reply to
Andy Burns

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.