In this blog, a method has been discovered by which we can 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 have to make sure the other utilities and dependencies of SMB shares are installed by using the command:
Now, create a directory in which you shared the files and folders which should be accessed by the other machines in the same network:
Next step is to create the credential file but to keep it secure, hide it using the “.” command:
Copy and paste the below script in the newly opened file:
password=example_password
Save the file by using the CTRL+S and exit the editor using the shortcut with CTRL+X and then change its access permissions using the command:
Next step is to find out the IP address of the machine using the command:
Now run the below-mentioned command by replacing the IP address of the machine:
Another method to mount the SMB share is by manually, and for this, we have to open the file using the nano text editor:
A file will be opened, at the end, copy and paste the below-mentioned line by replacing the IP address:
Exit the editor by saving the changes made in the file /etc/fstab.
Conclusion
With the help of the cifs utilities, SMB Shares can be mounted on Ubuntu by installing them with the command “sudo apt install cifs-utils -y”. In this blog, two different methods have been explored of mounting the SMB Shares on Ubuntu 22.04.