I want to mount share folder. Curren command line:
sudo mount -t cifs -o username=USERNAME,password=PASSWD
Is it have some safe way (without permanent sudo and other). Any others utils?
If this is not possible in general, it will be enough for me to be able to mount only a certain shared folder to a certain place.
To be able to mount that folder as a normal user, include the mount options for the cifs folder in the configuration file /etc/fstab, and add the options
noauto,user
, similar to:The option
noauto
will make sure the drive is not mounted during startup, but will nevertheless register all parameters necessary to mount the drive. The optionuser
will allow any user to mount the drive.With this setup, any user is able to mount the share with the
mount
command, followed by the path that was specified in fstab where the folder is to be mounted, e.g.or followed by the share, as in
Easier, probably, will be to mount the share using the file manager (Files in standard Ubuntu 18.04). In standard Files, one mounts a drive by providing the URI, in the form of
smb://server/share
A dialog will pop up to ask login, domain and password. Optionally, these settings can be remembered. You can subsequently make a bookmark for easy one-click access in the future.
This works out of the box in several editions of Ubuntu (stock Ubuntu, but also Kubuntu, Xubuntu, ...) and avoids the need to change system configuration files.
Wanted to add a comment, but I do not have enough rep.
On Ubuntu 20 I got syntax errors when trying to add above mentioned entry:
here is what worked for me:
-o
was the offending party.