[SOLVED] Flash Drive asking wrong user for password

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
JerryF
Level 16
Level 16
Posts: 6572
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Flash Drive asking wrong user for password

Post by JerryF »

...needed to do some research and testing.

Your flash drive is mounting as /mnt/...
Flash drives should be mounted as /media/...

Can you post the result of the following command:

Code: Select all

cat /etc/fstab
Last edited by JerryF on Thu Dec 06, 2018 6:52 pm, edited 1 time in total.
User avatar
CaptainKirksChair
Level 4
Level 4
Posts: 456
Joined: Sat Feb 18, 2017 9:29 pm

Re: Flash Drive asking wrong user for password

Post by CaptainKirksChair »

"Authentication is required to unmount SanDisk Corporation Flash Drive..."
There is a small partition on the flash drive that holds files and programs from SanDisk. It's not needed. Most of it is encryption software provided by SanDisk to keep your files safe while in Windows. There is an installable utility. I believe it tries to autorun.

The recommended procedure is to put the flash drive into a Windows computer, copy the files to a hard drive folder, then use Gparted in Mint to remove all partitions and then make just one partition. Format it as FAT32 using the USB Stick Formatter utility in Mint. Then put it back in the Windows computer and copy the files back to it.

This should solve the problem.
otlichnik73
Level 3
Level 3
Posts: 128
Joined: Tue Mar 20, 2018 6:20 pm

Re: Flash Drive asking wrong user for password

Post by otlichnik73 »

JerryF wrote: Thu Dec 06, 2018 12:23 pm ...needed to do some research and testing.

Your flash drive is mounting as /mnt/...
Flash drives should be mount as /media/...

Can you post the result of the following command:

Code: Select all

cat /etc/fstab
Yes, I see... I actually made it mount in /mnt (and I changed permissions for /mnt for all users to access). should I change it to media/? Would that make a difference?

as requested:

Code: Select all

bekor@Lab1 ~ $ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=e79d0f2e-7072-4c9b-a494-442e043fc305 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=D537-60E9  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda3 during installation
UUID=7b0aa389-5929-4e21-80ff-cc5b4c366222 none            swap    sw              0       0
/dev/disk/by-id/usb-ZOOM_H1_SD_R_W_0123456789ABCDE-0:0-part1 /home/derushah/usb-ZOOM_H1_SD_R_W_0123456789ABCDE-0:0-part1 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
/dev/disk/by-id/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0-part1 /mnt/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-id/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0 /mnt/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
Last edited by otlichnik73 on Thu Dec 06, 2018 6:52 pm, edited 1 time in total.
First Port of Call for Windows Refugees: https://switchtolinuxdesktop.wordpress.com/
User avatar
JerryF
Level 16
Level 16
Posts: 6572
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Flash Drive asking wrong user for password

Post by JerryF »

I thought so.

Delete the last two lines in the fstab file. You'll need to be root to do so. Then reboot.

Flash drives shouldn't have entries in fstab to be mounted.
Last edited by JerryF on Thu Dec 06, 2018 6:57 pm, edited 4 times in total.
otlichnik73
Level 3
Level 3
Posts: 128
Joined: Tue Mar 20, 2018 6:20 pm

Re: Flash Drive asking wrong user for password

Post by otlichnik73 »

just edited last one
First Port of Call for Windows Refugees: https://switchtolinuxdesktop.wordpress.com/
User avatar
JerryF
Level 16
Level 16
Posts: 6572
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Flash Drive asking wrong user for password

Post by JerryF »

otlichnik73 wrote: Thu Dec 06, 2018 6:52 pm just edited last one
What does that mean? You only deleted the last line?
otlichnik73
Level 3
Level 3
Posts: 128
Joined: Tue Mar 20, 2018 6:20 pm

Re: Flash Drive asking wrong user for password

Post by otlichnik73 »

sorry, I mean after I saw your request I added the command output you requested to my last post
First Port of Call for Windows Refugees: https://switchtolinuxdesktop.wordpress.com/
otlichnik73
Level 3
Level 3
Posts: 128
Joined: Tue Mar 20, 2018 6:20 pm

Re: Flash Drive asking wrong user for password

Post by otlichnik73 »

i will try this and let you know later cheers!
First Port of Call for Windows Refugees: https://switchtolinuxdesktop.wordpress.com/
User avatar
JerryF
Level 16
Level 16
Posts: 6572
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Flash Drive asking wrong user for password

Post by JerryF »

otlichnik73 wrote: Thu Dec 06, 2018 7:08 pm sorry, I mean after I saw your request I added the command output you requested to my last post
Ah! :wink:
User avatar
ricardogroetaers
Level 6
Level 6
Posts: 1374
Joined: Sat Oct 27, 2018 3:06 am
Location: Rio de Janeiro, Brasil

Re: Flash Drive asking wrong user for password

Post by ricardogroetaers »

otlichnik73 wrote: Wed Dec 05, 2018 10:54 pm Thanks! Here are the settings for removable media. All other tabs have nothing checked.
Are these settings okremov media.png
On the storage tab is everything o.k.
This way when removable media is inserted, it will be automatically mounted to "/media/your_user_name/volume_UUID".
The "Volume_UUID" folder will be created automatically and will disappear automatically after the media is removed.

Important:
To prevent loss of data on removable media, use the following procedure through File Manager:
1st unmounting
2nd eject
3rd remove physically

The multimedia guide is only for choosing the default program for each case. It's up to you.
https://i.imgur.com/qimPGhP.png
Last edited by ricardogroetaers on Sat Dec 08, 2018 12:23 pm, edited 1 time in total.
User avatar
JerryF
Level 16
Level 16
Posts: 6572
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Flash Drive asking wrong user for password

Post by JerryF »

ricardogroetaers wrote: Sat Dec 08, 2018 11:42 am ...
Important:
To prevent loss of data on removable media, use the following procedure through File Manager:
1st dismantling
2nd eject
3rd remove physically

The multimedia guide is only for choosing the default program for each case. It's up to you.
https://i.imgur.com/qimPGhP.png
I think ricardo means 1st unmounting, not dismantling.
User avatar
ricardogroetaers
Level 6
Level 6
Posts: 1374
Joined: Sat Oct 27, 2018 3:06 am
Location: Rio de Janeiro, Brasil

Re: Flash Drive asking wrong user for password

Post by ricardogroetaers »

Thank you for the warning. It was a problem caused by the translation software. I edited the post.
Please let me know if there is any other inconsistency.
otlichnik73
Level 3
Level 3
Posts: 128
Joined: Tue Mar 20, 2018 6:20 pm

Re: Flash Drive asking wrong user for password

Post by otlichnik73 »

JerryF wrote: Tue Dec 04, 2018 11:12 pm Yes. Any flash drive that's inserted that has regular files on it shouldn't be asking for a password.
Hi there again Jerry! I 've been kind of busy and I forgot where we were up to with that issue. But anyway, I still wanted to get a clearer understanding on multi-user scenario when mounting media. In your reply above, you mentioned that no external media should be asking for a password.
But what if (and I think this is what happens here):
userA logs in and inserts drive; it is mounted in userA/media/; when finished, he does not unmount; just removes media
userB logs in later and inserts the same drive, it mounts to userA/media/
userB has no permissions to access userA/media/; so in his file manager, even though he can see the drive, he can't access it

Is that how it works? Will that create an issue?
I am dealing with multiple users who are not IT-kind-of-people; I don't think they understand about unmounting and stuff; I think they just pop their flash drives in and out as they please...
(side question - so no flash drive should have an entry in /etc/fstab? why does this one does? is that because I changed mounting point to /mnt/ from user1/media/? was that a good idea?)
Thanks for the education!
First Port of Call for Windows Refugees: https://switchtolinuxdesktop.wordpress.com/
User avatar
JerryF
Level 16
Level 16
Posts: 6572
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Flash Drive asking wrong user for password

Post by JerryF »

otlichnik73 wrote: Sat Dec 08, 2018 3:53 pm
JerryF wrote: Tue Dec 04, 2018 11:12 pm Yes. Any flash drive that's inserted that has regular files on it shouldn't be asking for a password.
Hi there again Jerry! I 've been kind of busy and I forgot where we were up to with that issue. But anyway, I still wanted to get a clearer understanding on multi-user scenario when mounting media. In your reply above, you mentioned that no external media should be asking for a password.
But what if (and I think this is what happens here):
userA logs in and inserts drive; it is mounted in userA/media/; when finished, he does not unmount; just removes media
userB logs in later and inserts the same drive, it mounts to userA/media/
userB has no permissions to access userA/media/; so in his file manager, even though he can see the drive, he can't access it

Is that how it works? Will that create an issue?
I am dealing with multiple users who are not IT-kind-of-people; I don't think they understand about unmounting and stuff; I think they just pop their flash drives in and out as they please...
Yes, that's been the problem. Even though it's removed, it wasn't unmounted. You shouldn't "just remove the media". Always unmount it first, then remove it. One doesn't have to be an IT person to be trained to unmount first, then remove.

As of right now, your /etc/fstab file is mounting the SanDisk flash drive under /mnt, not /media.

In one of my previous post, I suggested that you remove these lines from your /etc/fstab file. You don't need or should have fstab mounting flash drives.

Code: Select all

/dev/disk/by-id/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0-part1 /mnt/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-id/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0 /mnt/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
Also, I see there's another USB device being mounted:

Code: Select all

/dev/disk/by-id/usb-ZOOM_H1_SD_R_W_0123456789ABCDE-0:0-part1 /home/derushah/usb-ZOOM_H1_SD_R_W_0123456789ABCDE-0:0-part1 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
Is that a flash drive too or something else?
otlichnik73
Level 3
Level 3
Posts: 128
Joined: Tue Mar 20, 2018 6:20 pm

Re: Flash Drive asking wrong user for password

Post by otlichnik73 »

JerryF wrote: Sat Dec 08, 2018 4:18 pm Yes, that's been the problem. Even though it's removed, it wasn't unmounted. You shouldn't "just remove the media". Always unmount it first, then remove it.
...
Is that a flash drive too or something else?
Thanks a lot!
Yes, the other entry is another flash drive from another user again; and I have not heard about any issue with that one.

Main question - why do those drives have an entry in fstab you think?

Is it because I changed mounting from /user/media to /mnt/?
Wa that a good idea?
I was just trying to give everyone permission to access...
First Port of Call for Windows Refugees: https://switchtolinuxdesktop.wordpress.com/
User avatar
JerryF
Level 16
Level 16
Posts: 6572
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Flash Drive asking wrong user for password

Post by JerryF »

otlichnik73 wrote: Sat Dec 08, 2018 4:45 pm
JerryF wrote: Sat Dec 08, 2018 4:18 pm Yes, that's been the problem. Even though it's removed, it wasn't unmounted. You shouldn't "just remove the media". Always unmount it first, then remove it.
...
Is that a flash drive too or something else?
Thanks a lot!
...
Main question - why do those drives have an entry in fstab you think?

Is it because I changed mounting from /user/media to /mnt/?
Wa that a good idea?
I was just trying to give everyone permission to access...
Did you use the Disks utility in Linux to assign those drives? The entries look like they are from that.

Not really a good idea. Not for flash drives. If any device is going to be plugged in and remain plugged in (such as an external USB modem, USB hard disk, etc.) then I would set up an entry for that device.

As I had mentioned in a previous post, anytime a USB flash drive is inserted and mounted to /media, that particular user will have access to the drive and those files.

Example on what should normally happen with a flash drive:
bekor logs in
bekor inserts flash drive
Flash drive get mounted as /media/bekor/<name of the flash drive> (In my case, the name was PNY_STICK)
bekor creates files on the flash drive
bekor unmounts/ejects the drive, then removes it
bekor logs out

disciple logs in
disciple insert
Flash drive get mounted as /media/disciple/<name of the flash drive>
disciple has access to bekor's files that bekor created/edited
disciple unmounts the drive, then removes it
disciple logs out
otlichnik73
Level 3
Level 3
Posts: 128
Joined: Tue Mar 20, 2018 6:20 pm

Re: Flash Drive asking wrong user for password

Post by otlichnik73 »

Thank you!
Yes, disks utility is what I used.

Two questions:
1. My problem is - what if the first user does not unmount/eject? Is there a remedy? (these users were used to Windows, where it was not an issue)
You see, the users I am dealing with are mostly artistic-type people, if you know what I mean. They often miss basic things when it comes to IT.

2. I created some web pages for the users as a reference. If you are interested, are you able to look over the one on media and correct any errors? Thanks!

Here it is: https://switchtolinuxdesktop.wordpress. ... ble-media/
First Port of Call for Windows Refugees: https://switchtolinuxdesktop.wordpress.com/
User avatar
JerryF
Level 16
Level 16
Posts: 6572
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Flash Drive asking wrong user for password

Post by JerryF »

otlichnik73 wrote: Sat Dec 08, 2018 6:07 pm Thank you!
Yes, disks utility is what I used.

Two questions:
1. My problem is - what if the first user does not unmount/eject? Is there a remedy? (these users were used to Windows, where it was not an issue)
You see, the users I am dealing with are mostly artistic-type people, if you know what I mean. They often miss basic things when it comes to IT.

2. I created some web pages for the users as a reference. If you are interested, are you able to look over the one on media and correct any errors? Thanks!

Here it is: https://switchtolinuxdesktop.wordpress. ... ble-media/
1. No remedy. You can't mount the flash drive if it's not unmounted/ejected and the user isn't logged off. It's the nature of the beast. I totally understand about artistic people. My partner is a musician. He plays bassoon and organ. I also have a friend who is also an organist. They don't think logically, not like regular people---LOL.

2. In my opinion, your webpage has too much information (for them, not for me). They don't want to know the reasons behind why they're doing any steps. They just want to know how to do the steps. You have to make it into a list of steps to perform---that's it. I know this will sound silly, but you have to put it in such a way that a 5-year-old will understand.
otlichnik73
Level 3
Level 3
Posts: 128
Joined: Tue Mar 20, 2018 6:20 pm

Re: Flash Drive asking wrong user for password

Post by otlichnik73 »

JerryF wrote: Sat Dec 08, 2018 7:01 pm [

2. In my opinion, your webpage has too much information (for them, not for me). They don't want to know the reasons behind why they're doing any steps. They just want to know how to do the steps. You have to make it into a list of steps to perform---that's it. I know this will sound silly, but you have to put it in such a way that a 5-year-old will understand.
Thanks!
More questions ... thanks for bearing with the newbie..
1. If I change the mounting point to /mnt/ (and thus create a permanent entry in the fstab - correct?) - then it will mount the flash there every time, regardless of what happened (unmounted or not). would that solve the issue?

2. What do you think the actual content of the page ? In particular, the "typical scenario" part in the first half, about mounting flash drives?

Cheers!
First Port of Call for Windows Refugees: https://switchtolinuxdesktop.wordpress.com/
User avatar
JerryF
Level 16
Level 16
Posts: 6572
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Flash Drive asking wrong user for password

Post by JerryF »

otlichnik73 wrote: Sun Dec 09, 2018 12:56 am Thanks!
More questions ... thanks for bearing with the newbie..
1. If I change the mounting point to /mnt/ (and thus create a permanent entry in the fstab - correct?) - then it will mount the flash there every time, regardless of what happened (unmounted or not). would that solve the issue?
Any entry that you create in fstab is a permanent one. The Disk utility usually sets the mounting point starting at /mnt. Yes, it will mount the flash there every time. No, that wouldn't solve the issue because you already had that setup before.

Code: Select all

/dev/disk/by-id/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0-part1 /mnt/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-id/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0 /mnt/usb-SanDisk_Corporation_Flash_Drive_200411004318b5514b6a-0:0 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
Linux is not Windows. I know you've heard that before. In Linux, any time a device is attached, a mount file is involved, unlike Windows. That mount file is owned by someone and also is set to a group ownership. When a device, such as a flash drive, gets mounted in the usual way (under /media/<username>) that user must unmount/eject the drive then remove it so that system releases the mount file.

I don't think there's any other way around it. You're going to have to train your users to eject then remove their flash drives.
otlichnik73 wrote: Sun Dec 09, 2018 12:56 am 2. What do you think the actual content of the page ? In particular, the "typical scenario" part in the first half, about mounting flash drives?

Cheers!
It's quite good.

Unfortunately, I know all too well from many users whom I've dealt with and the users that you are dealing with---it's over their head. This is not to say anything about their intelligence. It's all jargon to them and won't help.

Signs in a bright, bold color saying something like "Before you log out, in File Manager, you must right-click on your USB flash drive and unmount/eject your drive, then remove it from the computer."

Just a side note for the paragraph:

"Linux Mint automatically mounts external hard drives in the folder /user1/media." It should read /media/user1.
Locked

Return to “Beginner Questions”