Page 1 of 1

network share credentails lost at reboot

Posted: Fri Mar 29, 2019 6:57 pm
by mtmcdonough
Hi. We have five raspberry pi devices set up identically by a former support tech. They all had access to a network drive on a QNAP NAS. The access requires a login with username and password. The tech guy put an icon on the desktop that started the file manger and viola: we could access the folders and files on the QNAP (read only).

The tech guy has since gone away. Further, the username and password to access the QNAP NAS has been changed. So the desktop icon just fails to do anything at this point.

I tried to fix things by making a new desktop icon:

[Desktop Entry]
Name[en_US]=Digital Files
Comment=Connect to the QNAP
Icon=/usr/share/pixmaps/openbox.png
Exec=pcmanfm smb://storgage1.local/public/
Encoding=UTF-8
Terminal=False
Categories=None;

It worked! The first time I ran it, it asked for the new username and password. I entered the new credentials and clicked on "Remember forever". However, the credentials are not saved and we have to re-enter the username and password after every reboot. So, how can I really save the credentials. Are they stored in a file I can edit? Or are they parameters I can pass to the pcmanfm application in the Exec line? Any help would be greatly appreciated. Thanks!

Re: network share credentails lost at reboot

Posted: Fri Mar 29, 2019 8:19 pm
by Andyroo
I do not think you can actually add a user or password here as the command line help (man) does not show any option :cry:

You could try
Exec=pcmanfm smb://username@storgage1.local/public/
That should then prompt for a password again and maybe save it.

It’s possible the security is handled in a Linux version of the Mac Keychain program but I’ve no desktop Pi that I can try here at the mo.

Re: network share credentails lost at reboot

Posted: Fri Mar 29, 2019 8:39 pm
by mtmcdonough
Thank you! I'll try that on Monday morning. Hope it does the trick!
mark

Re: network share credentails lost at reboot

Posted: Fri Mar 29, 2019 10:58 pm
by LTolledo
mtmcdonough wrote:
Fri Mar 29, 2019 6:57 pm
......clicked on "Remember forever". However, the credentials are not saved ...
My take on this... pcmanfm suffers from computer version of "dementia"... and there is no fix (that I know) exist.

Re: network share credentails lost at reboot

Posted: Sat Mar 30, 2019 12:54 am
by mtmcdonough
Thanks for your reply. I am guessing that our tech support guy set up a file with a mount command that executes during booting and connects to our network share on the QNAP NAS using the old username and password. It fails because the username and password are no longer valid. If I could find the mount command, maybe I could edit the username and password fields and we would be back to normal.

Does that make sense? Do you know where I might find the mount command or how I can check that a mount command is bring issued during the boot process?

I am very, very new to the raspberry pi but am excited to try and resolve this problem. Thanks, again, for all those who help.

Re: network share credentails lost at reboot

Posted: Sat Mar 30, 2019 1:34 am
by Andyroo
First place to look would be fstab - warning if you edit this getting contents of this file wrong can stop your system booting!

Code: Select all

cat /etc/fstab 
This is a basic config where nothing other than the standard system partitions are mounted:
proc /proc proc defaults 0 0
PARTUUID=10c922f3-01 /boot vfat defaults 0 2
PARTUUID=10c922f3-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that

Re: network share credentails lost at reboot

Posted: Sat Mar 30, 2019 3:57 pm
by mtmcdonough
Thank you for the continuing advice. I can only work on the Raspberry devices on weekdays, so Monday morning is my next opportunity to look at fstab. I'll be very careful.

Can I ask: Is it true that there must be a mount command executed to access a network storage device? If that is true, it must happen during booting of the pi, correct? Maybe the mount is in rc.local or done through systemd. I'll have to check.

Re: network share credentails lost at reboot

Posted: Sat Mar 30, 2019 4:03 pm
by Andyroo
Using mount is the only way I have been able to access shares (but I'm not a Linux expert by any stretch) but I know there is an 'auto mount' via the browser and the SAMBA client can do bits...

You can mount at boot or later - most automated mounts are executed at boot though.

It is worth checking rc.local and systemd - too many places to do things now :lol:

Re: network share credentails lost at reboot

Posted: Mon Apr 01, 2019 5:35 pm
by mtmcdonough
Thanks for all your help! I really mean it.
I was able to solve my problem.

In a terminal window, I entered sudo nano /etc/fstab and found the mount command for our QNAP NAS. The mount included: credentials=/.smbcredentials.

I used nano ~/.smbcredentials and found the old, out-of-date username and password in that file. I changed those fields to the new username and password, re-wrote the file and it worked!

We are back to normal. Thanks, again.

Re: network share credentails lost at reboot

Posted: Thu Nov 14, 2019 9:10 pm
by alainib
hello
i get the same error since few days

can you please post the content of /etc/fstab and .smbcredentials please ?
thanks