Announcement

Collapse
No announcement yet.

Cannot Mount or Access USB storage on router

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Cannot Mount or Access USB storage on router

    I am basically running 14.04 on one machine and 12.04 on another (soon to be upgraded to 14.04). I have an Asus RT-N66U router that I have configured as an access point in one building which is wire networked to a DSL modem/router in another building. I want to attach a USB drive to the Asus router and share files across the network. I have booted into a native Windows 7 install on one of the computers and I can see the files on the drive. However, in Linux the drive will not mount. I have tried different configurations in my fstab file but to no effect.

    rob@rob-Latitude-E6510:~$ sudo mount -a
    [sudo] password for rob:
    mount error(13): Permission denied
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
    rob@rob-Latitude-E6510:~$ ^C
    rob@rob-Latitude-E6510:~$

    On the 12.04 install I have created a folder or directory /media/ElementsUSB. I currently have in my fstab file this entry:
    //192.168.123.91/RT-N66U-8060/ /media/ElementsUSB/ cifs guest,uid=rob,iocharset=utf8,file_mode=0777,dir_mo de=0777,noperm 0 0

    192.168.123.91 is the static IP address of the Asus router/access point. RT-N66U-8060 is the device name listed in the routers samba share tab. It was also what showed up in Windows, so I think it is right. But the tree under both the samba share tab and the FTP share tab shows RMBC_2 (router name) > RT-N66U-8060 > WD 10EAVS External > Data_USB (which is a directory on the USB drive).

    In Firefox ftp://192.168.123.91/Data_USB/Users/Public/Documents/ shows directories, but I cannot open the files. I get the error message: “550 Failed to change directory”.

    I have looked over the forums and searched a bit, but I know just enough to be dangerous without figuring this out. Any solutions or direction would be appreciated.
    "It is not our task to secure the triumph of truth, but merely to fight on its behalf."--Blaise Pascal
    Asus UX303U Laptop: i7-6500U 2.5GHz; 12GB RAM; 3200x1800
    HP Desktop: AMD Ryzen 7 5700G; 16GB RAM; 3840x2160, NVIDIA GeForce RTX 3060​

    #2
    hi,

    normally, before putting samba shares in fstab i do manual mounts/browses...
    as in this example: mount -t cifs -o username=server_user,password=secret //192.168.44.100/share /path_to/mount

    see if that works for u

    i cant remember the other commands, but its using smbclient program
    man smbclient

    it will allow u to browse local network from command line
    K 14.4 64 AMD 955be3200MHz 8GB 1866Mhz 6TB Plex/samba.etc.+ Macbook Air 13".

    Comment


      #3
      millusions, thanks for the reply. I did try several variations.
      sudo mount -t cifs -o username=(router username),password=(router password) //192.168.123.91/RT-N66U-8060/Data_USB
      sudo mount -t cifs -o username=(router username),password=(router password) //192.168.123.91/Data_USB
      sudo mount -t cifs -o guest //192.168.123.91/RT-N66U-8060/Data_USB
      sudo mount -t cifs -o guest //192.168.123.91/Data_USB

      Obviously the problem is I don't really understand what I am doing. Not only do I not understand what command and augments to use, but I don't know what username is needed? What Password is needed? What device designation is needed? Is there anyway I can discern this from my Windows install since it works out of the box? I tried to, but I know even less about Windows.
      "It is not our task to secure the triumph of truth, but merely to fight on its behalf."--Blaise Pascal
      Asus UX303U Laptop: i7-6500U 2.5GHz; 12GB RAM; 3200x1800
      HP Desktop: AMD Ryzen 7 5700G; 16GB RAM; 3840x2160, NVIDIA GeForce RTX 3060​

      Comment


        #4
        hey,

        in the examples you have typed up above you do not specifiy a mount point....
        you need to add /tempmount or something at the end..

        and post results if you can


        you do know what you're doing, these things can be annoying at first when you dont know where the problem is,
        i suspect the problem is the router samba config and you and me not knowing whats in it. i doubt its samba, or is it?

        so is windows accessing the share as anon or is it passing on the logged in user/pass ...

        you'll have to play around with smbclient

        To display public shares on the server:
        $ smbclient -L <hostname> -U%
        To connect to a share:
        $ smbclient //<hostname>/<share> -U<username>%<password>

        to identify a valid user/pass combo that the router will accept, unless you can edit the router security settings? sorry, not familiar with this model
        Last edited by millusions; Nov 12, 2014, 04:35 PM.
        K 14.4 64 AMD 955be3200MHz 8GB 1866Mhz 6TB Plex/samba.etc.+ Macbook Air 13".

        Comment


          #5
          Thank you! Both of these worked! (I actually thought about putting in a mount point, but I misread you post.)
          sudo mount -t cifs -o username=(router username),password=(router password) //192.168.123.91/Data_USB
          sudo mount -t cifs -o guest //192.168.123.91/Data_USB

          I could open Dolphin and browse the files. Is the first more secure than the second? Will anyone on the network be able to access them or do they have to be mounted on a guest's computer? We do have business guests from time to time and would perfer them not to have access.

          Thanks again for your patience.
          "It is not our task to secure the triumph of truth, but merely to fight on its behalf."--Blaise Pascal
          Asus UX303U Laptop: i7-6500U 2.5GHz; 12GB RAM; 3200x1800
          HP Desktop: AMD Ryzen 7 5700G; 16GB RAM; 3840x2160, NVIDIA GeForce RTX 3060​

          Comment


            #6


            as far as security, thats something you need to configure on the router..
            it may or may not have this facility .

            was it any different as to what u saw in first and second example?
            K 14.4 64 AMD 955be3200MHz 8GB 1866Mhz 6TB Plex/samba.etc.+ Macbook Air 13".

            Comment


              #7
              I have the same router but haven't played with the USB ports yet. So I connected a USB drive to it and tried to browse it using dolphin. I was unsuccessful using the icon tree: Network > Samba Shares > <router_name> This just got me "Server timeout". Either Dolphin is passing my desktop username (which the router doesn't know) or just won't work this way. Too bad we can't set different usernames/passwords for network folders.

              However, if you type: smb://192.168.1.1/Data_USB/ in the Dolphin URL bar you will get a guest connection. You can then drag the folder icon from the URL bar to the Dolphin "Places" panel and it will be there for you to click on.

              Please Read Me

              Comment


                #8
                Re: guests accessing your files, if you disable Guest access to the USB in the router setup, they won't be able to access it (you won't either unless you use the router username and password) or you can use Guest access settings and let your guests use the internet but not your local network, which I assume would include the USB drives.

                Please Read Me

                Comment


                  #9
                  Ok, more info: I turned off guest access. This allows you to enter samba usernames and passwords. I added my desktop username and password (and gave myself RW permissions) and was able to immediately browse the share in Dolphin using the IP address like so smb://192.168.1.1 but navigating via Network > Samba Shares still fails. Then I edited my hosts file and added the router name (in my case rt-ac66u-xxxx) and it's IP. Now I can browse it using Dolphin.

                  Please Read Me

                  Comment


                    #10
                    Originally posted by millusions View Post
                    as far as security, thats something you need to configure on the router..
                    it may or may not have this facility .

                    was it any different as to what u saw in first and second example?
                    Yes, of course, I should have realized. I had set the router up with guest access to simplify the troubleshooting. Therefore there was no difference with either example. When I turned off guest access neither worked.

                    oshunluver, your input is very helpful as well, but I have a few questions.
                    With guest access turned off I can enter "smb://192.168.etc" in the Dolphin address bar and see the storage which is in turn accessable when I supply my router username and password. Great headway!
                    You said:
                    I turned off guest access. This allows you to enter samba usernames and passwords. I added my desktop username and password (and gave myself RW permissions) and was able to immediately browse the share in Dolphin using the IP address like so smb://192.168.1.1 but navigating via Network > Samba Shares still fails. Then I edited my hosts file and added the router name (in my case rt-ac66u-xxxx) and it's IP. Now I can browse it using Dolphin.
                    Samba usernames and passwords? How do I edit them and/or add desktop username and password? What/where is the hosts file? And finally since I want to sync with this drive automatically what entry do I put in the fstab file to mount it on boot? Sorry if the answers should be obvious.
                    "It is not our task to secure the triumph of truth, but merely to fight on its behalf."--Blaise Pascal
                    Asus UX303U Laptop: i7-6500U 2.5GHz; 12GB RAM; 3200x1800
                    HP Desktop: AMD Ryzen 7 5700G; 16GB RAM; 3840x2160, NVIDIA GeForce RTX 3060​

                    Comment


                      #11
                      In the router setup, enter your desired samba username and password on the same page you disabled guest access. It's below the Apply button - just click the Plus sign to the left and enter your username and password. Don't forget to set access permissions here also - click your USB device in the list and select RW for each root folder.

                      The hosts file is /etc/hosts. Add your router to the list. Add the line as below:

                      Code:
                      127.0.0.1       localhost
                      127.0.1.1       mymachine 
                      [B]192.168.1.1     rt-ac66u-8060[/B]
                      Mounting the drive (sync has an entirely different meaning) via fstab requires an entry like:

                      //rt-n66u-8060/Data_USB /media/Data_USB cifs username=<username>,password=<password> 0 0

                      Substitute your username and password for <username> and <password>

                      The problem with this method is now your samba username and password are stored in readable plain text. A better way to be somewhat more secure is to store your samba username and password in a file in your home. Also, use a different password for samba. Don't use your main password.

                      To use a password file, using a text editor (kate), create a file for your samba credentials:

                      kate ~/.smbcred

                      Enter your samba username and password in the file:

                      username=<username>
                      password=<password>


                      Don't forget to add a blank line (carriage return) at the end of the file. Save the file and quit kate.

                      Change the permissions of the file to prevent unwanted access to your credentials:

                      chmod 600 ~/.smbcred

                      Then edit your /etc/fstab file (with root privileges) to add this line (replacing the insecure line in the example above, if you added it):

                      //rt-n66u-8060/Data_USB /media/Data_USB cifscredentials=/home/<username>/.smbcred 0 0

                      Again: substitute your actual username for <username>.

                      Test the fstab entry by doing:

                      sudo mount -a

                      If there are no errors, your remote share should mount automatically at next reboot.

                      Above adapted from https://wiki.ubuntu.com/MountWindowsSharesPermanently

                      Please Read Me

                      Comment


                        #12
                        Originally posted by oshunluvr View Post
                        Re: guests accessing your files, if you disable Guest access to the USB in the router setup, they won't be able to access it (you won't either unless you use the router username and password) or you can use Guest access settings and let your guests use the internet but not your local network, which I assume would include the USB drives.

                        in KDE control panel do u have default network share username/pass?
                        K 14.4 64 AMD 955be3200MHz 8GB 1866Mhz 6TB Plex/samba.etc.+ Macbook Air 13".

                        Comment


                          #13
                          oshunluver, thanks for your clear instructions! I have edited the hosts file per your instructions and when I enter smb://rt-n66u-8060/ in the address bar of Dolphin I get a display of all files on the USB devices attached to the router. Clicking on a file request a name and password. Entering the name and password set in the router samba configuration as you instructed allows access to the file. So it appears that is configured properly. I can also access the files via Dolphin > Network >Samba Shares > Workgroup > rt-n66u-8060.

                          I next edited the fstab using the line:
                          //rt-n66u-8060/Storage /media/LAN_Storage cifs username=<username>,password=<password> 0 0
                          It worked!
                          Then I created the hidden smbcredentials file in my home directory and changed permissions. Then I edited the fstab line to read:
                          //rt-n66u-8060/Storage /media/LAN_Storage cifs credentials=/home/rob/.smbcredentials 0 0
                          It does NOT work. I read through the wiki you referenced (note change in file name and a minor typo correction in fstab line), but I cannot see the problem unless I need to add the "iocharset=utf8,sec=ntlm" information, but the other line works without it. I have checked and double checked spellings, locations, etc. So, I am currently using the unsecure line in the fstab file.

                          BTW, the reason I wanted to mount from the fstab is because I want to rsync to sync some files accross two computers and also backup files automatically.

                          millusions, I do not have a samba username and password set in System Settings > Network Settings > Network Drives if that is what you are asking.
                          "It is not our task to secure the triumph of truth, but merely to fight on its behalf."--Blaise Pascal
                          Asus UX303U Laptop: i7-6500U 2.5GHz; 12GB RAM; 3200x1800
                          HP Desktop: AMD Ryzen 7 5700G; 16GB RAM; 3840x2160, NVIDIA GeForce RTX 3060​

                          Comment


                            #14
                            i dont think you need the zeros..

                            my entries in fstab:

                            //anubis/april /mnt/april cifs credentials=/home/zzz/.credentials,noauto
                            //anubis/athene /mnt/athene cifs credentials=/home/zzz/.credentials,noauto
                            //anubis/adele /mnt/adele cifs credentials=/home/zzz/.credentials,noauto
                            //anubis/astrix /mnt/astrix cifs credentials=/home/zzz/.credentials,noauto

                            then there's a couple of scripts in home dir: lan-on and lan-off

                            yes, everything starts with a on my lan lol

                            also, dont forget an entry in /etc/hosts
                            10.1.1.40 anubis
                            different in ur case, yea?
                            K 14.4 64 AMD 955be3200MHz 8GB 1866Mhz 6TB Plex/samba.etc.+ Macbook Air 13".

                            Comment


                              #15
                              I worked on this all morning and I can't get the credentials file to work at all, either in fstab or from the CLI. I always get error code -13 (permission denied). Everything I can find on the 'net says to install cifs-utils, which of course I already have installed. Then I finally re-install cifs-utils and the error message looks different, but still shows error code -13. Using the username and password in the mount line works fine.

                              I'm at a loss.

                              Please Read Me

                              Comment

                              Working...
                              X