Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
Keephie
Level 1
Level 1
Posts: 5
Joined: Fri Mar 10, 2017 3:53 pm

Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Post by Keephie »

Hi, Mint noob here. Have just installed Mint 64-bit on an old laptop to give it a new lease of life.
I want to access shares from a NAS drive (on my Win machines these are mapped drives), and found Gigolo. I installed Samba, enabled it through my firewall, and created Gigolo bookmarks set to auto-connect at start-up.
This works fine, except that every start I get this prompt to authenticate for each share:
gigolo_prompt1.png
The "Connect anonymously" option is all I need, so I simply have to click "Connect", but it's rather dull to have to do this every time, plus Gigolo pops these up every N seconds if unattended.
My NAS (Netgear) is set to allow anonymous access with full rights for everyone, with no user accounts defined.
Any suggestions gratefully received.

Info about my setup:
System: Host: crispin-Aspire-5741 Kernel: 4.4.0-66-generic x86_64 (64 bit gcc: 5.4.0)
Desktop: KDE Plasma 5.8.5 (Qt 5.6.1)
Distro: Linux Mint 18.1 Serena
Machine: System: Acer (portable) product: Aspire 5741 v: V1.05
Mobo: Acer model: Aspire 5741 v: V1.05
Bios: Acer v: V1.05 date: 04/06/2010
CPU: Dual core Intel Core i3 M 330 (-HT-MCP-) cache: 3072 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 8513
clock speeds: max: 2133 MHz 1: 1333 MHz 2: 1199 MHz 3: 1333 MHz
4: 1066 MHz
Graphics: Card: Intel Core Processor Integrated Graphics Controller
bus-ID: 00:02.0
Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa)
Resolution: 1366x768@60.04hz
GLX Renderer: Mesa DRI Intel Ironlake Mobile
GLX Version: 2.1 Mesa 11.2.0 Direct Rendering: Yes
Audio: Card Intel 5 Series/3400 Series High Definition Audio
driver: snd_hda_intel bus-ID: 00:1b.0
Sound: Advanced Linux Sound Architecture v: k4.4.0-66-generic
Network: Card-1: Broadcom NetLink BCM57780 Gigabit Ethernet PCIe
driver: tg3 v: 3.137 bus-ID: 01:00.0
IF: enp1s0 state: down mac: <filter>
Card-2: Broadcom BCM43225 802.11b/g/n
driver: bcma-pci-bridge bus-ID: 02:00.0
IF: wlp2s0b1 state: up mac: <filter>
Drives: HDD Total Size: 320.1GB (4.8% used)
ID-1: /dev/sda model: Hitachi_HTS54503 size: 320.1GB
Partition: ID-1: / size: 94G used: 7.0G (8%) fs: ext4 dev: /dev/sda5
ID-2: swap-1 size: 8.24GB used: 0.00GB (0%) fs: swap dev: /dev/sda6
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors: System Temperatures: cpu: 48.0C mobo: N/A
Fan Speeds (in rpm): cpu: N/A
Info: Processes: 356 Uptime: 13:42 Memory: 2584.0/7656.1MB
Init: systemd runlevel: 5 Gcc sys: 5.4.0
Client: Shell (bash 4.3.461) inxi: 2.2.35
Last edited by Keephie on Sun Mar 12, 2017 5:37 am, edited 2 times in total.

altair4
Level 19
Level 19
Posts: 9993
Joined: Tue Feb 03, 2009 10:27 am

Re: Using Gigolo to access NAS drive - how prevent authentication prompt?

Post by altair4 »

The issue here isn't gigolo but a change to the samba client and how seahorse ( Passwords and Keys ) interacts with it.

When you set this up to automount you are prompted for credentials even though none may be required. You select "Connect Anonymously" and then "Remember Forever" but there's a problem. Seahorse has no way to interpret what "Connect Anonymously" means so it doesn't register the credentials.

To resolve this issue the next time you are prompted for credentials :

Select "Connect as User"
Username: guest
Password: xxx <-- literally xxx
Then select "Remember Forever"

Now an entry is made in seahorse for this connection since now it has a recognizable username and password to remember.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

Keephie
Level 1
Level 1
Posts: 5
Joined: Fri Mar 10, 2017 3:53 pm

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [solved]

Post by Keephie »

Thanks so much altair4 that has solved the issue and I had not seen that tip posted anywhere else.
I now have lots of other questions about the behaviour (&misbehaviour) of the access to these drive shares in different applications, making me hope there's a better way of mapping drives, but I should create new threads!

Keephie
Level 1
Level 1
Posts: 5
Joined: Fri Mar 10, 2017 3:53 pm

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [solved]

Post by Keephie »

Actually can I mark this unsolved again!? The Gigolo remote shares are now visible on start-up without entering credentials, but they are not writable. e.g. in Libre Office Writer if I try to save a document to these locations I get "Error saving the document. Object not accessible. The object cannot be accessed due to insufficient user rights".
How do I make such shares writable? (As noted earlier, there are no permissions restrictions set on the NAS - all shares are writable to everyone).

altair4
Level 19
Level 19
Posts: 9993
Joined: Tue Feb 03, 2009 10:27 am

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Post by altair4 »

That's not a gigolo issue either. I'm afraid this is going to get messy since this may take many iterations before we get it just right.

This should be installed by default but just in case run this anyway:

Code: Select all

sudo apt install cifs-utils
Then create a mount point for the nas share - place it under /media - for example:

Code: Select all

sudo mkdir /media/nas-flowerfiles
Then do a temporary ( for now ) mount of the share and see if the Writer issue goes away:

Code: Select all

sudo mount -t cifs //netgearnas2/flowerfiles /media/nas-flowerfiles -o guest,uid=1000,nounix,nobrl
Note: We may end up adding some more options at this thing until we get the right settings to make the NAS happy.

To unmount:

Code: Select all

sudo umount /media/nas-flowerfiles
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

Keephie
Level 1
Level 1
Posts: 5
Joined: Fri Mar 10, 2017 3:53 pm

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Post by Keephie »

Thanks for the continued assistance with this - sounds like we can get there in the end.
cifs-utils was already installed and up to date.
I created /media/nas-flowerfiles no problem.
However...
crispin-Aspire-5741 crispin # sudo mount -t cifs //netgearnas2/FlowerFiles /media/nas-flowerfiles -o guest,uid=1000,nounix,nobrl
mount error: could not resolve address for netgearnas2: Unknown error
I can see the share in Gigolo and in Dolphin. I tried both //netgearnas2/FlowerFiles and //netgearnas2/flowerfiles
?

rene
Level 15
Level 15
Posts: 5883
Joined: Sun Mar 27, 2016 6:58 pm

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Post by rene »

You'll need (well, want; see below) Windows name resolving to be able to address the NAS by name. That is, try

Code: Select all

sudo apt-get install libnss-winbind
This will/might pull in some more as well; don't worry, it's fine. Then edit /etc/nsswitch.conf,

Code: Select all

gksudo xed /etc/nsswitch.conf
and add " wins " just before "dns" on the "hosts:" line. After doing that you should be able to, say, ping netgearnas2 as well as apply altair's instructions, assuming of course that "netgearnas2" is indeed the "Windows name" of the NAS.

If the NAS IP is static what you could instead do is simply replace the name "netgearnas2" with said actual IP, and/or add a line

Code: Select all

netgearnas2 192.168.1.128
to the /etc/hosts file, with 192.168.1.128 replaced by the actual IP, but I wouldn't. I in fact believe that Mint should come with Windows name resolving enabled out of the box.

Note that there's a difference between network addressing at the level which altair wanted you to operate at, and the higher filemanager-level which uses a usermode filesystem library to have things Just Work. As well as Just Confuse the heck out of anyone new to Linux.

[EDIT: noticed from other posts that "xedit" is in fact called "xed" in Mint 18; edited as such]
Last edited by rene on Thu Mar 16, 2017 12:29 pm, edited 2 times in total.

altair4
Level 19
Level 19
Posts: 9993
Joined: Tue Feb 03, 2009 10:27 am

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Post by altair4 »

Keephie wrote:Thanks for the continued assistance with this - sounds like we can get there in the end.
cifs-utils was already installed and up to date.
I created /media/nas-flowerfiles no problem.
However...
crispin-Aspire-5741 crispin # sudo mount -t cifs //netgearnas2/FlowerFiles /media/nas-flowerfiles -o guest,uid=1000,nounix,nobrl
mount error: could not resolve address for netgearnas2: Unknown error
I can see the share in Gigolo and in Dolphin. I tried both //netgearnas2/FlowerFiles and //netgearnas2/flowerfiles
?
Use the ip address of the device instead:

Code: Select all

sudo mount -t cifs //192.168.0.2/FlowerFiles /media/nas-flowerfiles -o guest,uid=1000,nounix,nobrl
Replacing 192.168.0.2 with the actual ip address of the device.

You might want to investigate if the device is mDNS capable. Can you ping the device this way:

Code: Select all

ping netgearnas2.local -c3
If you can and the ip address is not static you can use that:

Code: Select all

sudo mount -t cifs //netgearnas2.local/FlowerFiles /media/nas-flowerfiles -o guest,uid=1000,nounix,nobrl
Not a big fan of winbind. About the only use case for it in a home lan is for a CIFS mount however since CIFS doesn't use smb.conf but in a network with modern OS's in play it's best to be avoided.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

rene
Level 15
Level 15
Posts: 5883
Joined: Sun Mar 27, 2016 6:58 pm

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Post by rene »

altair4 wrote:Not a big fan of winbind.
Rather doubt anyone is, and I agree the ".local" solution is a fine one when available -- but do personally feel that a newbie/convenience-geared distribution such as Mint should have Windows name resolving enabled out of the box, even if only to do away with that "commandline vs. filemanager" name resolving discrepancy. But shall butt out otherwise.

Keephie
Level 1
Level 1
Posts: 5
Joined: Fri Mar 10, 2017 3:53 pm

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Post by Keephie »

Thanks both. I have mounted the share using the fixed ip of the NAS.
(aside, I was able to ping the netgearnas2.local address, but went with the i.p. anyway).
I then find that from Writer I still cannot save to the bookmark created by Gigolo, but I can save to the /media/nas-flowerfiles folder.
I wasn't sure whether you were suggesting this is the solution, i.e. just abandon the idea of having NAS shares as something like mapped drives and instead just find them as kind of virtual folders within the local solder structure? Or was this just a test?
I would like a solution that is visible to all applications. The Gigolo bookmarks seem to be anything but (e.g. Keepass cannot see them). I would also like a solution that makes these NAS shares simple to find within a file manager and within the open/save dialogues of applications (this is for my young son's homework). Is this just impossible in linux-land?
Help greatly appreciated.

altair4
Level 19
Level 19
Posts: 9993
Joined: Tue Feb 03, 2009 10:27 am

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Post by altair4 »

Gigolo will use the same backed as the file manager so gigolo will not be the answer.

Once this works:
sudo mount -t cifs //192.168.0.2/FlowerFiles /media/nas-flowerfiles -o guest,uid=1000,nounix,nobrl
You can have it mount at boot by rearranging it somewhat and placing it in /etc/fstab:

Code: Select all

//192.168.0.2/FlowerFiles /media/nas-flowerfiles cifs guest,uid=1000,nounix,nobrl 0 0
If it doesn't mount at boot ( that happens sometimes ) run this command to see if it mounts after boot:

Code: Select all

sudo mount -a
If it does you have a couple of options:

[1] This one: viewtopic.php?t=236712#p1260038

[2] Or this one: On Demand CIFS Mounting of Shares - just add user and noauto to the fstab line:

Code: Select all

//192.168.0.2/FlowerFiles /media/nas-flowerfiles cifs guest,uid=1000,nounix,nobrl,user,noauto 0 0
EDIT: I just realized if I read your original post correctly you are using Gigolo in a KDE system?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

altair4
Level 19
Level 19
Posts: 9993
Joined: Tue Feb 03, 2009 10:27 am

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Post by altair4 »

Well now you made me go into KDE - which I try to avoid - to see if what I told you do works there.

I set up this in KDE's fstab:
//gort.local/downloads /media/Gort/Downloads cifs guest,uid=1000,nounix 0 0
Because it's mounting under /media it will show up as a link ( downloads on gort.local in this case ) in Dolphin and I believe all of your other applications like Kate:
SMB-share-in-kate.png
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

ataulfo
Level 3
Level 3
Posts: 124
Joined: Sun Apr 12, 2015 3:51 am

Re: Using Gigolo to access NAS drive - how prevent authentication prompt? [half solved]

Post by ataulfo »

This works for me and i have no problem with my two NAS
(es. 192.168.0.2 as Nas ip. Mkdir a folder in /media. Use domain of your nas es. WORKGROUP)

/etc/fstab

Code: Select all

//192.168.0.2/NasFolderPath	 /media/FolderName   cifs username=NasFolderUser,password=NasUserPassword,domain=NasSambaDomainName,user,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,nounix 0 0
/etc/nsswitch.conf

Code: Select all

hosts: files wins mdns4_minimal [NOTFOUND=return] dns mdns4

Post Reply

Return to “Other networking topics”