Mount internal device without needing password?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

Mount internal device without needing password?

Postby Merenguey on Sun Dec 08, 2013 10:57 am

Hi guys,


Sorry for my misunderstanding, but I'd like to do the contrary : skip password when mounting an internal device.

Exactly, I have two sessions on my LMDE 201303 : a root and a standard session. With the standard session, I'd like to mount an internal device (unassigned, i.e. not "/" nor "/home"). Everytime I want to mount it, root password is asked. The thing is I'd like to automount this device which I can't.


Any ideas ?


Merenguey
Last edited by Merenguey on Mon Dec 09, 2013 8:17 pm, edited 3 times in total.
Merenguey
Level 1
Level 1
 
Posts: 11
Joined: Fri Jun 01, 2012 10:13 am

Linux Mint is funded by ads and donations.
 

Re: How to mount internal device without needing password?

Postby jahid on Sun Dec 08, 2013 1:40 pm

you can edit the /etc/fstab file for automount
sudo gedit /etc/fstab
add the follwing line for each drive to automount at startup:
/dev/sdax /media/user/label ntfs defaults 0 0
x in 'sdax' depends on the drive.u can check it with the 'Disks' application
user= your user name
label= drive label
ntfs will be replaced by the type of the drive.
jahid@HP ProBook 440 G1 Laptop
User avatar
jahid
Level 5
Level 5
 
Posts: 841
Joined: Sat Dec 07, 2013 4:07 pm
Location: Khulna, Bangladesh

Re: How to mount internal device without needing password?

Postby Merenguey on Mon Dec 09, 2013 7:18 am

Thanks for the answer. To be precise, this internal device was configured during the initial partition (i.e. installation). That's why a root password is required to mount it. But what I'd like is to remove the password request to mount it.

Anyway, I did the /etc/fstab handling and it worked for both my normal & my root session. BUT if I unmount the device, it is impossible to mount it again, no matter the session nor the reboot :

Error mounting : mount exited with exit code 1 : helper failed with:
mount: only root can mount /dev/sda7 on on /media/path-to-the-folder


So, IMHO, it can only work once, which is not a very great thing... :|


So, how can I remove the password request when I mount this logical partition ? I don't think gparted can, even though it was implied during the initial partitioning process.
Merenguey
Level 1
Level 1
 
Posts: 11
Joined: Fri Jun 01, 2012 10:13 am

Re: How to mount internal device without needing password?

Postby altair4 on Mon Dec 09, 2013 8:14 am

This is a very confusing topic since if you originally had an entry in fstab it shouldn't be asking you for sudo authority to mount since it's already mounted and I have no idea why one wants to unmount a partition that is automounted at boot but you might want to post the output of the following commands so people here can see how you are set up:
Code: Select all
cat /etc/fstab

Code: Select all
sudo blkid -c /dev/null

I try to stay out of LMDE as much as I can but with the info provided above it may help others help you.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6080
Joined: Tue Feb 03, 2009 10:27 am

Re: How to mount internal device without needing password?

Postby Merenguey on Mon Dec 09, 2013 9:22 am

Hi,


Sorry I see I didn't explain well. What I'm doing is configuring a linux computer for my family. In order to avoid any mess up, I prefer to keep control of the root session and let my family use the standard session. I need to automount an internal device at startup but, I don't know why, a sudo authority is required (on my linux mint 15 I have the same config and I can mount it without any sudo authority).

So, when I edited the /etc/fstab, I mounted it manualy before, then copy-pasted the /etc/mtab output in the /etc/fstab. In this way, when computer is restarted, it has already the automounting. Like this, everything can work.

BUT, just in case, I would not like that anyone could unmount the device and start messing. I live far from them and couldn't work on the computer.

Basicaly, my need is to know how to mount the device without any sudo authority (and if possible understand why damn this device require a sudo authority with LMDE). Like this, if unfortunatly the device is unmounted, it won't cause any problem when restarted. At first, I though it had something to see with permission, so I gave device's ownership to my standard session. But it's still useless in case of bad handling.


Here what asked :

cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=77df698b-3a93-47ec-9af0-7868da63ff94 /boot ext3 rw,errors=remount-ro 0 0
# /dev/sda5
UUID=b48e062b-d5ca-48f8-ac4e-de5c5a6b28d4 swap swap sw 0 0
# /dev/sda6
UUID=e92d7af0-0858-4af5-92c1-80095fa3a75b / ext4 rw,errors=remount-ro 0 1
rw,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered 0 0


sudo blkid -c /dev/null
/dev/sda1: UUID="77df698b-3a93-47ec-9af0-7868da63ff94" TYPE="ext3"
/dev/sda5: UUID="b48e062b-d5ca-48f8-ac4e-de5c5a6b28d4" TYPE="swap"
/dev/sda6: UUID="e92d7af0-0858-4af5-92c1-80095fa3a75b" TYPE="ext4"
/dev/sda7: UUID="efdf9613-2f7e-4699-9a15-2aafe2cf66a3" TYPE="ext4"


The /dev/sda7 device is the one involved.
Merenguey
Level 1
Level 1
 
Posts: 11
Joined: Fri Jun 01, 2012 10:13 am

Re: How to mount internal device without needing password?

Postby altair4 on Mon Dec 09, 2013 9:51 am

So why not just create a mount point at say ... /mnt/Data and have the partition auto mount at boot by adding a line to the end of fstab:
Code: Select all
UUID=efdf9613-2f7e-4699-9a15-2aafe2cf66a3 /mnt/Data ext4 defaults,noatime 0 2

*** No password is required to mount that partition since root mounts it at boot.
*** Only someone who has sudo authority can unmount that partition and your "regular" users have no such authority.
*** And for the user that has sudo authority he has no need to unmount it.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6080
Joined: Tue Feb 03, 2009 10:27 am

Re: How to mount internal device without needing password?

Postby Merenguey on Mon Dec 09, 2013 9:57 am

Let me have a try but thanks anyway. Seems a good one. :D


M.
Merenguey
Level 1
Level 1
 
Posts: 11
Joined: Fri Jun 01, 2012 10:13 am

Re: How to mount internal device without needing password?

Postby kurotsugi on Mon Dec 09, 2013 11:15 am

if those doesn't satisfy you, you can try this one. open /usr/share/polkit-1/action/org.freedesktop.udisk2.policy and look into
Code: Select all
<action id="org.freedesktop.udisks2.filesystem-mount-system">
scroll down a litle bit and you'll see
Code: Select all
<defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
  </action>
you'll need to change the value to yes
Code: Select all
<defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

the change work after logout.
kurotsugi
Level 5
Level 5
 
Posts: 915
Joined: Fri Jan 25, 2013 3:54 am

Re: How to mount internal device without needing password?

Postby Merenguey on Mon Dec 09, 2013 7:35 pm

Thanks everyone, problem's solved ! I picked kurotsugi's solution (it was what I was looking for).

Just one last thing, what about unmounting the device ? Because with this solution, my standard session can unmount the device anytime without any authorisation. Because for 1 hour I'm doing everything but succeeding... :x

How could I add a specification :
if anyone want to mount it : no sudo authority => this one is okay
if anyone want to unmount : sudo authority => this one ain't


(I promise this is the last question :mrgreen: ).


M.
Merenguey
Level 1
Level 1
 
Posts: 11
Joined: Fri Jun 01, 2012 10:13 am

Re: Mount internal device without needing password?

Postby kurotsugi on Tue Dec 10, 2013 4:48 pm

I'm afraid we can't do that.
Code: Select all
<action id="org.freedesktop.udisks2.filesystem-unmount-others">
this part only gives password when the disk is mounted by another user.
kurotsugi
Level 5
Level 5
 
Posts: 915
Joined: Fri Jan 25, 2013 3:54 am

Re: How to mount internal device without needing password?

Postby sdibaja on Mon Apr 21, 2014 2:18 pm

kurotsugi wrote:if those doesn't satisfy you, you can try this one. open /usr/share/polkit-1/action/org.freedesktop.udisk2.policy and look into
Code: Select all
<action id="org.freedesktop.udisks2.filesystem-mount-system">
scroll down a litle bit and you'll see
Code: Select all
<defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
  </action>
you'll need to change the value to yes
Code: Select all
<defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

the change work after logout.


I am trying to automount by editing fstab also. I have done it with several distros with no issues, but with LMDE Update Pack 8 it does not work.
I have this path: /usr/share/polkit-1/actions
containing these 2 files:org.freedesktop.udisk2.policy and org.freedesktop.udisk.policy

If I make the edit to "yes" on either or both it does not work.

I can mount with the file manager, but it asks for password.
My use if for LuckBackup. BTW: even if mounted with file manager LuckyBackup says the drive in not mounted

confounded here
User avatar
sdibaja
Level 2
Level 2
 
Posts: 71
Joined: Sun May 08, 2011 12:57 pm
Location: Mexico

Re: Mount internal device without needing password?

Postby kurotsugi on Tue Apr 22, 2014 1:49 am

If I make the edit to "yes" on either or both it does not work.

I can mount with the file manager, but it asks for password.
My use if for LuckBackup. BTW: even if mounted with file manager LuckyBackup says the drive in not mounted

you need to uninstall one of them. in my case I choose to uninstall udisk and leave udisk2.
kurotsugi
Level 5
Level 5
 
Posts: 915
Joined: Fri Jan 25, 2013 3:54 am

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 6 guests