Bug 397271 - Unattended access settings lost on reboot
Summary: Unattended access settings lost on reboot
Status: RESOLVED FIXED
Alias: None
Product: krfb
Classification: Applications
Component: general (show other bugs)
Version: 18.04.1
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Alexey Min
URL:
Keywords:
: 401994 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-08-08 13:09 UTC by Mina
Modified: 2019-01-15 21:15 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.04.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mina 2018-08-08 13:09:54 UTC
version 18.04.3

If I setup an unattended access password, then I reboot the machine it's gone.

Using KDE neon, up to date.
Comment 1 blackfireburn 2018-12-17 19:08:48 UTC
just tested on kde neon
kfrb 
Version 18.12.0
KDE Frameworks 5.53.0
Qt 5.11.2 (built against 5.11.2)

set a password 
restarted and checked on login. the unattended option is still ticked. 
do you mean that the password does not work after reboot?
Comment 2 jlb 2019-01-01 17:30:37 UTC
Same on KUbuntu, 18.10, unattended password is lost on reboot.
After reboot, impossible to get the krfb interface.
I need to uninstall krfb, reboot, reinstall krfb, then setup the unattended password.
After restart, unattended password is lost and I cannot get the krfb interface.
Where is the password saved?
krfb v 18.4.3
KDE Framework 5.50.0
Qt 5.11.1 (built against 5.11.1)
The xcv windowing system
KDE Plasma 5.13.5
Kernel 4.18.0-13-generic
64-bit
Comment 3 Alexey Min 2019-01-01 21:22:54 UTC
*** Bug 401994 has been marked as a duplicate of this bug. ***
Comment 4 Alexey Min 2019-01-01 21:59:08 UTC
> Where is the password saved?

All general settings are stored in ~/.config/krfbrc, but passwords are stored inside KWallet. Launch kwalletmanager (in kubuntu/neon package should be called kwalletmanager) and see - https://i.imgur.com/t7CFnQl.png

The problem is probably with this: after reboot you need to enter kwallet password to unlock your wallet (you should see this window - https://i.imgur.com/MF714Vp.png ), if you cancel that window without entering that password kwallet cannot not be opened and unattended password is generated randomly at krfb startup (and not saved anywhere). You should see "Could not open KWallet, Falling back to config file" in krfb output if started from console.

You can either configure kwallet auto-unlock on user login.

Or there is a workaround to not use KWallet for storing passwords. There is a hidden (from UI) option, called "noWallet". You can manually edit ~/.config/krfbrc (when krfb program is shut down of course) and add a line in section [Security]: noWallet=true like that:

[Security]
allowUnattendedAccess=true
noWallet=true

After that you start krfb, configure unattended password once using GUI, and then it will be stored into this config file forever. It should persist on reboots.

We could add an option in krfb, in security settings, a checkbox "Store passwords in KWallet" to make this option visible in UI...
Comment 5 jlb 2019-01-02 11:46:29 UTC
Thanks Alexey, krfb works as expected when adding the following to ~/.config/krfbrc

[Security]
allowUnattendedAccess=true
noWallet=true

So the problem was KWallet.  Strangely when I started krfb from the Konsole, I did not see the message : "Could not open KWallet, Falling back to config file" which would have been a good indication of the problem!  Neither was I asked for a password from KWallet after reboot...

Since this machine is to be used headless as a server, entering the KWallet after reboot on the local machine is not possible.  Simply disabling the KWallet worked.  Maybe an option to not use KWallet on the UI and a sturdier report of the problem using the console would help.

Thanks again.
Comment 6 Alexey Min 2019-01-15 21:15:46 UTC
Git commit 313b4bbc6710c9c68123cdd3576b18f0e8659e5d by Alexey Min.
Committed on 15/01/2019 at 21:15.
Pushed by alexeymin into branch 'master'.

Expose option to disable KWallet passwords storage

Summary:
Option "noWallet" was already supported in the code,
but was not visible in the configuration UI. This
option is useful on headless servers where you don't
really have a way to enter password to unlock the wallet.

CHANGELOG: Add an option to store passwords without using KDE Wallet
FIXED-IN: 19.04.0

Test Plan: Enable option, restart krfb, ensure that passwords are now in ~/.config/krfbrc. Disable option, restart krfb, see that passwords are no longer in krfbrc.

Reviewers: #kde_applications, aacid

Differential Revision: https://phabricator.kde.org/D18075

M  +32   -21   krfb/invitationsrfbserver.cpp
M  +2    -0    krfb/invitationsrfbserver.h
M  +29   -0    krfb/mainwindow.cpp
M  +7    -0    krfb/ui/configsecurity.ui

https://commits.kde.org/krfb/313b4bbc6710c9c68123cdd3576b18f0e8659e5d