All posts by Don Matteo

lebt in der Schweiz, ist System Engineer MCP bei A-Enterprise GmbH. Mitglied des UNBLOG Knowledge Network. Author und Blogger zu den Themen, Tutorials für Linux und Open Source.

Windows SMBv1 1.0/CIFS Client Server

SMB: Unable to access windows share using SMBv1 1.0/CIFS Client Server

Microsoft announcement of 01.07.2020.

Windows 10 Fall Creators Update and Windows Server, version 1709 (RS3) and later versions, the Server Message Block Version 1 (SMBv1) network protocol is no longer installed by default. The Windows SMB (SMBv1) protocol has been replaced by SMBv2 and newer protocols (SMBv3) since 2007. Microsoft publicly rejected the SMBv1 protocol in 2014.

Windows SMB v1 has vulnerabilities that allow remote code execution or denial-of-service attacks. Therefore it should be deactivated. Windows 10 Enterprise and Windows Server 2016 no longer includes the SMB v1 client or SMBv1 server by default after a new installation.

Windows 10 Home and Windows 10 Pro still contain the SMBv1 client by default after a new installation. If the SMBv1 client is not in use for a total of 15 days (except for the computer that is turned off), it is automatically uninstalled.

SMBv1 can still be reinstalled in all editions of Windows 10 and Windows Server 2016.

Enable SMBv1 using the MSC method

The SMBv1 network protocol can be activated on Windows 10 and Windows 11 with the Windows+R and the input of control appwiz.cpl,,2 in the Windows Features window.

Open Windows-Features of Windows 10 / Windows 11.

Check windows feature with support for SMB 1.0/CIFS file sharing check boxes:
– SMB 1.0/CIFS Automatically remove
– SMB 1.0/CIFS client

The SMB 1.0/CIFS client will remain activated as long as it is used, if no activity is detected during the 15 days. SMBv1 will deactivate itself for security reasons.

PowerShell method enable SMBv1

Enable SMB 1.0/CIFS in the PowerShell as follows, administrator rights are required.

PS C:\> Enable-WindowsOptionalFeature -Online FeatureName SMB1Protocol

Check the status of SMBv1 in the PowerShell.

PS C:\> Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol

Disable the Windows SMB SMBv1 network protocol in the PowerShell

PS C:\> Disable-WindowsOptionalFeature -Online FeatureName SMB1Protocol

The computer must be restarted after these changes are made.

If you want to automatically remove the feature SMB 1.0/CIFS, probably from a login script. The method is suitable with using Deployment Image Servicing and Management (DISM).

PS C:\> Dism /online /Disable-Feature /FeatureName:"SMB1Protocol" /NoRestart

The feature SMB 1.0/CIFS client and server are removed without prompting any user interaction, administrator rights are required; the change will take effect the next time the client is started.

Conclusion

This tutorial shows what to do if you get the error message “Unable to access windows share” after trying to access a file share. This error message first appears after the Windows 1709 update has been applied.

I’ll show you what to do how to enable SMB 1.0/CIFS protocol. To become access to windows share using SMBv1 1.0/CIFS Client Server.

How to get Linux Mint Recovery Mode

When Linux Mint is installed on the computer and no other operating systems are available, the Grub Boot menu is hidden by default. In order to get the Grub menu with the Linux Mint Recovery Mode at startup, the right Shift key has to be pressed after switching on, unfortunately this does not work with virtual machines, here you have to set up the Grub menu persistently.

Enable Linux Mint Recovery Menu

If the Grub menu should appear at each start to get the recovery menu for system repairs, or to pass kernel parameters, edit the file 90_custom.cfg as root:

First become root with sudo su –

$ vi /etc/default/grub.d/90_custom.cfg

then add the following lines:

GRUB_TIMEOUT="5"
GRUB_TIMEOUT_STYLE="menu"

If the file 90_custom.cfg does not exist, simply create it with an editor of your choice.

After editing, run the following command:

$ sudo update-grub

Reboot:
The grub boot menu will appear the next time you start

Choose the second entry “Advanced options for Linux Mint 20”.

The recovery menu with repair options and the root shell appears promptly.

Choose “Drop to root shell prompt” that opens the Single Mode Console.

Linux Mint Recovery Mode (Single Mode)

Enter in maintenance console. Here you are root and have write permissions on the file system. The single-user runlevel is the lowest operating state for maintenance, in which only system resources such as hard drives or file systems are active.

root password forgotten

Here are some of the most self-inflicted errors. If the root password has been forgotten, a new one can now be assigned.

root@localhost:# passwd root

sudo rulebook plugin could not be initialized

Improper changes to the sudoers file may result in errors.

$ sudo visudo
>>> /etc/sudoers: syntax error near line 24 <<<
sudo: parse error in /etc/sudoers near line 24
sudo: no valid sudoers sources found, quitting

If sudo is no longer possible in the standard runlevel and you have locked out yourself as root, sudo can be restored.

Before /etc/sudoers can be changed, the file must be given write permission.

$ chmod u+w /etc/sudoers && vi /etc/sudoers

After editing, sudoers must be protected again.

$ chmod u-w /etc/sudoers

Here is the sudoers original file of Linux Mint 20 in case it has been changed to unusable.

#
This file MUST be edited with the 'visudo' command as root.
#
Please consider adding local content in /etc/sudoers.d/ instead of
Directly modifying this file.
#
See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

Host alias specification

User alias specification

Cmnd alias specification

User privilege specification
root ALL=(ALL:ALL) ALL

Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

Note! Changes should always only be made with visudo.

Hard drive has no free space

If there is no more free disk space, the logs can no longer be saved, which leads to system downtime, here the space allocation can be checked in the Single User Mode Console to create free space again.

$ tree -ah /var/log -L 1
$ tree --you -d -shaC | grep -Ev '[^ ]( ** ){2}

If the tree command does not exist on the system, one of the following (disk usage) commands can help.

$ sudo du -hc --max-depth=0 /var
$ sudo du -ah /var | sort -n -r | head -n 5
$ sudo du /home -Sh | sort -rh | head -5