A method has been discovered in this blog that we can use to mount the SMB shares on Ubuntu 22.04.
How to mount SMB shares on Ubuntu 22.04
To mount the SMB shares on Ubuntu, we need to make sure that the other utilities and dependencies of SMB shares are installed with the following command:
Now create a directory where you have shared the files and folders that you want to be accessible from the other computers on the same network:
The next step is to create the credentials file, but to keep it safe, hide it with the “.” command:
Copy and paste the following script into the newly opened file:
Save the file with CTRL+S and exit the editor with the shortcut CTRL+X and then change its access permissions with the command:
The next step is to find out the IP address of the computer using the following command:
Now run the command mentioned below, substituting the IP address of the machine:
Another method to mount the SMB share is manually, and for this we need to open the file with the nano text editor:
A file will open, at the end copy and paste the following line, replacing the IP address:
Exit the editor by saving the changes made to the /etc/fstab file.
Using the cifs utilities, SMB shares can be mounted on Ubuntu by installing them with the command “sudo apt install cifs-utils -y”. This blog explored two different methods of mounting the SMB shares on Ubuntu 22.04.