# Mounting a password protected NFS share

## Galumph

My father set up an NFS server today which seems to be password protected (Trying to access it on Windows using \\whatever prompts for a user name and password). How do pass my user name and password over to mount so it can be properly mounted. Plainly mounting the share doesn't work:

```

root # mount -t nfs ****:/ /mnt/nfs/

mount.nfs: access denied by server while mounting ****:/

```

Also, how do I get Linux to resolve the machine's name? (Windows does it just fine.)

```

root # mount -t nfs machine:/ /mnt/nfs/

mount.nfs: Failed to resolve server machine: Name or service not known

```

----------

## gentoo_ram

Connecting via Windows is over SMB, not NFS.  There's no such thing as "password protected" NFS.  You want to mount with type 'cifs', not NFS.

----------

## Galumph

The machine with the NFS filesystem is a Linux box.

I tried using cifs instead and I got this:

```

# mount -t cifs ****:/ /mnt/nfs/ -o user=ron,password=********

Retrying with upper case share name

mount error(6): No such device or address

Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

```

What am I doing wrong? (I have cifs-utils v5.1 installed.)

e, Apparently I can't mount the root directory of the share, only subdirectories.

```

# mount -t cifs ****:/music /mnt/nfs/ -o user=ron

Password:

#

```

How do I mount the root directory of the share?

----------

## Veldrin

 *Quote:*   

> How do I mount the root directory of the share?

 

You don't. 

this is part of smb/cifs design, that you have to mount a share.

----------

## Galumph

Windows seems to be doing it just fine. I pop open explorer.exe and type "\\machine" into the navitavtion bar and I see all the subdirectories of the share. On Linux I can only mount said subdirectories individually. Is Windows using some kind of trick to mount them all at once?

----------

## gentoo_ram

That's just giving you a list of all the shares.  (ie. smbclient -L)  You don't connect until you actually attach to one in the list.

----------

## Galumph

That's interesting, writing a script to mount them all should do the trick then, right?

Also, about the local host/domainname resolving. I have my router set up as one of my nameservers (in resolv.conf), but no application seems to be able to resolve any local hostname. What am I missing?

----------

## Veldrin

 *Quote:*   

> Windows seems to be doing it just fine. I pop open explorer.exe and type "\\machine" into the navitavtion bar and I see all the subdirectories of the share. On Linux I can only mount said subdirectories individually. Is Windows using some kind of trick to mount them all at once?

 

True, and this also works in linux (at least dolphin/konqueror are able to), but you will not be able to mount (or map network drive as windows calls it) the entire server (or root share).

 *Quote:*   

> Also, about the local host/domainname resolving. I have my router set up as one of my nameservers (in resolv.conf), but no application seems to be able to resolve any local hostname. What am I missing?

  did you configure your hosts somewhere on the adsl router? are you only using host with dhcp names? are those hostnames visible somewhere on the router? 

are you able to ping the adsl router via hostname? if so, how does you host file (/etc/hosts) look like?

From general experience, your average adsl router is not able to provide dns resolution for internal hosts. resolution for hosts on the internet are possible (he just contacts the root dns servers, or any forwards provided by the isp)

V.

----------

