You are not logged in.

#1 2023-09-05 01:27:28

samdunn
Member
Registered: 2023-09-05
Posts: 1

Authorization required, but no authorization protocol specified

Hello, I am getting an error called "Authorization required, but no authorization protocol specified". I have installed Hyprland. I also installed xorg.
When I try to use sudo to open nemo for root access, I get this error. I have also got this error when I tried to use gparted with sudo.
Here is my hyprland.conf file:
########################################################################################
AUTOGENERATED HYPR CONFIG.
PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT,
OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
########################################################################################

#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#

#autogenerated = 1 # remove this line to remove the warning

# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,1920x1080,auto,1


# See https://wiki.hyprland.org/Configuring/Keywords/ for more

# Execute your favorite apps at launch
exec-once=/usr/lib/polkit-kde-authentication-agent-1
exec-once = dunst
exec-once = gBar bar 0
exec-once = hyprpaper

# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf

# Some default env vars.
env = XCURSOR_SIZE,24

# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
    kb_layout = us
    kb_variant =
    kb_model =
    kb_options =
    kb_rules =

    follow_mouse = 1

    touchpad {
        natural_scroll = no
    }

    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}

general {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    gaps_in = 5
    gaps_out = 20
    border_size = 2
    col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.inactive_border = rgba(595959aa)

    layout = dwindle
}

decoration {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    rounding = 10
   
    blur {
        enabled = true
        size = 3
        passes = 1
    }

    drop_shadow = yes
    shadow_range = 4
    shadow_render_power = 3
    col.shadow = rgba(1a1a1aee)
}

animations {
    enabled = yes

    # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more

    bezier = myBezier, 0.05, 0.9, 0.1, 1.05

    animation = windows, 1, 7, myBezier
    animation = windowsOut, 1, 7, default, popin 80%
    animation = border, 1, 10, default
    animation = borderangle, 1, 8, default
    animation = fade, 1, 7, default
    animation = workspaces, 1, 6, default
}

dwindle {
    # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
    pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    preserve_split = yes # you probably want this
}

master {
    # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
    new_is_master = true
}

gestures {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more
    workspace_swipe = off
}

# Example per-device config
# See https://wiki.hyprland.org/Configuring/K … #executing for more
device:epic-mouse-v1 {
    sensitivity = -0.5
}

# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more


# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER

# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, A, exec, nwg-drawer
bind = $mainMod, RETURN, exec, alacritty
bind = $mainMod, C, killactive,
bind = $mainMod, X, exit,
bind = $mainMod, E, exec, nemo
bind = $mainMod, B, exec, firefox
bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, wofi --show drun
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod CTRL, 9, exec, brightnessctl set 0%
bind = $mainMod CTRL, 8, exec, brightnessctl set 100%
bind = $mainMod, L, exec, libreoffice
bind = $mainMod, M, exec, mousepad

# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d

# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10

# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10

# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1

# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
I know that on line 21 of the hyprland.conf file, I have the authentication agent run once. I don't know what else I need to have running or do I need a something set for me to be able to use sudo correctly. I would very much appreciate any info that anyone could help me. I also want to let you know I do have a static hostname set to archlinux. I don't use any other tty. I login to hyprland with sddm and then open a terminal. Thank you.

Offline

#2 2023-09-05 06:29:44

seth
Member
Registered: 2012-09-03
Posts: 53,224

Re: Authorization required, but no authorization protocol specified

Please use [code][/code] tags. Edit your post in this regard.

When I try to use sudo to open nemo for root access …  have also got this error when I tried to use gparted with sudo.

Don't do that to begin with.
The error is expectable and instead of trying to set up the system to run GUI clients as root you want to fix the underlying cause, ie. why you're trying to do this.

gparted apparently requires xorg-xhost on wayland (what makes it sound as if it completely leverages itself), https://wiki.archlinux.org/title/Parted#Installation and nemo will hopefully use polkit to leverage isolated file operations? If not, use a different file manager, running fat GUI clients as root is a stupid idea and several GUI clients these days will flat-out reject to run as UID0 to prevent such approaches (idk whether nemo will fall into that category, the present error is because sudo drops the environment)

Offline

#3 2023-09-05 07:42:40

progandy
Member
Registered: 2012-05-17
Posts: 5,212

Re: Authorization required, but no authorization protocol specified

gparted should probably work without xorg-xhost, but if you run it with sudo I guess it can't find a wayland socket. The xorg (xwayland) socket is in the environment, so it tries that and fails as well.
For wayland you'll need a polkit agent to run it as far as I know. https://wiki.archlinux.org/title/Polkit … ion_agents

For nemo you should be able to manually use the gvfs admin:// protocol https://github.com/linuxmint/nemo/issues/3259
https://wiki.archlinux.org/title/Runnin … ns_as_root

Last edited by progandy (2023-09-05 07:48:36)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2023-09-05 07:49:36

seth
Member
Registered: 2012-09-03
Posts: 53,224

Re: Authorization required, but no authorization protocol specified

'key, the wiki actually cites a workaround from 2017, http://gparted-forum.surf4.info/viewtopic.php?id=17682
lol
But the config switch is still there, https://gitlab.archlinux.org/archlinux/ … =heads#L41

Offline

#5 2023-09-05 08:02:47

progandy
Member
Registered: 2012-05-17
Posts: 5,212

Re: Authorization required, but no authorization protocol specified

seth wrote:

'key, the wiki actually cites a workaround from 2017, http://gparted-forum.surf4.info/viewtopic.php?id=17682
lol
But the config switch is still there, https://gitlab.archlinux.org/archlinux/ … =heads#L41

I have taken to searching the sway issue tracker for problems with wayland compatibility, but maybe I missed some nuances for gparted. Maybe it just starts itself using pkexec and simply hides the xhost stuff from the user. hmm https://github.com/swaywm/sway/issues/4492

Edit: Ouch. 4 years and they haven't started to separate it into a polkit-enabled daemon and an unprivileged UI... So you need polkit-agent and xorg-xhost or run xhost manually.
https://github.com/GNOME/gparted/blob/1 … ted.in#L59
https://gitlab.gnome.org/GNOME/gparted/-/issues/26

Gnome Disks (gnome-disk-utility) is an alterantive that may be sufficient for your use case that builds on top of the udisks2 API and works without running the UI as root.

Last edited by progandy (2023-09-05 08:22:24)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB