2

I have the following share set up on Ubuntu 22 LTS:

[share]
path = /home/user/trunk
browsable = yes
writeable = yes
public = yes

I ran sudo smbpasswd -a user and set the password to be the same as the login password for Ubuntu. I then restarted the service with sudo service smbd restart.

I cannot connect to the share. When I try I get an "access denied" message in Windows 10, and it asks for my credentials again. This repeats in an endless loop.

The log file shows:

[2023/08/02 14:12:08.287659,  3] ../../source3/smbd/smb2_server.c:3954(smbd_smb2_request_error_ex)

  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_tcon.c:151

[2023/08/02 14:12:08.307824,  1] ../../source3/smbd/smb2_tcon.c:242(smbd_smb2_tree_connect)

  smbd_smb2_tree_connect: reject request to share [IPC$] as 'UBUNTU22\user' without encryption or signing. Disconnecting.

[2023/08/02 14:12:08.307887,  3] ../../source3/smbd/smb2_server.c:3954(smbd_smb2_request_error_ex)

  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_tcon.c:151

[2023/08/02 14:12:13.991527,  1] ../../source3/smbd/smb2_tcon.c:242(smbd_smb2_tree_connect)

  smbd_smb2_tree_connect: reject request to share [IPC$] as 'UBUNTU22\user' without encryption or signing. Disconnecting.

[2023/08/02 14:12:13.991679,  3] ../../source3/smbd/smb2_server.c:3954(smbd_smb2_request_error_ex)

  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_tcon.c:151

Things I have tried:

  • Setting the password to "password" and making sure it was typed correctly.
  • Adding ntlm auth = yes to smb.conf
  • Commenting out map to guest = bad user in smb.conf.
  • Commenting out usershare allow guests = yes in smb.conf.
  • Adding security = user to smb.conf.
  • Removing samba entirely and re-installing it with apt.
  • Trying to access the share directly via `\UBUNTU22\share'.

I also tried a fresh install of Ubuntu 22 and instead of editing smb.cong, I simply right clicked on a folder in my home directory and set up "local user sharing". That allows me to see the folder from Windows when browsing the machine, but I cannot open it as I get into the same credential loop as before. Interestingly, whatever that method does it does not appear to edit smb.conf because the shared folder does not appear in there.

8
  • (1) Is SELinux active? (2) In smb.conf, is security = user (the default)? (3) Try this Commented Aug 2, 2023 at 14:36
  • security=user was not the default. I tried the sestatus command but it was not installed, so I guess the answer is no. Commented Aug 2, 2023 at 15:13
  • I have this working. I had to do some minor repairs to Ubuntu 22.04 LTS but then it all works. Go through this article in detail and follow the steps ubuntu.com/tutorials/… Commented Aug 2, 2023 at 15:20
  • Thanks @John, but I did follow that article previously and it didn't work. Kind of amazing that the LTS version has broken Samba out of the box. Commented Aug 2, 2023 at 15:22
  • It is all working here. Commented Aug 2, 2023 at 15:22

2 Answers 2

1

The solution was to reboot Ubuntu, twice. I have no idea why the second reboot worked, I initially rebooted to see if it would work, gave up for the day, and in the morning it was letting me browse the share with read/write access.

Possibly it is some kind of caching issue, but I'm not sure if it is on the Linux or Windows side. Reboot everything like it's 1995 I guess.

-1

There is a guide to installing and configuring Samba that is worth reviewing and following.

Install and configure Samba

Key pointst:

Install / reinstall Samba and ensure it is working.

Ensure smb.conf is properly configured. sudo nano /etc/samba/smb.conf.

Add the following lines at the bottom of the file: [sambashare} comment = Samba on Ubuntu path = /home//sambashare read only = no browsable = yes

Restart the samba service: sudo service smbd restart Update the firewall rules if necessary: sudo ufw allow samba

Add the user: sudo smbpasswd -a and password

In Windows: \192.168.x.y where this is the IP of the Linux Machine

All this has been tested and works.

You might have restarted systems along the way.

At the end do complete restarts of both systems to be sure everything has been reset and ensure you can ping both ways.

2
  • 1
    As I said, merely restarting the service was not enough. Commented Aug 3, 2023 at 19:26
  • I did add to do complete OS restarts on all systems. I merely captured key points from the link so as not to have a blind link. The complete answer covers all I did and your restarts as well. Restarts will restart all services which likely helped. Commented Aug 3, 2023 at 19:29

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.