Tag Archives: samba

Samba mount directory file rename strange failure

Let’s start with the scenario where the problem occurs:
two Linux servers mount via samba, one for writing files and one for reading files. To prevent files from being read before they are written, a temporary file name is used first, then a rename
As a result, there is a problem that rename calls successfully, but the file name does not change. Mv command is executed manually and the error is “are the same file”. This situation occurs frequently after a machine is rebooted.
All kinds of search on the Internet, there is no appropriate keywords, search not useful information. I suddenly remembered to look at Dmesg and found useful error messages

CIFS VFS: Unexpected lookup error -112
CIFS VFS: cifs_mount failed w/return code = -112
CIFS VFS: Unexpected lookup error -112

Using this keyword to search the solution, tried renaming success

echo 0 > /proc/fs/cifs/OplockEnabled
# The following sentence didn't work. Renaming was successful.
echo 0 > /proc/fs/cifs/LookupCacheEnabled

 

Mount error (22): invalid argument refer to the mount.cifs (8) manual page (

View samba version is 4:
[root@redhat_192.168.0.12 16:08:07 ~]# rpm-qa samba
samb-4.9.1-6. El7.x86_64
For a long time, baidu has been mount command plus various parameters, confirmed that the user and password are no problem, directory permission is also given, finally is to use the following method to solve.
Add the parameter SEC = NTLMSSP to the mount configuration of /etc/fstab as follows:
//hahaha.com/devops/MNT /dev/cifs username=kenji,password=123456, SEC = NTLMSSP,rw,_netdev 0 0
Then save the configuration and rerun mount -a, and the mount succeeds

Samba shared server cannot be accessed and the path cannot be found

The Path cannot be found because the Samba Shared server is inaccessible
First blog post: P
Windows access can only go to the root directory, opening the Shared subdirectory indicates that the path could not be found, spelling error may occur, and the server appears “make_connection_SNum: canonicalize_connect_Path Fail…”
As an amateur, recently tried to built a Shared server, using the virtual machine to do the test before, run successfully, permissions can be implemented, the day before yesterday with a spare industrial control server, reinstall the Samba server, configuration files, and access configuration is copied, is unable to access, the same Windows, access to the original virtual machine SMB, completely normal, and access to the physical machine SMB, input \ IP address, a successful connection, input user name and password, is normal to list the Shared directory, but want to get into Shared subdirectory, have been tip don’t have access to:

recognized the wrong path, the Shared configuration is: share name: [security] and path /… /AQ, which identifies the Shared name as a path.
looks at the server and prompts “make_connection_snum: canonicalize_connect_path fails for service security, path/MNT /jx1_share/AQ”, the same is true for logging.

Samba error: session setup failed: NT_ STATUS_ LOGON_ FAILURE

On the command line, type the command:

~ $smbclient – L \ \ 127.0.0.1

session setup failed: NT_STATUS_LOGON_FAILURE

this is because the user ID executing the smbclient command is not a user of the samba service. The solution is as follows:

add the changed user ID to samba

~$smbpasswd -a user ID

set password as required

so that the user ID becomes a user of the samba service, enter the command

~ $smbclient – L \ \ 127.0.0.1

Domain = = [Example] the OS/Unix Server = [Samba 3.6.3]

Sharename Type the Comment

— — — — — — — — — — — — — — — — —

print $Disk Printer Drivers

cdrom Disk Samba server’s cd-rom

Music Disk Music files

IPC$IPC IPC Service (Samba File Server)

Domain = = [Example] the OS/Unix Server = [Samba 3.6.3]

Server Comment

— — — — — — — — — — — — — — — –

Test1 Samba File Server

Test2

Workgroup Master

— — — — — — — — — — — — — — — –

Example Test2

problem solved.



=============================================================



1. Session setup failed: NT_STATUS_LOGON_FAILURE
this error means that the user is wrong, it may be that the user does not exist, it may also be that the password is wrong, or the user exists in one of the users of samba and the system,
in a word is that the user and password have problems
. The NT_STATUS_BAD_NETWORK_NAME
error indicates that the Shared directory does not exist, or that the permissions are not right
, as in my case. I have a user named xiaowang. In the home directory of xiaowang, I created a new share directory,
, and added share to smb.conf to make it myshare. However, I have designated the valid user of this Shared directory as guest(also a user in the system). Now I have the share directory under home.

==================================================================================

the solution in the latest centos is to run the following command to resolve the samba NT_STATUS_BAD_NETWORK_NAME problem:
setsebool -p samba_enable_home_dirs=1

viewing the logs caused by the samba process being blocked by SELinux from accessing the home directory:
Feb 26 22:56:22 igosvr setroubleshoot: SELinux is preventing the samba daemon from reading users’ home directories. For complete SELinux messages. run sealert -l 6e7522fa-f56c-400e-9e04-3722033573b5


confirm that the SMB service above REDHAT has started and IPTABLES has closed

Samba getpeername failed. Error was transport endpoint is not connected error

SMBD [15295]: getpeername failover. Error was Transport endpoint is not connected

Add the following code to the /etc/samb/smb.conf configuration file:
the SMB ports = 139

restart SMB service # service SMB restart

(PS:

getpeername failed. Error was Transport endpoint is not connected with a real Error. SMB ports=139 Specifies the port number that the SMB service listens on. By default, it listens on both ports 139 and 445. When Windows XP tried to connect, both ports were tested, and finally only one port was selected to use and the other port was disconnected. All SMBS thought it was an error and were recorded.

>
Those entries in log.smbd do not really indicate a problem. They are due to a windows XP machine on local area network which inquires on both ports 445 and 139. Ultimatley, windows XP only uses one of those ports and it disconnects from the other one, which leads to the samba log entry. The log entries can be eliminated by having samba only listen on one of the two ports, as long as your server is not a PDC (Primary Domain Controller)(which mine is). I read somewhere that having samba only listen on one of the ports can cause a reduction in performance.