How to mount drives without password?

You can use gvfs - perhaps this only works for real removable storage - but anyway

gio mount -d /dev/sdyX

If your partition is not on removable device you could add the partitions in fstab adding user,noauto to the options section.

Another option is to use systemd unit(s) and complement the unit(s) with automount unit(s).

This option is useful in many ways

  • Predefined mountpoint
  • systemd mount on access
  • systemd umount when idle
  • Scripts don’t need to mount and unmount the device
  • Can be used with removable as well as fixed devices
  • Can be used with network file systems like webdav, ssh, ftp, smb
1 Like