Mount error 1 operation not permitted

I've set up a new Debian 9 (stretch) LXC container on a machine running Proxmox VE, and installed the cifs-utils package. I quickly tested the connection to the SMB server by running smbclient //1...

I’ve set up a new Debian 9 (stretch) LXC container on a machine running Proxmox VE, and installed the cifs-utils package.
I quickly tested the connection to the SMB server by running

smbclient //192.168.0.2/share -U myusername

which worked fine. However, the command

mount.cifs //192.168.0.2/share /mnt -o user=myusername

failed, printing the following error message:

mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

I’ve made sure that…

  • the owner and group of the shared directory (on the SMB server, which is a FreeBSD machine) are both existent on the client, i.e., inside the container.
  • the owner of the shared directory is a member of the group, both on the server and the client. (id myusername)
  • the mountpoint (/mnt) exists on the client.

What could be the cause of the above-mentioned error?

asked Jun 15, 2018 at 9:02

myrdd's user avatar

myrddmyrdd

4072 gold badges4 silver badges14 bronze badges

You’re probably running an unprivileged LXC container. The easiest solution is to use a privileged container instead. However, there might be other solutions; take a look e.g. at this thread/post in the proxmox forums.

answered Jun 15, 2018 at 9:02

myrdd's user avatar

myrddmyrdd

4072 gold badges4 silver badges14 bronze badges

I am not using any Containers, but on my Debian Workstation a have had a similar error a few weeks ago.

After some research I found a solution for me.

I had to add vers=2.0 to the options of the mount command.

Rui F Ribeiro's user avatar

Rui F Ribeiro

54.8k26 gold badges144 silver badges221 bronze badges

answered Jun 15, 2018 at 9:28

Winnie Tigger's user avatar

Try using all variables mentioned below.

sudo mount -t cifs //<IPAddress>/<FromDirectory> /<ToDirectory> -o uid=xxx,username="xxxxx",password="xxxxx",domain="xxxxx",sec=ntlm,vers=2.0

answered Aug 13, 2018 at 19:30

Jeereddy's user avatar

I’ve set up a new Debian 9 (stretch) LXC container on a machine running Proxmox VE, and installed the cifs-utils package.
I quickly tested the connection to the SMB server by running

smbclient //192.168.0.2/share -U myusername

which worked fine. However, the command

mount.cifs //192.168.0.2/share /mnt -o user=myusername

failed, printing the following error message:

mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

I’ve made sure that…

  • the owner and group of the shared directory (on the SMB server, which is a FreeBSD machine) are both existent on the client, i.e., inside the container.
  • the owner of the shared directory is a member of the group, both on the server and the client. (id myusername)
  • the mountpoint (/mnt) exists on the client.

What could be the cause of the above-mentioned error?

asked Jun 15, 2018 at 9:02

myrdd's user avatar

myrddmyrdd

4072 gold badges4 silver badges14 bronze badges

You’re probably running an unprivileged LXC container. The easiest solution is to use a privileged container instead. However, there might be other solutions; take a look e.g. at this thread/post in the proxmox forums.

answered Jun 15, 2018 at 9:02

myrdd's user avatar

myrddmyrdd

4072 gold badges4 silver badges14 bronze badges

I am not using any Containers, but on my Debian Workstation a have had a similar error a few weeks ago.

After some research I found a solution for me.

I had to add vers=2.0 to the options of the mount command.

Rui F Ribeiro's user avatar

Rui F Ribeiro

54.8k26 gold badges144 silver badges221 bronze badges

answered Jun 15, 2018 at 9:28

Winnie Tigger's user avatar

Try using all variables mentioned below.

sudo mount -t cifs //<IPAddress>/<FromDirectory> /<ToDirectory> -o uid=xxx,username="xxxxx",password="xxxxx",domain="xxxxx",sec=ntlm,vers=2.0

answered Aug 13, 2018 at 19:30

Jeereddy's user avatar

  • #1

I have an SMB host sharing some folder on the same LAN where mycontainer is set up.
After having regularly installed cifs support:

admin@mycontainer:~$ sudo apt install cifs-utils

I’m not able to mount a share; issuing:

admin@mycontainer:~$ sudo mount -t cifs -o vers=1.0,username=myusername //smbhost/sharename /mnt/mountpoint

I receive:

mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

dmesg gives this:

dmesg: read kernel buffer failed: Operation not permitted

Issuing the command without vers=1.0 changes nothing.
The same share is regularly used on Windows machine on the LAN

Any suggestion?

Mirco

  • #2

You can’t mount any SMB/NFS share inside a unprivileged LXC. Thats only possible with the unsecure privileged LXCs after enabling the CIFS or NFS features under yourLXC -> Options -> Features. If you want to use shares with a unprivileged LXC you need to mount the shares on your host and then use bind-mounts to bring the mounted share from your host into your LXC.

  • #3

Never did such a thing.
Just found some references to bind-mounting in a chroot-ed environment, I’ll dig deeper.
Thanks a lot for the immediate response.

Mirco

  • Home
  • Forum
  • The Ubuntu Forum Community
  • Ubuntu Official Flavours Support
  • Networking & Wireless
  • Going mad trying to mount old NAS

  1. Angry Going mad trying to mount old NAS

    I was recently given an old NAS (Omninas KD20). This model was discontinued in 2015 and I have spent the last three days trying to mount it in a Linux container to no avail. I am very close to just chucking it in the bin!

    Here’s what I have tried:

    I’ve created a directory call test on the NAS which is public. I can connect to this in Windows (however I had to re-enable SMBv1). I can connect to the share in Linux with smbclient and also with Gigolo. I cannot seem to mount the share using the mount command.

    Code:

    $ sudo mount -t cifs //192.168.1.56/test/ /home/cifs/ -o username=john,password=john
    mount error(112): Host is down

    I thought maybe it’s the SMBv1 issue? dmesg contains an error mentioning dialect level, so let’s try that.

    Code:

    $ sudo mount -t cifs //192.168.1.56/test/ /home/cifs/ -o username=john,password=john,vers=1.0
    mount error(1): Operation not permitted
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

    There is no error after this command in dmesg.
    Very weird because smbclient works!

    Code:

    $ sudo smbclient -L 192.168.1.56/test -U john
    Enter john's password:
    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.32]
    
            Sharename       Type      Comment
            ---------       ----      -------
            test            Disk
            iTunes          Disk      Default_iTunes_share
            disk            Disk      Default_share
            IPC$            IPC       IPC Service (OMNINAS Series)
    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.32]
    
            Server               Comment
            ---------            -------
            LAPTOP-UMPSESSF
            OMNINAS-434369       OMNINAS Series
            RTORRENT             Samba 4.2.14-Debian
    
            Workgroup            Master
            ---------            -------
            WORKGROUP            OMNINAS-434369

    I can also access the share using Gigolo on another laptop. I simply type in the IP address, check ‘Windows Share’ and then it can connect. I can then open it in a terminal and see the files.

    This is incredibly frustrating because I can’t do the one thing I need to do with this Does anyone have any ideas?!


  2. Re: Going mad trying to mount old NAS

    I have also tried to mount with the sec=ntlm option to no avail:

    Code:

    $ sudo mount -t cifs //192.168.1.56/test/ /home/cifs/ -o username=john,password=john,vers=1.0,sec=ntlm
    mount error(1): Operation not permitted
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

    I have also added the following to /etc/samba/smb.conf:

    Code:

        # Allow access to SMB1 shares on other servers
        client ipc min protocol = NT1
        client min protocol = NT1
    
        # Allow access to shares on other servers ONLY via SMB1
        client ipc max protocol = NT1
        client max protocol = NT1
    
        # Allow access to shares on this Samba instance via SMB1
        server min protocol = NT1
    
        # Allow access to shares on this Samba instance ONLY via SMB1
        server max protocol = NT1

    However I still receive ‘Operation not permitted’.

    Last edited by jajayesisgoodjaja; July 5th, 2019 at 05:15 PM.


  3. Re: Going mad trying to mount old NAS


  4. Re: Going mad trying to mount old NAS

    Thread moved to Networking & Wireless for a better fit


  5. Re: Going mad trying to mount old NAS

    Quote Originally Posted by ImpWarfare
    View Post

    Thankyou for these suggestions! I’m going to try them one by one.

    https://ubuntuforums.org/showthread.php?t=2325264
    I tried supplying a uid to no avail
    smbtree -d3 didn’t contain any errors either.

    https://ubuntuforums.org/showthread.php?t=2391756
    I tried vers=1.0,sec=ntlm and also sec=none and nounix. All combinations resulted in ‘Operation not permitted».

    https://ubuntuforums.org/showthread.php?t=2375117
    This guy’s issue was solved by adding vers=1.0 which I already have

    https://ubuntuforums.org/showthread.php?t=2352299
    Unfortunately this issue was resolved by simply adding sudo, which I am already using


  6. Re: Going mad trying to mount old NAS

    I nmaped the NAS to make sure the issue isn’t something on that side of the equation. I didn’t see anything obvious but here’s the output just in case:

    Code:

    root@ubuntu-test:~# nmap --top-ports 10000 -A 192.168.1.56Starting Nmap 7.70 ( https://nmap.org ) at 2019-07-05 16:55 UTC
    Nmap scan report for 192.168.1.56
    Host is up (0.00024s latency).
    Not shown: 8301 closed ports
    PORT    STATE SERVICE     VERSION
    80/tcp  open  http        Apache httpd 2.0.54 ((Unix) PHP/5.2.8)
    | http-cookie-flags: 
    |   /: 
    |     PHPSESSID: 
    |_      httponly flag not set
    |_http-server-header: Apache/2.0.54 (Unix) PHP/5.2.8
    |_http-title: OMNINAS
    139/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
    445/tcp open  netbios-ssn Samba smbd 3.0.32 (workgroup: WORKGROUP)
    515/tcp open  printer
    548/tcp open  afp         Netatalk 3.0 (name: OMNINAS-434369; protocol 3.3)
    | afp-serverinfo: 
    |   Server Flags: 
    |     Flags hex: 0x8f79
    |     Super Client: true
    |     UUIDs: true
    |     UTF8 Server Name: true
    |     Open Directory: true
    |     Reconnect: false
    |     Server Notifications: true
    |     TCP/IP: true
    |     Server Signature: true
    |     Server Messages: true
    |     Password Saving Prohibited: false
    |     Password Changing: false
    |     Copy File: true
    |   Server Name: OMNINAS-434369
    |   Machine Type: Netatalk3.0
    |   AFP Versions: AFP2.2, AFPX03, AFP3.1, AFP3.2, AFP3.3
    |   UAMs: DHX2, DHCAST128
    |   Server Signature: 354d0dcc13edd0a0794f20b34c06d122
    |   Network Addresses: 
    |     192.168.1.56
    |_  UTF8 Server Name: OMNINAS-434369
    MAC Address: 80:EE:73:43:43:69 (Shuttle)
    Device type: general purpose
    Running: Linux 2.6.X
    OS CPE: cpe:/o:linux:linux_kernel:2.6
    OS details: Linux 2.6.19 - 2.6.36
    Network Distance: 1 hop
    Service Info: OS: Unix
    
    Host script results:
    |_clock-skew: mean: 2h00m00s, deviation: 2h49m43s, median: 0s
    |_nbstat: NetBIOS name: OMNINAS-434369, NetBIOS user: <unknown>, NetBIOS MAC: <unknown> (unknown)
    | smb-os-discovery: 
    |   OS: Unix (Samba 3.0.32)
    |   Computer name: OMNINAS-434369
    |   NetBIOS computer name: 
    |   Domain name: localdomain
    |   FQDN: OMNINAS-434369.localdomain
    |_  System time: 2019-07-05T12:56:16-04:00
    | smb-security-mode: 
    |   account_used: guest
    |   authentication_level: user
    |   challenge_response: supported
    |_  message_signing: disabled (dangerous, but default)
    |_smb2-time: Protocol negotiation failed (SMB2)
    
    TRACEROUTE
    HOP RTT     ADDRESS
    1   0.25 ms 192.168.1.56
    
    OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
    Nmap done: 1 IP address (1 host up) scanned in 59.95 seconds


  7. Re: Going mad trying to mount old NAS

    I wonder if this was not shut down while it was being run on Windows. If the machine that was using it did not have fast boot disabled, that might be the cause. Can you connect it to a Win machine (with Fast Boot disabled and then shut it down and see if it is then released?


  8. Re: Going mad trying to mount old NAS

    Interesting idea! I opened the web browser for the NAS on a Windows machine and clicked shutdown, I heard a beep from the NAS and it turned off and was no longer accessible. I turned it back on with the power button and verified it was back on by opening the web admin page. I then tried to mount it again and got the same error «Operation not permitted»

    Is that what you meant by connect from a Windows machine and shut it down? I’m not sure how to check if FastBoot is enabled.

    Is there a way to find the exact error here? Operation not permitted isn’t very illuminating.

    Last edited by jajayesisgoodjaja; July 5th, 2019 at 06:14 PM.


  9. Re: Going mad trying to mount old NAS

    I think I have figured it out. I’m using a Ubuntu LXC container on a Proxmox host. When I use an Ubuntu VM, the NAS mounts fine. No idea how to solve it so I’m just going to switch to the VM.


Tags for this Thread

Bookmarks

Bookmarks


Posting Permissions

Понравилась статья? Поделить с друзьями:
  • Motor storing ошибка даф 95
  • Motor starter туарег ошибка
  • Mount blade warband ошибка rgl error
  • Motor invert error перевод
  • Mount blade ii bannerlord вылетает ошибка