You are not logged in.

#1 2024-08-27 06:45:56

silver-lasombra
Member
Registered: 2024-08-14
Posts: 14

[SOLVED]How to mount disks in Nemo without entering password?

I used cinnamon desktop and Nemo filemanager.
When I tried to mount disks by clicking in Nemo, it asked me to enter the password.
However in Linux Mint password is not needed.
How should I do to mount disks in Nemo without entering password, just like the same in Linux Mint?

Last edited by silver-lasombra (2024-09-02 08:11:08)

Offline

#2 2024-08-27 07:35:59

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: [SOLVED]How to mount disks in Nemo without entering password?

nemo uses udisks and if that asks you for a password w/o you messing around w/ polkit the most likely cause is a degenerated session.

loginctl session-status

If you're using dbus-launch anywhere: don't.
If you're using startx/xinit - please post your xinitrc, it's likely broken (see last link below)

Offline

#3 2024-08-30 01:39:06

silver-lasombra
Member
Registered: 2024-08-14
Posts: 14

Re: [SOLVED]How to mount disks in Nemo without entering password?

seth wrote:

nemo uses udisks and if that asks you for a password w/o you messing around w/ polkit the most likely cause is a degenerated session.

loginctl session-status

If you're using dbus-launch anywhere: don't.
If you're using startx/xinit - please post your xinitrc, it's likely broken (see last link below)

I find out that I'm using dbus; but I couldn't understand what I should do next. Could you make it more clearly?

Offline

#4 2024-08-30 07:03:06

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: [SOLVED]How to mount disks in Nemo without entering password?

Of course you're using "dbus", that's not the same as dbus-launch.
Post the requested outputs and files

loginctl session-status
cat ~/.xinitrc
echo $DBUS_SESSION_BUS_ADDRESS
ps aux | grep dbus

Offline

#5 2024-08-30 08:06:52

silver-lasombra
Member
Registered: 2024-08-14
Posts: 14

Re: [SOLVED]How to mount disks in Nemo without entering password?

Solutions found here

Offline

#6 2024-08-30 08:16:21

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: [SOLVED]How to mount disks in Nemo without entering password?

Do not mess around w/ polkit!
The default policy in /usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy grants active users to mount things.

=> Fix your session, start by posting the output of the commands in #4

Offline

#7 2024-08-30 11:19:47

silver-lasombra
Member
Registered: 2024-08-14
Posts: 14

Re: [SOLVED]How to mount disks in Nemo without entering password?

asombra@archcinnamon ~]$ loginctl session-status 
1 - lasombra (1000)
  Since: Fri 2024-08-30 19:14:43 CST; 2min 4s ago
  State: active
 Leader: 691 (lightdm)
   Seat: seat0; vc7
    TTY: tty7
 Remote: no
Service: lightdm-autologin
   Type: x11
  Class: user
Desktop: cinnamon
   Idle: no
   Unit: session-1.scope
         ├─ 691 lightdm --session-child 13 16
         ├─ 719 /usr/lib/cinnamon-session/cinnamon-session-binary --session cinnamon
         ├─ 746 /usr/bin/csd-keyboard
         ├─ 747 /usr/bin/csd-settings-remap
         ├─ 748 /usr/bin/csd-automount
         ├─ 749 /usr/bin/csd-media-keys
         ├─ 754 /usr/bin/csd-background
         ├─ 756 /usr/bin/csd-wacom
         ├─ 759 /usr/bin/csd-a11y-settings
         ├─ 760 /usr/bin/csd-clipboard
         ├─ 762 /usr/bin/csd-print-notifications
         ├─ 763 /usr/bin/csd-xsettings
         ├─ 764 /usr/bin/csd-color
         ├─ 767 /usr/bin/csd-screensaver-proxy
         ├─ 768 /usr/bin/csd-housekeeping
         ├─ 785 /usr/lib/cinnamon-settings-daemon/csd-printer
         ├─ 904 cinnamon-launcher
         ├─ 935 cinnamon --replace
         ├─ 961 /usr/lib/xapps/xapp-sn-watcher
         ├─ 976 /usr/lib/geoclue-2.0/demos/agent
         ├─ 978 /usr/bin/nemo-desktop
         ├─ 980 pamac-tray
         ├─ 981 /usr/bin/vmtoolsd -n vmusr --blockFd 3
         ├─ 982 /usr/bin/nm-applet
         ├─ 983 cinnamon-killer-daemon
         ├─ 985 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
         ├─1181 /usr/bin/nemo
         └─1200 /usr/bin/nemo /home/lasombra

8月 30 19:14:45 archcinnamon gnome-keyring-daemon[745]: discover_other_daemon: 1
8月 30 19:15:00 archcinnamon cinnamon-killer-daemon[983]: Bound Cinnamon restart to <Control><Alt>Escape.
8月 30 19:15:16 archcinnamon cinnamon-session-binary[719]: WARNING: t+31.40630s: Application 'cinnamon-settings-daemon-power.desktop' killed by signal 11
8月 30 19:15:28 archcinnamon polkit-agent-helper-1[1207]: pam_systemd_home(polkit-1:auth): New sd-bus connection (system-bus-pam-systemd-home-1207) opened.
8月 30 19:15:33 archcinnamon pkexec[1200]: pam_unix(polkit-1:session): session opened for user root(uid=0) by lasombra(uid=1000)
8月 30 19:15:33 archcinnamon pkexec[1200]: lasombra: Executing command [USER=root] [TTY=unknown] [CWD=/home/lasombra] [COMMAND=/usr/bin/nemo /home/lasombra]
8月 30 19:15:43 archcinnamon cinnamon-session-binary[719]: WARNING: t+57.65130s: Application 'cinnamon-settings-daemon-power.desktop' killed by signal 11
8月 30 19:15:43 archcinnamon cinnamon-session-binary[719]: WARNING: t+57.65229s: App 'cinnamon-settings-daemon-power.desktop' respawning too quickly
8月 30 19:15:43 archcinnamon cinnamon-session-binary[719]: WARNING: t+57.65285s: Error on restarting session managed app: Component 'cinnamon-settings-daemon-power.desktop' crashing too quickly
8月 30 19:16:04 archcinnamon polkit-agent-helper-1[1275]: pam_systemd_home(polkit-1:auth): New sd-bus connection (system-bus-pam-systemd-home-1275) opened.
[lasombra@archcinnamon ~]$ cat ~/.xinitrc
cat: /home/lasombra/.xinitrc: 没有那个文件或目录 (means 'no such file or directory')
[lasombra@archcinnamon ~]$ echo $DBUS_SESSION_BUS_ADDRESS
unix:path=/run/user/1000/bus
[lasombra@archcinnamon ~]$ ps aux | grep dbus
dbus         464  0.0  0.1   7264  3624 ?        Ss   19:14   0:00 /usr/bin/dbus-broker-launch --scope system --audit
dbus         469  0.1  0.1   5284  3664 ?        S    19:14   0:00 dbus-broker --log 4 --controller 9 --machine-id 4e033ce8095f48faae4e8028714e0323 --max-bytes 536870912 --max-fds 4096 --max-matches 131072 --audit
lasombra     717  0.0  0.1   6808  3328 ?        Ss   19:14   0:00 /usr/bin/dbus-broker-launch --scope user
lasombra     718  0.1  0.1   5344  3584 ?        S    19:14   0:00 dbus-broker --log 4 --controller 10 --machine-id 4e033ce8095f48faae4e8028714e0323 --max-bytes 100000000000000 --max-fds 25000000000000 --max-matches 5000000000
lasombra     847  0.0  0.1   6808  3328 ?        S    19:14   0:00 /usr/bin/dbus-broker-launch --config-file=/usr/share/defaults/at-spi2/accessibility.conf --scope user
lasombra     848  0.0  0.1   4216  2432 ?        S    19:14   0:00 dbus-broker --log 4 --controller 9 --machine-id 4e033ce8095f48faae4e8028714e0323 --max-bytes 100000000000000 --max-fds 6400000 --max-matches 5000000000
lasombra    1380 33.3  0.1   9752  2432 pts/0    S+   19:17   0:00 grep --color=auto dbus

By the way, since I'm the only user of my PC, overwrite the default polkit rule maybe shouldn't be a problem?

Last edited by silver-lasombra (2024-08-30 11:28:41)

Offline

#8 2024-08-30 14:53:28

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: [SOLVED]How to mount disks in Nemo without entering password?

The problem isn't so much security as that a broken session has wider implications.

That being said, you're starting the session w/ lightdm, not xinit, the session is active, $DBUS_SESSION_BUS_ADDRESS as expected, there's no extra dbus daemon/launch (at-spi aside)

But
1. Service: lightdm-autologin
What if you do not login automatically?

2.

8月 30 19:15:28 archcinnamon polkit-agent-helper-1[1207]: pam_systemd_home(polkit-1:auth): New sd-bus connection (system-bus-pam-systemd-home-1207) opened.
8月 30 19:15:33 archcinnamon pkexec[1200]: pam_unix(polkit-1:session): session opened for user root(uid=0) by lasombra(uid=1000)
8月 30 19:15:33 archcinnamon pkexec[1200]: lasombra: Executing command [USER=root] [TTY=unknown] [CWD=/home/lasombra] [COMMAND=/usr/bin/nemo /home/lasombra]

Are you trying to run nemo as root??

Offline

#9 2024-08-31 02:12:43

silver-lasombra
Member
Registered: 2024-08-14
Posts: 14

Re: [SOLVED]How to mount disks in Nemo without entering password?

1.After I disabled autologin and reboot, lightdm-slick-greeter didn't show up, with only a black screen left(and a short bar flashing on the top-left of the screen)
Switching to tty is almost impossible because it force me to jump to tty7 after I use ctrl+alt+(from f2 to f6).
I had to boot from arch live CD and install lightdm-gtk-greeter(which is conflicted with previously installed mint-artwork).
After that I repeat #4, this is the log: (seems nothing changed)

[lasombra@archcinnamon ~]$ loginctl session-status
2 - lasombra (1000)
  Since: Sat 2024-08-31 10:02:52 CST; 5min ago
  State: active
 Leader: 624 (lightdm)
   Seat: seat0; vc7
    TTY: tty7
 Remote: no
Service: lightdm
   Type: x11
  Class: user
Desktop: cinnamon
   Idle: no
   Unit: session-2.scope
         ├─624 lightdm --session-child 13 17
         ├─659 /usr/lib/cinnamon-session/cinnamon-session-binary --session cinn>
         ├─684 /usr/bin/csd-keyboard
         ├─685 /usr/bin/csd-settings-remap
         ├─686 /usr/bin/csd-automount
         ├─687 /usr/bin/csd-media-keys
         ├─692 /usr/bin/csd-background
         ├─693 /usr/bin/csd-power
         ├─696 /usr/bin/csd-wacom
         ├─698 /usr/bin/csd-a11y-settings
         ├─699 /usr/bin/csd-clipboard
         ├─701 /usr/bin/csd-print-notifications
         ├─704 /usr/bin/csd-xsettings
         ├─711 /usr/bin/csd-color
         ├─712 /usr/bin/csd-screensaver-proxy
         ├─713 /usr/bin/csd-housekeeping
         ├─740 /usr/lib/cinnamon-settings-daemon/csd-printer
         ├─865 cinnamon-launcher
         ├─880 cinnamon --replace
         ├─908 /usr/lib/xapps/xapp-sn-watcher
         ├─928 /usr/lib/geoclue-2.0/demos/agent
         ├─931 /usr/bin/nemo-desktop
         ├─932 /usr/bin/vmtoolsd -n vmusr --blockFd 3
         ├─935 pamac-tray
         ├─939 /usr/bin/nm-applet
         ├─943 cinnamon-killer-daemon
         └─945 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

8月 31 10:02:52 archcinnamon systemd[1]: Started Session 2 of User lasombra.
8月 31 10:02:53 archcinnamon gnome-keyring-daemon[680]: discover_other_daemon: 1
8月 31 10:02:53 archcinnamon gnome-keyring-daemon[682]: discover_other_daemon: 1
8月 31 10:02:53 archcinnamon gnome-keyring-daemon[683]: discover_other_daemon: 1
8月 31 10:03:06 archcinnamon cinnamon-killer-daemon[943]: Bound Cinnamon restar>
[lasombra@archcinnamon ~]$ cat ~/.xinitrc
cat: /home/lasombra/.xinitrc: 没有那个文件或目录
[lasombra@archcinnamon ~]$ echo $DBUS_SESSION_BUS_ADDRESS
unix:path=/run/user/1000/bus
[lasombra@archcinnamon ~]$ ps aux | grep dbus
dbus         481  0.0  0.1   7264  3812 ?        Ss   10:02   0:00 /usr/bin/dbus-broker-launch --scope system --audit
dbus         482  0.0  0.1   5416  3744 ?        S    10:02   0:00 dbus-broker --log 4 --controller 9 --machine-id 4e033ce8095f48faae4e8028714e0323 --max-bytes 536870912 --max-fds 4096 --max-matches 131072 --audit
lasombra     657  0.0  0.1   6808  3328 ?        Ss   10:02   0:00 /usr/bin/dbus-broker-launch --scope user
lasombra     658  0.0  0.1   5348  3584 ?        S    10:02   0:00 dbus-broker --log 4 --controller 10 --machine-id 4e033ce8095f48faae4e8028714e0323 --max-bytes 100000000000000 --max-fds 25000000000000 --max-matches 5000000000
lasombra     768  0.0  0.1   6808  3200 ?        S    10:02   0:00 /usr/bin/dbus-broker-launch --config-file=/usr/share/defaults/at-spi2/accessibility.conf --scope user
lasombra     772  0.0  0.1   4216  2560 ?        S    10:02   0:00 dbus-broker --log 4 --controller 9 --machine-id 4e033ce8095f48faae4e8028714e0323 --max-bytes 100000000000000 --max-fds 6400000 --max-matches 5000000000
lasombra    1235 33.3  0.1   9752  2432 pts/0    S+   10:09   0:00 grep --color=auto dbus

2. Yes because I need to go to /etc/polkit-1/rules.d to disable the rule I set in #5. I only ran Nemo as root for this and didn't do any other things.

Last edited by silver-lasombra (2024-08-31 02:40:55)

Offline

#10 2024-08-31 07:27:47

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: [SOLVED]How to mount disks in Nemo without entering password?

I'd not expect any output to change here (that looks actually as expected and fine) but the question is whether w/o the autostart, nemo/udisks2 is now treated for an active session (ie. whether you can mount external drives/partitions w/o being asked for authentication)

Also, to get nemo out of the equation here, can you

udisksctl mount -b /dev/sdb1

(provided you've eg. plugged a usb key and there and it actually is sdb1)

Offline

#11 2024-08-31 14:32:27

silver-lasombra
Member
Registered: 2024-08-14
Posts: 14

Re: [SOLVED]How to mount disks in Nemo without entering password?

It ask me for password:
ask for password

After entering password it mounts as usual:

$ udisksctl mount -b /dev/sdb2
Mounted /dev/sdb2 at /run/media/lasombra/f4c5b056-fcd1-4966-b07c-d8302851a54d

Offline

#12 2024-08-31 14:34:30

silver-lasombra
Member
Registered: 2024-08-14
Posts: 14

Re: [SOLVED]How to mount disks in Nemo without entering password?

It ask me for password:
ask for password

After entering password it mounts as usual:

$ udisksctl mount -b /dev/sdb2
Mounted /dev/sdb2 at /run/media/lasombra/f4c5b056-fcd1-4966-b07c-d8302851a54d

Offline

#13 2024-08-31 17:41:40

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: [SOLVED]How to mount disks in Nemo without entering password?

It ask me for password:

That's not expected, so it's not a nemo-specific problem.

=> Udisks2, lightdm or cinnamon's fault.

Boot the multi-user.target (2nd link below), log into a tty and try "udisksctl mount -b /dev/sdb2" from there.
If that works, install xorg-xinit, cp /etc/X11/xinit/xinitrc ~/.xinitrc, edit ~/.xinitrc and insert "exec cinnamon-session" before the "twm &" line (the script will end with that call, you can ignore the tail)
The run startx, should start cinnamon - try to mount the drive there.
If that works, post you lightdm config…

Offline

#14 2024-09-01 01:01:21

silver-lasombra
Member
Registered: 2024-08-14
Posts: 14

Re: [SOLVED]How to mount disks in Nemo without entering password?

Still need password...
tty need password

Offline

#15 2024-09-01 08:13:53

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: [SOLVED]How to mount disks in Nemo without entering password?

Can you "systemctl reboot" w/o being asked for your password (careful, obviously this will reboot the system and you migth not have to issue credentials)?
Otherwise please post your shellrc (~/.bash*, I guess)

Offline

#16 2024-09-02 00:04:20

silver-lasombra
Member
Registered: 2024-08-14
Posts: 14

Re: [SOLVED]How to mount disks in Nemo without entering password?

seth wrote:

Can you "systemctl reboot" w/o being asked for your password.

Yes, it reboot immediately without password needed.

Offline

#17 2024-09-02 06:56:24

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: [SOLVED]How to mount disks in Nemo without entering password?

pacman -Qikk udisks2

To be clear: what you're trying to mount is some external media?
Because

  <!-- mount a device considered a "system device" -->
  <action id="org.freedesktop.udisks2.filesystem-mount-system">
    <description>Mount a filesystem on a system device</description>
    <message>Authentication is required to mount the filesystem</message>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
  </action>

is normal (the polkit override you picked up from EOS steamrolls over both) and the correct-ish to manage internal/system partitions is via fstab.

udisks might have a different perception of the nature of the drive…

LC_ALL=C udisksctl info -b /dev/sdb1 # |grep HintSystem, but the rest might reveal why there'd be disagreement

There was https://bbs.archlinux.org/viewtopic.php … 6#p2172566 - but actually the other way round (internal drives detected as removeable because of hotplugging support)

Edit: in better news, your session is fine - sorry for chasing you down that road but it's the common breakage

Last edited by seth (2024-09-02 06:57:15)

Offline

#18 2024-09-02 08:10:47

silver-lasombra
Member
Registered: 2024-08-14
Posts: 14

Re: [SOLVED]How to mount disks in Nemo without entering password?

seth wrote:

To be clear: what you're trying to mount is some external media?

No, it's internal partitions. Now it's a virtual disk in a virtual machine, and it will be a partition of an internal SATA SSD as mentioned below. Maybe there will also be an HDD.

seth wrote:

the correct-ish to manage internal/system partitions is via fstab.

udisks might have a different perception of the nature of the drive…

Because I plan to install Windows and Arch dual boot, and since this is the first time I use Arch, I decide to try in VMware first.
The disk will be 3 partitions, one is Win, one is Arch and one is public data for them.
I don't want to mount the public data partition via fstab, because if I do something stupid like 'sudo rm -rf /*' by accident, the automatically mounted data partition will lost. I just want to mount it only when needed.

I checked out Archwiki again. The rules mentioned in Udisks wiki page meets my need best (similar to rules mentioned in #5 and I shall choose the one mentioned in archwiki).

Thank you for spending so much time.

Offline

#19 2024-09-02 12:04:03

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: [SOLVED]How to mount disks in Nemo without entering password?

I don't want to mount the public data partition via fstab, because if I do something stupid like 'sudo rm -rf /*' by accident, the automatically mounted data partition will lost. I just want to mount it only when needed.

https://man.archlinux.org/man/core/util … fstab.5.en - that's what the noauto entry is for. It allows you to mount the partition at will.
You can also use systemd features to implicitly mount it when the path gets accessed (though idk what's gonna happen for your disaster-command) and automatically unmount it after some time.

Offline

Board footer

Powered by FluxBB