How to add NFS with username Proxmox 4.3?

nharmando

New Member
Dec 8, 2016
14
0
1
40
Hello people

I have a Lenovo ix4-300d and I've shared a folder to use NFS with some level of security with user and password, but I can't connect it from my proxmoo 4.3.

How can I add that shared storage with user and password?

I know how to add an NFS with proxmox but I don't know how to set username and password.

It has an username and password beacause the IP of NFS can access fron another computers in the same network and I need to protect the folder of NFS proxmox.
 
Hi,

you can add this in the storage.cfg on the nfs option string

username=foo,password=bar
 
Hello wolfgang,

Thank's a lot for your response.

I have this in the storage.cfg:

nfs: virtual-disk
path /mnt/pve/virtual-disk
server 160.150.2.120
export /nfs/virtual-disk
username=user,password=Test123
options vers=3
content images
nodes proxmox2,proxmox3,proxmox1
maxfiles 1

But when I try to display the content in my shared storage I got the error virtual-disk' - directory '/mnt/pve/virtual-disk' does not exist (500)

Only works if the shared storage got the 777 permision but with username and password doesn't work.

Could you help me please?
 

Attachments

  • error.jpg
    error.jpg
    20.6 KB · Views: 54
there may be some cleanup to do from 1ST attempts.

on all 3 nodes try
Code:
umount /mnt/pve/virtual-disk

if not ok try
Code:
umount -l /mnt/pve/virtual-disk

then pve will try to mount again.
 
Hello RobFantini,

Thank's for your help

That's work only when I get the 777 permision to the folder in my NAS. But when I create a user with password It doesn't work, I have another users in my network but I need to restric the acces of the proxmox's folder in my nas only to one user, that's why I trying to acces from proxmox to my nas with username and password but it doesn't mount the shared storage

Regards
 
I see what you mean.

pve seems to change perms to 777 on the NFS/SAN .

with 777 are you able to mount with password?

Exactly, when I get the 777 perms in NFS is posible to mount without username and password too.

But to security, I got one user in NFS with perms to the folder no anyone more, but when I try to mount the shared folder with that username in proxmox doesn't work
 
The problem is that qemu will always write as root.
So you have to options set all_squash and set the anonuid and anomgid
or use no_root_squash in exports file
 
Hello wolfgang,

thank's so much for your help!!

I've set all_squash and it works!! I didn't know that about qemu.

Best regards!!