FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 09-05-2011, 06:17 AM
Itay
 
Default How to disable USB automounts

When I stick a USB device into the socket it is automounted; KDE pops
up device notification widget, file manager window, etc.


I tried to disable it:
KDE -> System Settings -> Removable Devices, and unchecked
"Enable automatic mounting of removable devices".
This didn't have any effect.

In fact, I would like to disable automounts for all users.

I found in this thread two (contradicting? redundant?) advices.
http://www.linuxquestions.org/questions/linux-newbie-8/disabling-usb-automount-kde-891757/

1) To remove the user from plugdev group.
(But how to avoid future new users from being added to that group?)

2) To disable automount in udev rules.
I don't understand udev at all, and couldn't locate the actual
lines that I should comment out.

What would you recommend me to do?
I would appreciate if some details will be provided (which lines to
comment out, which files, etc.)


Thanks in advance,
itay




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: alpine.DEB.2.00.1109050854490.2852@gandalf.furmane t">http://lists.debian.org/alpine.DEB.2.00.1109050854490.2852@gandalf.furmane t
 
Old 09-05-2011, 03:18 PM
Camaleón
 
Default How to disable USB automounts

On Mon, 05 Sep 2011 09:17:22 +0300, Itay wrote:

(...)

> 1) To remove the user from plugdev group.
> (But how to avoid future new users from being added to that group?)

(...)

Mmm... you can edit the default settings for users creation ("/etc/
adduser.conf") and removing that concrete group.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.09.05.15.18.09@gmail.com">http://lists.debian.org/pan.2011.09.05.15.18.09@gmail.com
 
Old 09-05-2011, 04:06 PM
Hendrik Boom
 
Default How to disable USB automounts

On Mon, 05 Sep 2011 09:17:22 +0300, Itay wrote:

> When I stick a USB device into the socket it is automounted; KDE pops up
> device notification widget, file manager window, etc.
>
> I tried to disable it:
> KDE -> System Settings -> Removable Devices, and unchecked "Enable
> automatic mounting of removable devices". This didn't have any effect.
>
> In fact, I would like to disable automounts for all users.

What I hate about automounts on a mutiuser system is taht it usually
picks the wrong user. If it picked the user whose vertual terminal is
actually on-screen at the moment it would be a big improvement.

-- hendrik


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: j42s2v$be1$2@dough.gmane.org">http://lists.debian.org/j42s2v$be1$2@dough.gmane.org
 
Old 09-05-2011, 06:47 PM
Brian
 
Default How to disable USB automounts

On Mon 05 Sep 2011 at 09:17:22 +0300, Itay wrote:

> When I stick a USB device into the socket it is automounted; KDE pops up
> device notification widget, file manager window, etc.
>
> I tried to disable it:
> KDE -> System Settings -> Removable Devices, and unchecked
> "Enable automatic mounting of removable devices".
> This didn't have any effect.
>
> In fact, I would like to disable automounts for all users.

In which case it would have to be done at the system level. Even if the
KDE System Settings method worked for you it is (if it's anything like
XFCE) configurable by a user - not what you want.

> I found in this thread two (contradicting? redundant?) advices.
> http://www.linuxquestions.org/questions/linux-newbie-8/disabling-usb-automount-kde-891757/
>
> 1) To remove the user from plugdev group.
> (But how to avoid future new users from being added to that group?)

The user would no longer be able to mount, view or use files on the USB
device. Which is ok if that is your intention. Removing a new user from
the plugdev group is a snap with vigr and not tedious if it is only
done every so often (and you remember!).

> 2) To disable automount in udev rules.
> I don't understand udev at all, and couldn't locate the actual
> lines that I should comment out.

Create the file

/etc/udev/rules.d/10-no-automount.rules

and in it put the line

ACTION="add|change", subsystem=="block", ENV{UDISKS_AUTOMOUNT_HINT}="never"

No need to reboot as it takes effect immediately.

Before doing this you will have read udisks(7) and know why it may not
work. You may also want to investigate changing the udev rule to see the
effect of UDISKS_PRESENTATION_HIDE.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110905184713.GP28063@desktop">http://lists.debian.org/20110905184713.GP28063@desktop
 
Old 09-05-2011, 07:38 PM
Bob Proulx
 
Default How to disable USB automounts

Itay wrote:
> When I stick a USB device into the socket it is automounted; KDE
> pops up device notification widget, file manager window, etc.
>
> I tried to disable it:
> KDE -> System Settings -> Removable Devices, and unchecked
> "Enable automatic mounting of removable devices".
> This didn't have any effect.

My experience is with GNOME but will report it to you anyway. Perhaps
the additional information will be useful.

For GNOME this behavior is part of Nautilus. You can use the
gconf-editor, navigate down to the Nautilus setting
/apps/nautilus/preferences/media_automount and disable it. Next to it
is media_automount_open and media_autorun_never in the same location.
I disable both of those too.

Bob
 
Old 09-07-2011, 12:39 PM
Itay
 
Default How to disable USB automounts

On Mon, 5 Sep 2011, Brian wrote:

[snip]


In fact, I would like to disable automounts for all users.


In which case it would have to be done at the system level. Even if the
KDE System Settings method worked for you it is (if it's anything like
XFCE) configurable by a user - not what you want.


Agreed.


I found in this thread two (contradicting? redundant?) advices.
http://www.linuxquestions.org/questions/linux-newbie-8/disabling-usb-automount-kde-891757/

1) To remove the user from plugdev group.
(But how to avoid future new users from being added to that group?)


The user would no longer be able to mount, view or use files on the USB
device. Which is ok if that is your intention. Removing a new user from
the plugdev group is a snap with vigr and not tedious if it is only
done every so often (and you remember!).


Sounds like the udev option is better in this case.


2) To disable automount in udev rules.
I don't understand udev at all, and couldn't locate the actual
lines that I should comment out.


Create the file

/etc/udev/rules.d/10-no-automount.rules

and in it put the line

ACTION="add|change", subsystem=="block", ENV{UDISKS_AUTOMOUNT_HINT}="never"

No need to reboot as it takes effect immediately.

Before doing this you will have read udisks(7) and know why it may not
work. You may also want to investigate changing the udev rule to see the
effect of UDISKS_PRESENTATION_HIDE.


Thanks for the information.
I will try to follow the prescription and reading advice.

Itay



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: alpine.DEB.2.00.1109071536070.2852@gandalf.furmane t">http://lists.debian.org/alpine.DEB.2.00.1109071536070.2852@gandalf.furmane t
 
Old 09-07-2011, 12:43 PM
Itay
 
Default How to disable USB automounts

On Mon, 5 Sep 2011, Camaleón wrote:


On Mon, 05 Sep 2011 09:17:22 +0300, Itay wrote:

(...)


1) To remove the user from plugdev group.
(But how to avoid future new users from being added to that group?)


(...)

Mmm... you can edit the default settings for users creation ("/etc/
adduser.conf") and removing that concrete group.


Oooopss. I should have thought about this myself.
Thanks for the reminding me ABC.

Itay



Greetings,
 
Old 09-07-2011, 12:48 PM
Itay
 
Default How to disable USB automounts

On Mon, 5 Sep 2011, Bob Proulx wrote:


Date: Mon, 5 Sep 2011 13:38:03 -0600
From: Bob Proulx <bob@proulx.com>
To: debian-user@lists.debian.org
Subject: Re: How to disable USB automounts

Itay wrote:

When I stick a USB device into the socket it is automounted; KDE
pops up device notification widget, file manager window, etc.

I tried to disable it:
KDE -> System Settings -> Removable Devices, and unchecked
"Enable automatic mounting of removable devices".
This didn't have any effect.


My experience is with GNOME but will report it to you anyway. Perhaps
the additional information will be useful.

For GNOME this behavior is part of Nautilus. You can use the
gconf-editor, navigate down to the Nautilus setting
/apps/nautilus/preferences/media_automount and disable it. Next to it
is media_automount_open and media_autorun_never in the same location.
I disable both of those too.

Bob



Sounds like the equivalent of what I tried with KDE.
As pointed out earlier in this thread this is a single-user solution
(for GNOME to; right?). It does not prevent other users from
automounting; nor new users.


So I will try to follow up the udev route.

Thanks,
Itay


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: alpine.DEB.2.00.1109071546080.2852@gandalf.furmane t">http://lists.debian.org/alpine.DEB.2.00.1109071546080.2852@gandalf.furmane t
 
Old 09-14-2011, 12:46 AM
Scott Ferguson
 
Default How to disable USB automounts

On 05/09/11 16:17, Itay wrote:
>
> When I stick a USB device into the socket it is automounted; KDE pops up
> device notification widget, file manager window, etc.
>
> I tried to disable it:
> KDE -> System Settings -> Removable Devices, and unchecked
> "Enable automatic mounting of removable devices".
> This didn't have any effect.
>
> In fact, I would like to disable automounts for all users.
>
> I found in this thread two (contradicting? redundant?) advices.
> http://www.linuxquestions.org/questions/linux-newbie-8/disabling-usb-automount-kde-891757/
>
>
> 1) To remove the user from plugdev group.
> (But how to avoid future new users from being added to that group?)
>
> 2) To disable automount in udev rules.
> I don't understand udev at all, and couldn't locate the actual
> lines that I should comment out.
>
> What would you recommend me to do?
> I would appreciate if some details will be provided (which lines to
> comment out, which files, etc.)
>
> Thanks in advance,
> itay
>
>
>
>
With the greatest respects to the previous posters and there
suggestions... this has nothing to do with membership of plugdev, custom
udev rules to try and over-ride existing hal fdi, udev, and policykit
rules won't work.

Policykit knows two types of mountable drives - system and removable...
Policykit's definition of "removable" is:-
"Typically, system internal devices include non-removable internal hard
disks and other drives that are not easily added/removed by a local
console user. The heuristic typically used is that only devices on
removable media and devices connected via Firewire, USB, eSATA and SDIO
are considered external."

First remove all the customisations you've added to udev etc

Second look make sure you have no fstab entries for external drives.

Third, have a read of /etc/hal/fdi/policy/preferences.fdi

Fourth - right-click on the SOLID icon in the systray
choose "Device Notifier Settings"
in the pop-up dialog choose "Removable Devices" in the left-hand pane
Untick "Automatic mounting of removable media" and click on "OK"

If you're still stuck:-
Please paste the output of:-
ls -R /etc/hal
cat /etc/hal/fdi/policy/preferences.fdi
ls -R /etc/polkit-1

Cheers

--
"I ascribe to Mark Twain's theory that the last person who should be
President is the one who wants it the most. The one who should be picked
is the one who should be dragged kicking and screaming into the White
House."
— Bill Hicks


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4E6FF974.2030604@gmail.com">http://lists.debian.org/4E6FF974.2030604@gmail.com
 
Old 09-14-2011, 10:59 AM
Brian
 
Default How to disable USB automounts

On Wed 14 Sep 2011 at 10:46:44 +1000, Scott Ferguson wrote:

> With the greatest respects to the previous posters and there
> suggestions... this has nothing to do with membership of plugdev, custom
> udev rules to try and over-ride existing hal fdi, udev, and policykit
> rules won't work.

I'd agree that the OP's KDE specific issue should be tackled from within
KDE, but if the desire is to disable automounting for all users then
surely udev is the route to take? Furthermore, udev should not be used to
make up for any failure to solve the problem from within the DE.

> Policykit knows two types of mountable drives - system and removable...
> Policykit's definition of "removable" is:-
> "Typically, system internal devices include non-removable internal hard
> disks and other drives that are not easily added/removed by a local
> console user. The heuristic typically used is that only devices on
> removable media and devices connected via Firewire, USB, eSATA and SDIO
> are considered external."

Times change:

http://lists.freedesktop.org/archives/devkit-devel/2011-June/001094.html

> This is why the DeviceIsSystemInternal property, this one

> http://hal.freedesktop.org/docs/udisks/Device.html#DeviceeviceIsSystemInternal

> talks about "heuristics". Note that this property will be removed in
> udisks in the next ABI break (2.0).

July of the same mailing list also has a disussion on the same topic.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110914105931.GA17810@desktop">http://lists.debian.org/20110914105931.GA17810@desktop
 

Thread Tools




All times are GMT. The time now is 07:38 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org