You are not logged in.

#1 2013-09-16 14:30:17

aldoiljazi
Member
From: milky way galaxy
Registered: 2013-09-16
Posts: 20

[SOLVED] Poweroff and Reboot without Sudo

How can I Poweroff and Reboot my system without using sudo?

Last edited by aldoiljazi (2013-09-18 06:52:28)

Offline

#2 2013-09-16 14:39:30

ploub
Member
Registered: 2007-05-16
Posts: 136

Re: [SOLVED] Poweroff and Reboot without Sudo

Also in the wiki wink

Offline

#3 2013-09-16 14:39:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Poweroff and Reboot without Sudo

Outdated, but maybe still helpful: https://wiki.archlinux.org/index.php/Al … o_Shutdown

Edit: Why do you want to reboot w/o sudo anyway?

Last edited by karol (2013-09-16 14:42:27)

Offline

#4 2013-09-16 14:47:13

aldoiljazi
Member
From: milky way galaxy
Registered: 2013-09-16
Posts: 20

Re: [SOLVED] Poweroff and Reboot without Sudo

I saw those, and they are outdated. Well I don't want to type my password each time I reboot.

Offline

#5 2013-09-16 15:00:18

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [SOLVED] Poweroff and Reboot without Sudo

Did you try any of the solutions recommended by the wiki topic? "systemctl poweroff" should work.

Last edited by 2ManyDogs (2013-09-16 15:03:23)

Offline

#6 2013-09-16 15:09:18

aldoiljazi
Member
From: milky way galaxy
Registered: 2013-09-16
Posts: 20

Re: [SOLVED] Poweroff and Reboot without Sudo

I get

$ systemctl poweroff
Failed to issue method call: Access denied
Failed to issue method call: Access denied

Offline

#7 2013-09-16 15:09:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Poweroff and Reboot without Sudo

Users shouldn't be allowed to do things like installing / updating packages, rebooting or powering off the computer etc. You need to use sudo because of security.
If you don't want to type your password in when using sudo, follow the wiki.

Offline

#8 2013-09-16 15:10:10

aldoiljazi
Member
From: milky way galaxy
Registered: 2013-09-16
Posts: 20

Re: [SOLVED] Poweroff and Reboot without Sudo

Okay thanks.

Offline

#9 2013-09-16 15:27:12

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: [SOLVED] Poweroff and Reboot without Sudo

@karol: systemd assumes that anyone with console access can shutdown/reboot the computer anyway (as they are sitting at the computer). Therefore, he should be able to issue `systemctl poweroff` etc. iff his session is setup correctly.

What is the output of `loginctl show-session $XDG_SESSION_ID`?


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#10 2013-09-16 15:36:44

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Poweroff and Reboot without Sudo

@Stebalien
The wiki has

# systemctl poweroff

so I guess it's a typo, right?

I can't check if 'systemctl poweroff' works for me atm, but

$ loginctl show-session $XDG_SESSION_ID
Id=1
Timestamp=Mon 2013-09-16 16:22:30 CEST
TimestampMonotonic=18752776
VTNr=1
TTY=tty1
Remote=no
Service=login
Scope=session-1.scope
Leader=171
Audit=1
Type=tty
Class=user
Active=yes
State=active
IdleHint=yes
IdleSinceHint=1379341352989405
IdleSinceHintMonotonic=21376821
Name=karol

Offline

#11 2013-09-16 15:39:03

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: [SOLVED] Poweroff and Reboot without Sudo

"poweroff" and "systemctl poweroff" are equivalent, "poweroff" is symlinked to systemctl. As mentioned, these should work just fine without password if you are in an active session (@Karol, your session seems to be fine).

Offline

#12 2013-09-16 15:42:31

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: [SOLVED] Poweroff and Reboot without Sudo

karol wrote:

@Stebalien
The wiki has

# systemctl poweroff

so I guess it's a typo, right?

Yes. Fixed.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#13 2013-09-16 15:55:05

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] Poweroff and Reboot without Sudo

@aldoiljazi - You might want to check that you have polkit installed.

Offline

#14 2013-09-16 16:27:48

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Poweroff and Reboot without Sudo

I was using old aliases for reboot / poweroff, but you're right, 'poweroff' and 'reboot' work w/o sudo.

Please check if my edits make sense https://wiki.archlinux.org/index.php?ti … did=275784
If I have more questions, I will open a new thread not to derail this one.

Offline

#15 2013-09-16 18:22:51

ploub
Member
Registered: 2007-05-16
Posts: 136

Re: [SOLVED] Poweroff and Reboot without Sudo

@karol: man poweroff (which references halt & reboot as well) says

NOTES
       These are legacy commands available for compatibility only.

so maybe

systemctl poweroff

is more appropriate

Offline

#16 2013-09-16 18:50:29

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Poweroff and Reboot without Sudo

You're right. Fixed.

Offline

#17 2013-09-16 19:45:49

aldoiljazi
Member
From: milky way galaxy
Registered: 2013-09-16
Posts: 20

Re: [SOLVED] Poweroff and Reboot without Sudo

Stebalien wrote:

@karol: systemd assumes that anyone with console access can shutdown/reboot the computer anyway (as they are sitting at the computer). Therefore, he should be able to issue `systemctl poweroff` etc. iff his session is setup correctly.

What is the output of `loginctl show-session $XDG_SESSION_ID`?

$ loginctl show-session $XDG_SESSION_ID
Id=1
Timestamp=Mon 2013-09-16 21:11:47 EEST
TimestampMonotonic=13019390
DefaultControlGroup=systemd:/user/1000.user/1.session
VTNr=1
TTY=tty1
Remote=no
Service=login
Leader=130
Audit=1
Type=tty
Class=user
Active=yes
State=active
KillProcesses=no
IdleHint=yes
IdleSinceHint=1379355104466900
IdleSinceHintMonotonic=10330073
Name=aldo

mine.

Last edited by aldoiljazi (2013-09-16 19:47:04)

Offline

#18 2013-09-16 19:56:31

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Poweroff and Reboot without Sudo

@aldoiljazi
Does

systemctl poweroff

work for you w/o sudo?

Offline

#19 2013-09-17 01:09:07

aldoiljazi
Member
From: milky way galaxy
Registered: 2013-09-16
Posts: 20

Re: [SOLVED] Poweroff and Reboot without Sudo

karol wrote:

@aldoiljazi
Does

systemctl poweroff

work for you w/o sudo?

No, I get:

Failed to issue method call: Access denied
Failed to issue method call: Access denied

hmm

Offline

#20 2013-09-17 01:12:08

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Poweroff and Reboot without Sudo

Are you sure you have polkit installed?
If so, reboot and try again.

Offline

#21 2013-09-17 01:29:16

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,168

Re: [SOLVED] Poweroff and Reboot without Sudo

Why does karol's have Scope and aldoiljazi's has DefaultControlGroup but not vice versa?

Note: I'm just curious - I'm not claiming this explains anything.

EDIT: I'm guessing karol is using testing and aldoiljazi is not (http://upstream-tracker.org/changelogs/ … gelog.html).

Last edited by cfr (2013-09-17 01:36:14)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#22 2013-09-17 02:39:05

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Poweroff and Reboot without Sudo

@cfr, karol runs [testing].  There have been some changes to systemd between what is in [core] (v204) and [testing] (v207).

Offline

#23 2013-09-17 02:52:37

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Poweroff and Reboot without Sudo

Yup, I'm using [testing]. Sorry for forgetting about it.

Offline

#24 2013-09-17 22:10:40

aldoiljazi
Member
From: milky way galaxy
Registered: 2013-09-16
Posts: 20

Re: [SOLVED] Poweroff and Reboot without Sudo

Yes I am not using [testing].

PS: Should I install polkit?

Offline

#25 2013-09-17 22:14:00

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] Poweroff and Reboot without Sudo

Yes you should.

Offline

Board footer

Powered by FluxBB