Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
1
answers
5585
views
How to change permissions on Samba subfolder?
I have a Samba server with ROLE_DOMAIN_MEMBER in the Active Directory. My main aim is to make a different permissions on share sub-folders on every single share. It can be done using Linux acl or Windows permissions GUI, but I prefer a Windows GUI. In this case users can do this by themselves. I alr...
I have a Samba server with ROLE_DOMAIN_MEMBER in the Active Directory. My main aim is to make a different permissions on share sub-folders on every single share. It can be done using Linux acl or Windows permissions GUI, but I prefer a Windows GUI. In this case users can do this by themselves.
I already tried to change permissions using chmod, chown, acl, Windows GUI and Windows console GUI, and I can change permissions to sub-folder but it seems that it doesn't work and only groups added to samba-share worked for me and also for sub-folders
valid users = "+DOMAIN.LOCAL\IT" # "+DOMAIN.LOCAL\adm" # "+DOMAIN.LOCAL\DR" # "DOMAIN.LOCAL\PRINTERS"
admin users = "+DOMAIN.LOCAL\IT" # "+DOMAIN.LOCAL\adm" # "+DOMAIN.LOCAL\DR" # "DOMAIN.LOCAL\PRINTERS"
I print here all my smb.cfg and a single test share:
[global]
# No .tld
workgroup = DOMAIN
netbios name = samba4
server string = %h server (Samba, Ubuntu)
# Active Directory System
security = ads
# With .tld
realm = DOMAIN.LOCAL
# Just a member server
domain master = no
local master = no
preferred master = no
dns proxy = no
# Disable printing error log messages when CUPS is not installed.
printcap name = /dev/null
load printers = no
printcap cache time = 0
#additional section
obey pam restrictions = yes
map to guest = bad user
dns proxy = no
vfs objects = acl_xattr
map acl inherit = yes
nt acl support = yes
acl map full control = yes
#acl compatibility = auto
store dos attributes = yes
map archive = no
map hidden = no
map read only = no
map system = no
# Works both in samba 3.2 and 3.6.
#idmap backend = tdb
# no .tld
idmap config * : backend = tdb
idmap config * : range = 10000-99999
winbind enum users = yes
winbind enum groups = yes
# This way users log in with username instead of username@example.com
winbind use default domain = yes
# Inherit groups in groups
winbind nested groups = yes
winbind refresh tickets = yes
winbind offline logon = true
#winbind separator = \
# Becomes /home/example/username
template homedir = /home/%D/%U
#logon drive = H:
#logon home = \\smb\%U
# No shell access
template shell = /bin/bash
client use spnego = yes
client ntlmv2 auth = yes
#password server = dc01.domain.local, dc02.domain.local
password server = *
encrypt passwords = yes
unix password sync = yes
pam password change = yes
smb passwd file = /etc/samba/smbpasswd
os level = 20
restrict anonymous = 2
log file = /var/log/samba/samba.log
log level = 3
#logging = syslog@1 /var/log/samba/log.%m
vfs objects = full_audit
full_audit:success = mkdir rmdir unlink pwrite
full_audit:prefix = %u|%I|%m|%S
full_audit:failure = none
full_audit:facility = local5
full_audit:priority = notice
recycle:repository = /home/recycle/
recycle:keeptree = yes
recycle:versions = yes
max log size = 100000
panic action = /usr/share/samba/panic-action %d
guest ok = yes
[test$]
path = /FS/test$
browseable = yes
read only = no
inherit acls = yes
inherit permissions = yes
create mask = 700
directory mask = 700
valid users = "+DOMAIN.LOCAL\IT" # "+DOMAIN.LOCAL\adm" # "+DOMAIN.LOCAL\DR" # "DOMAIN.LOCAL\PRINTERS"
admin users = "+DOMAIN.LOCAL\IT" # "+DOMAIN.LOCAL\adm" # "+DOMAIN.LOCAL\DR" # "DOMAIN.LOCAL\PRINTERS"
┌─[root@samba4]─[/FS]
└──╼ #ls -ld test\$/
drwxrwx---+ 6 root root 4096 Jun 25 15:44 test$/
ACL configuration:
cat /boot/config-4.4.0-87-generic | grep _ACL
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_REISERFS_FS_POSIX_ACL=y
CONFIG_JFS_POSIX_ACL=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_FS_POSIX_ACL=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_HFSPLUS_FS_POSIX_ACL=y
CONFIG_JFFS2_FS_POSIX_ACL=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFS_ACL_SUPPORT=m
CONFIG_CEPH_FS_POSIX_ACL=y
CONFIG_CIFS_ACL=y
CONFIG_9P_FS_POSIX_ACL=y
My fstab:
UUID=4ec48dfe-c45d-124b-8145-09fe59cfad9b /FS ext4 relatime,acl,user_xattr,errors=remount-ro 0 1
In samba.log I see a problem with acl permissions while I try to change permissions to test directory.
set_nt_acl: failed to set file acl on file test (Operation not permitted).
Also I change permission on test directory to 777 and delete options "create mask", "directory mask", "admin users". Now I can't even add a new user to file permission.
Vladyslav Greyswandir
(21 rep)
Jun 26, 2018, 08:23 AM
• Last activity: Aug 1, 2025, 11:04 AM
0
votes
1
answers
1925
views
How to set selinux labels for a folder hierarchy accessed server side by NFS, Apache, and SaMBa daemons simultaneously?
The Mandatory Access Controls or MAC labels are different for NFS which are different for httpd, and different yet again for SaMBa. What is the proper way nowadays to label a SINGLE shared filesystem hierarchy on the server such that it is properly re-labelled by restorecon, can be accessed successf...
The Mandatory Access Controls or MAC labels are different for NFS which are different for httpd, and different yet again for SaMBa. What is the proper way nowadays to label a SINGLE shared filesystem hierarchy on the server such that it is properly re-labelled by restorecon, can be accessed successfully server-side by all three services, and survives system updates?
In other words, when the server side fs hierarchy is labelled for sharing over NFS, then that breaks access by httpd and smb daemons on the same server. If labelled for httpd, then NFS and SMB services stop sharing because the files are labelled httpd only, so are denied rw. And finally, SMB Labels break both NFS and httpd services.
Is their a modern devops approach to this such as an Ansible playlist? I had made custom labels before but having to remake them after system updates caused too much friction. Wondering if custom labels are still the way, but now with automation?
rjt
(387 rep)
Jan 1, 2020, 08:33 PM
• Last activity: Jun 22, 2025, 03:02 AM
6
votes
3
answers
67746
views
Mount NFS - "operation not permitted" in Proxmox container
I'm trying to mount a simple NFS share, but it keeps saying "operation not permitted". The NFS server has the following share. /mnt/share_dir 192.168.7.101(ro,fsid=0,all_squash,async,no_subtree_check) 192.168.7.11(ro,fsid=0,all_squash,async,no_subtree_check) The share seems to be active for both cli...
I'm trying to mount a simple NFS share, but it keeps saying "operation not permitted".
The NFS server has the following share.
/mnt/share_dir 192.168.7.101(ro,fsid=0,all_squash,async,no_subtree_check) 192.168.7.11(ro,fsid=0,all_squash,async,no_subtree_check)
The share seems to be active for both clients.
# exportfs -s
/mnt/share_dir 192.168.7.101(ro,async,wdelay,root_squash,all_squash,no_subtree_check,fsid=0,sec=sys,ro,secure,root_squash,all_squash)
/mnt/share_dir 192.168.7.11(ro,async,wdelay,root_squash,all_squash,no_subtree_check,fsid=0,sec=sys,ro,secure,root_squash,all_squash)
The client 192.168.7.101 can see the share.
$ sudo showmount -e 192.168.7.10
Export list for 192.168.7.10:
/mnt/share_dir 192.168.7.101
192.168.7.101 's mount destination:
# ls -lah /mnt/share_dir/
total 8.0K
drwxr-xr-x 2 me me 4.0K Aug 28 19:21 .
drwxr-xr-x 3 root root 4.0K Aug 28 19:21 ..
When I try to mount the share, the client says "operation not permitted" with either
nfs
or nfs4
type.
$ sudo mount -vvv -t nfs 192.168.7.10:/mnt/share_dir /mnt/share_dir
mount.nfs: timeout set for Sun Aug 28 21:56:03 2022
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.7.10,clientaddr=192.168.7.101'
mount.nfs: mount(2): Operation not permitted
mount.nfs: trying text-based options 'addr=192.168.7.10'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.7.10 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.7.10 prog 100005 vers 3 prot UDP port 46169
mount.nfs: mount(2): Operation not permitted
mount.nfs: Operation not permitted
I've set fsid=0
and insecure
to the export options, but it didn't work.
RPCInfo from the client's side:
# rpcinfo -p 192.168.7.10
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100005 1 udp 59675 mountd
100005 1 tcp 37269 mountd
100005 2 udp 41354 mountd
100005 2 tcp 38377 mountd
100005 3 udp 46169 mountd
100005 3 tcp 39211 mountd
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100227 3 tcp 2049
100003 3 udp 2049 nfs
100227 3 udp 2049
100021 1 udp 46745 nlockmgr
100021 3 udp 46745 nlockmgr
100021 4 udp 46745 nlockmgr
100021 1 tcp 42571 nlockmgr
100021 3 tcp 42571 nlockmgr
100021 4 tcp 42571 nlockmgr
Using another client, *192.168.7.11*, I was able to mount that share with no issues.
I can not see any issue or misconfiguration, and could not find a fix anywhere.
There's no firewall in the way and both server and client are using Debian 11.
Any idea of what's going on?
markfree
(425 rep)
Aug 29, 2022, 01:32 AM
• Last activity: May 29, 2025, 04:46 PM
3
votes
2
answers
30314
views
How to make this Samba share accessible without any user/password login?
I have modified `/etc/samba/smb.conf` to create a `[public]` share: ``` [global] workgroup = WORKGROUP log file = /var/log/samba/log.%m max log size = 1000 logging = file panic action = /usr/share/samba/panic-action %d server role = standalone server obey pam restrictions = yes unix password sync =...
I have modified
___
PS: I created/mounted the shared folder like this:
/etc/samba/smb.conf
to create a [public]
share:
[global]
workgroup = WORKGROUP
log file = /var/log/samba/log.%m
max log size = 1000
logging = file
panic action = /usr/share/samba/panic-action %d
server role = standalone server
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
[public]
comment = Public Storage
path = /home/share
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no
and then I did:
sudo /etc/init.d/smbd restart
sudo smbpasswd -a pi # enter a password here
Unfortunately, when I access this shared folder from Windows, I need to enter a user/password login (see screenshot below).
**Question: how to make this Samba share accessible without any user/password login?**

sudo mkdir /home/share
sudo chown -R root:users /home/share
sudo chmod -R ug=rwx,o=rx /home/share
sudo mount /dev/sda1 /home/share
Basj
(2579 rep)
Nov 11, 2020, 06:11 PM
• Last activity: May 18, 2025, 03:16 PM
4
votes
2
answers
2429
views
unable to chmod inside shared folder of virtualbox
I have shared a folder from Windows on to my virtual machine. The shared folder is being mounted correctly, and I am able to read write within the folder, but unable to change permissions of any file within the shared folder. Below are the mount options of the shared folder myVM on /media/sf_myVM ty...
I have shared a folder from Windows on to my virtual machine.
The shared folder is being mounted correctly, and I am able to read write within the folder, but unable to change permissions of any file within the shared folder.
Below are the mount options of the shared folder
myVM on /media/sf_myVM type vboxsf (rw,nodev,relatime,ttl=0,iocharset=utf8,uid=0,gid=999,dmode=0770,fmode=0770,tag=VBoxAutomounter)
user is already part of vboxsf group
uid=1000(vmuser) gid=1000(vmuser) groups=1000(vmuser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare),999(vboxsf),1001(sftp)
Below error is thrown when try to change permissions using chmod for any files inside shared folder.
chmod: changing permissions of 'perm.txt': Operation not permitted
DarkKnight
(193 rep)
Oct 27, 2019, 02:09 PM
• Last activity: May 11, 2025, 02:02 PM
0
votes
1
answers
2028
views
shared folder in virtualbox guest debian 10 not showing files from linux mint host
I believe I have done everything all the manuals have said to get this to work, and have been struggling with it for a few days now. Here are the details of the setup: **Host:** Linux Mint 18.1 Serena, Ubuntu 5.4.0-6ubuntu1~16.04.4, 4.4.0-53-generic **Guest:** Debian GNU/Linux 10 (buster), 4.19.0-8-...
I believe I have done everything all the manuals have said to get this to work, and have been struggling with it for a few days now. Here are the details of the setup:
**Host:** Linux Mint 18.1 Serena, Ubuntu 5.4.0-6ubuntu1~16.04.4, 4.4.0-53-generic
**Guest:** Debian GNU/Linux 10 (buster), 4.19.0-8-amd64
**Virtualbox version:** 5.1.38_Ubuntu
**Guest Editions version:** 5.1.38
Guest Editions is installed in the guest, my user is part of the group vboxsf, in the gui of Virtualbox on the host, I selected a folder in the host home directory which I made called MintDebianSharedFolder and selected Auto-Mount, and gave the name to be seen by the guest MintDebianSharedFolder5. Now upon booting the guest (Debian 10):
cardamom@ruthenium:~$ sudo ls -la /media/
insgesamt 14
drwxr-xr-x 4 root root 4096 Mär 24 12:41 .
drwxr-xr-x 19 root root 4096 Mär 23 14:34 ..
lrwxrwxrwx 1 root root 6 Mär 23 13:19 cdrom -> cdrom0
dr-xr-xr-x 6 root root 2048 Mai 9 2018 cdrom0
drwxrwx--- 2 root vboxsf 4096 Mär 24 12:38 sf_MintDebianSharedFolder5
cardamom@ruthenium:~$ sudo ls -la /media/sf_MintDebianSharedFolder5/
insgesamt 8
drwxrwx--- 2 root vboxsf 4096 Mär 24 12:38 .
drwxr-xr-x 4 root root 4096 Mär 24 12:41 ..
There are in fact 2 files in the corresponding folder on the host - **Why are they not showing up in the guest?**
I created the second one just a moment ago on the host, but it is just not visible in the guest.
Here is the output of a few other commands on the Debian 10 guest which may help diagnose:
cardamom@ruthenium:~$ df
Dateisystem 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
udev 3354284 0 3354284 0% /dev
tmpfs 674824 9084 665740 2% /run
/dev/sda1 7578488 5697972 1475832 80% /
tmpfs 3374108 0 3374108 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 3374108 0 3374108 0% /sys/fs/cgroup
tmpfs 674820 20 674800 1% /run/user/1000
/dev/sr0 58214 58214 0 100% /media/cdrom0
cardamom@ruthenium:~$ mount | grep sf
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
cardamom@ruthenium:~$ sudo VBoxControl guestproperty get /VirtualBox/GuestAdd/SharedFolders/MountDir
Oracle VM VirtualBox Guest Additions Command Line Management Interface Version 5.1.38
(C) 2008-2018 Oracle Corporation
All rights reserved.
No value set!
cardamom@ruthenium:~$ lsmod | grep vboxguest
vboxguest 299008 4
cardamom@ruthenium:~$ cd /opt/VBoxGuestAdditions-*/init
cardamom@ruthenium:/opt/VBoxGuestAdditions-5.1.38/init$ ls
vboxadd vboxadd-service vboxadd-x11
cardamom@ruthenium:/opt/VBoxGuestAdditions-5.1.38/init$ sudo ./vboxadd setup
vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: Starting the VirtualBox Guest Additions.
vboxadd.sh: failed: modprobe vboxsf failed.
Any ideas much appreciated
cardamom
(662 rep)
Mar 24, 2020, 12:05 PM
• Last activity: Apr 25, 2025, 12:03 PM
0
votes
1
answers
42
views
smbclient store password for a specific host
I have a network folder in my LAN, I have installed smbclient to access it with the command smbclient //xxx.xxx.xxx.xxx/share_folder --user=share/user%password I can access it. But how can I store the password to don't have to type it ? edit: correction
I have a network folder in my LAN, I have installed smbclient to access it with the command
smbclient //xxx.xxx.xxx.xxx/share_folder --user=share/user%password
I can access it. But how can I store the password to don't have to type it ?
edit: correction
klatls
(33 rep)
Mar 29, 2025, 10:11 AM
• Last activity: Mar 29, 2025, 03:24 PM
3
votes
1
answers
187
views
exec cp failes from script, yet works when issued directly
I have a script that copies SQL backups to a windows server. Here's the line from /etc/fstab: //my.win.box/share$ /winshare cifs credentials=/etc/credfile,dom=mydomain,uid=0,gid=0,file_mode=0600,dir_mode=0700 0 0 Here's the backup script: backup.sh: # copy zipped sql exports to /winshare/db find /ba...
I have a script that copies SQL backups to a windows server. Here's the line from /etc/fstab:
//my.win.box/share$ /winshare cifs credentials=/etc/credfile,dom=mydomain,uid=0,gid=0,file_mode=0600,dir_mode=0700 0 0
Here's the backup script:
backup.sh:
# copy zipped sql exports to /winshare/db
find /backups/sql/*sql.gz -mtime +1 -exec cp {} /winshare/db \;
Logged in with root privileges (in this case, as root)
$ ./backup.sh
cp: cannot create regular file `/winshare/db/mydb_20130301.sql.gz': Permission denied
Yet if I issue the command from a prompt, rather than through the script:
$ find /backups/sql/*sql.gz -mtime +1 -exec cp {} /winshare/db \;
The file(s) are copied as expected. Again, logged in as root here.
What could be causing the in-script command to fail, yet the identical command to work from console?
a coder
(3343 rep)
Apr 23, 2013, 07:55 PM
• Last activity: Mar 14, 2025, 03:38 PM
3
votes
5
answers
7150
views
Share a local folder on LAN without Sambashare?
Sharing a folder on Windows is a trivial matter. Sharing a folder on linux appears to be done only using Sambashare. At least, every guide I've found is using this approach. It's quite terrible, requiring config files, user groups, additional packages etc. Is there a way to share a local folder with...
Sharing a folder on Windows is a trivial matter. Sharing a folder on linux appears to be done only using Sambashare. At least, every guide I've found is using this approach. It's quite terrible, requiring config files, user groups, additional packages etc. Is there a way to share a local folder without this program? Right now, it seems to be easier to upload things to the cloud to transfer files between two linux computers on a LAN.
CoderGuy123
(210 rep)
Jan 9, 2023, 08:13 AM
• Last activity: Feb 23, 2025, 11:22 PM
1
votes
1
answers
896
views
How to get write permissions on Linux host from Windows 10 guest, using virtiofs shared folders
I am trying to share a folder from an Ubuntu 20.04.3 host with a Windows 10 build 19042 (20H2) guest, using QEMU 5.2 / libvirt 7.0.0 on the host and virtio-win 0.1.208 (driver 100.85.104.20800 and associated virtiofs service) on the guest. So far I am able to read files in this host folder without p...
I am trying to share a folder from an Ubuntu 20.04.3 host with a Windows 10 build 19042 (20H2) guest, using QEMU 5.2 / libvirt 7.0.0 on the host and virtio-win 0.1.208 (driver 100.85.104.20800 and associated virtiofs service) on the guest.
So far I am able to read files in this host folder without problems from the guest. However I can only create/write/delete files if
1. I use a shell (Windows CMD or Cygwin bash) with *Administrator* rights on the guest
OR
2. I change the folder permissions on the host, giving write permissions to "other".
Neither of these options is acceptable as a permanent solution.
I already toyed with various settings for "user" in /etc/libvirt/qemu.conf, including root and the user owning the shared folder (myself), without success. I do struggle to understand what ultimately determines the write permissions on the host folder. I had assumed this to be related to the UID of one of the hypervisor processes, so I do not see why running as Administrator or not on the guest should make a difference.
Can anyone shed some light on this? Has anyone been more succesful?
For info: The relevant section of the QEMU domain configuration looks like this:
virtiofs requires accessmode='passthrough'
.
ohrenbaer
(11 rep)
Oct 23, 2021, 02:52 PM
• Last activity: Jan 7, 2025, 03:00 PM
3
votes
2
answers
657
views
Systemd service to start only after CIFS mount
I have a little home server (an old PC really) running a few services under Proxmox hypervisor, one of which is the qBittorrent server.  It is installed in a separate LXC container, on an Ubuntu 24.04 base system.  All downloads are saved on a separate local home-made P...
I have a little home server (an old PC really) running a few services
under Proxmox hypervisor, one of which is the qBittorrent server.
It is installed in a separate LXC container, on an Ubuntu 24.04 base system.
All downloads are saved on a separate local home-made PI-based NAS share that is mounted inside the qBittorrent container using CIFS in fstab, on
/mnt/Vault
.
My problem is, every time I need to restart the qBT container, the torrents will throw a "missing files" error, as, I think, the "qBittorrent-nox" service starts quicker than the NAS share gets mounted inside the container.
It seems simply a matter of the qBT service being faster than the mount –
and so it didn't find the necessary files in time.
Afterwards, when I check the mount, it is there,
so I can eliminate any mounting issues, other than not being fast enough.
So, is it possible to somehow define a condition in the qBT service file
to wait and start only after the mount is present?
Here is the service file:
[Unit]
Description=qBittorrent Command Line Client
After=network.target
[Service]
Type=forking
User=root
Group=qbittorrent-nox
UMask=007
ExecStart=/usr/bin/qbittorrent-nox -d --webui-port=8080
Restart=on-failure
[Install]
WantedBy=multi-user.target
I'm thinking the After
directive under the Unit
section,
but I'm not sure.
Somehow, I should maybe incorporate a response from fstab in there,
to confirm that all mounts were successful?
Any ideas how to put this in practice?
My Linux skills are limited, so I'll do my best to follow any proposals.
Radu Erdei
(131 rep)
Dec 22, 2024, 08:13 AM
• Last activity: Dec 22, 2024, 09:00 PM
6
votes
4
answers
9622
views
Delete files and folders recursively in subdirectories
There is a folder, "transfer". In that transfer folder there are user folders "user1", "user2", etc. I want to (periodically) delete the content (i.e. all files and folders in the user folders) but I do not want to delete the "transfer" or user folders. How can I do that using as shell script/comman...
There is a folder, "transfer". In that transfer folder there are user folders "user1", "user2", etc. I want to (periodically) delete the content (i.e. all files and folders in the user folders) but I do not want to delete the "transfer" or user folders.
How can I do that using as shell script/command without manually adding a call for each new user folder every time I add a new user?
Silicomancer
(225 rep)
Nov 12, 2019, 08:18 PM
• Last activity: Oct 22, 2024, 02:01 PM
1
votes
0
answers
604
views
autofs nfs share served and mounted on same PC reporting permission denied when writing
I am using nfs between multiple Debian 10 machines in my local network, with the same basic setting across the board, and they are all working as expected. I am using autofs as root to mount and unmount the nfs shares on each machine, also using the same basic settings everywhere. Users on each clie...
I am using nfs between multiple Debian 10 machines in my local network, with the same basic setting across the board, and they are all working as expected.
I am using autofs as root to mount and unmount the nfs shares on each machine, also using the same basic settings everywhere. Users on each client machine can access the mounted shares because they are owned by
nobody:nogroup
.
So far, I have always been mounting shares from a server machine on a client machine, with no issues. So two separate machines.
I am now attempting to mount a share served from a machine by using autofs on the same machine. So server and client on the same machine.
autofs is mounting the share without issues, and non-root users can list folder contents and view files no problem, but when non-root users attempt to write to the share, they get "permission denied":
$ touch test.file
touch: cannot touch 'test.file': Permission denied
$ echo "content" > test.file
bash: test.file: Permission denied
This happens whether I use 127.0.0.1 on loopback or 192.168.x.y on ethernet or wifi interface to access the share. Other machines use autofs to mount these same shares with the same settings without issue and this machine similarly use autofs to mount shares from other machines using the same settings again without issue.
These are the nfs server settings:
$ sudo exportfs -v
/exports/share 127.0.0.1/32(rw,wdelay,root_squash,all_squash,sec=sys,rw,secure,root_squash,all_squash)
/exports/share 192.168.0.0/16(rw,wdelay,root_squash,all_squash,sec=sys,rw,secure,root_squash,all_squash)
These are the autofs settings, which are loaded via a master map in another file:
$ cat /etc/auto.shares
share_loopback -fstype=nfs4,rw,retry=0,hard,noac,noexec,proto=tcp 127.0.0.1:/exports/share
share_network -fstype=nfs4,rw,retry=0,hard,noac,noexec,proto=tcp 192.168.x.y:/exports/share
When a user manually mounts the same nfs share on the same machine using the same basic settings, everything works fine, without permission problems.
$ sudo mount -t nfs4 -o rw,hard,noac,noexec,proto=tcp 127.0.0.1:/exports/share /media/share_loopback
$ sudo mount -t nfs4 -o rw,hard,noac,noexec,proto=tcp 192.168.x.y:/exports/share /media/share_network
It seems like autofs under the hood is doing something differently than when I mount manually.
So what is causing this mount through autofs to report "Permission denied", and how can I get it to work?
tompi
(292 rep)
Aug 1, 2021, 09:18 PM
• Last activity: Oct 18, 2024, 11:52 AM
14
votes
6
answers
191605
views
mount error(115): Operation now in progress
I'm having an issue **mounting a shared NAS drive that is hosted on a Windows 2000 server**. This is a drive that I'm certain I have access to, and I frequently access it from a Windows 7 machine and a Windows Server 2008 machine. Now, **I'm attempting to mount this drive from a RHEL7 machine**, but...
I'm having an issue **mounting a shared NAS drive that is hosted on a Windows 2000 server**. This is a drive that I'm certain I have access to, and I frequently access it from a Windows 7 machine and a Windows Server 2008 machine. Now, **I'm attempting to mount this drive from a RHEL7 machine**, but I'm having some issues.
**What I've done:**
mkdir /mnt/neededFolder
mount -t cifs //DNS.forMyDrive.stuff/neededFolder /mnt/neededFolder -o username=myUserId,password=myPassword,domain=myDomain
**What I expected:**
I expected to be able to access the folder at */mnt/neededFolder*
**What actually happened:**
The error I'm receiving (partially shown in the subject line here) is
mount error(115): Operation now in progress
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
**What the log says:**
**dmesg** output:
[1712257.661259] CIFS VFS: Error connecting to socket. Aborting operation.
[1712257.662098] CIFS VFS: cifs_mount failed w/return code = -115
We can all see that there is a connection issue, that is obvious. I know both machines are connected to the network. **What can I try next to get this drive mounted?**
**EDIT:** It may be worth noting that I am able to ping the DNS name and the raw IP of the remote location that I am trying to mount.
Joshua Schlichting
(461 rep)
Jul 18, 2018, 01:41 PM
• Last activity: Aug 30, 2024, 09:10 PM
0
votes
1
answers
37
views
Sending files/deirectories from a local Unix machine to a remote Unix server
How do I send files or directories to my school's remote server from my Ubuntu desktop? I have tried everything from YouTube, and everything keeps on giving me a lost connection when I try to run the command. This is the command I tried: scp filename username@ipaddress:/users/students/username
How do I send files or directories to my school's remote server from my Ubuntu desktop? I have tried everything from YouTube, and everything keeps on giving me a lost connection when I try to run the command.
This is the command I tried:
scp filename username@ipaddress:/users/students/username
Beakal Begashaw
(3 rep)
Oct 29, 2020, 04:28 PM
• Last activity: Jan 31, 2024, 06:50 AM
0
votes
1
answers
1141
views
How to share user permission across different servers and NFS folders?
I have a 3 different servers running Ubuntu 20. One of them is configured as the NFS host, and the other two as clients. The clients can mount the NFS shared folders and can write content on it `sudo touch foo.txt`. On the client servers, I have a wget process mirroring a website. I want my two clie...
I have a 3 different servers running Ubuntu 20. One of them is configured as the NFS host, and the other two as clients. The clients can mount the NFS shared folders and can write content on it
sudo touch foo.txt
.
On the client servers, I have a wget process mirroring a website. I want my two clients servers to output the files from wget to /nfs/shared
folder. On both servers, the process is executed like www-data user wget (...) -o /nfs/shared
.
None of the servers can write into the folder due to permission denied
. Reading other questions here it seems like my users must have the same UUID
to make sure the permission mask works properly.
My question:
- How can I maintain a list of users common across my n
servers to make sure all of them can write into /nfs/shared
?
Javi M
(13 rep)
Jan 15, 2024, 09:44 AM
• Last activity: Jan 15, 2024, 10:20 AM
3
votes
3
answers
17601
views
Determine SMB shares I have read and/or write access to
For a series of targets (IPs), Id like to determine which SMB shares my account has no access to, which it has read access to, and which it has read/write access to. Currently I am using smbclient. The command I run first is smbclient -L [targetIP] -U [user] -p 445 This gives me a list of shares. Fo...
For a series of targets (IPs), Id like to determine which SMB shares my account has no access to, which it has read access to, and which it has read/write access to.
Currently I am using smbclient. The command I run first is
smbclient -L [targetIP] -U [user] -p 445
This gives me a list of shares. For example;
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
IPC$ IPC Remote IPC
print$ Disk Printer Drivers
MySecrets Disk
I then can connect to a file share with this command
smbclient //[target]/[name_of_share_from_list] -U [user] -p 445
Which results in an SMB prompt. From the prompt I type
ls
and if I see files I know I have read access. I'm guessing I have to push a file to see if I have write access.
This is tedious. How do I automate this such that for the given list of targets, I get a list of all shares, and the level of access my account has to them?
n00b
(145 rep)
May 26, 2017, 12:09 AM
• Last activity: Jan 12, 2024, 11:54 AM
0
votes
1
answers
322
views
How to share folders between Debian (host) Win11 (guest)
I have the reverse of this situation - https://unix.stackexchange.com/questions/747819/how-to-share-folders-between-win11host-and-debianguest Debian Buster, Windows 11, Virtualbox 7 Without the Windows 11 VM booted up, I clicked **Settings > Shared Folders > Machine Folders > Add Share** Then select...
I have the reverse of this situation -
https://unix.stackexchange.com/questions/747819/how-to-share-folders-between-win11host-and-debianguest
Debian Buster, Windows 11, Virtualbox 7
Without the Windows 11 VM booted up, I clicked
**Settings > Shared Folders > Machine Folders > Add Share**
Then select the folder on the Linux host that I want to share with the mouse.
Then I click "auto mount" and under Mount Point write :
C:\Users\vboxuser\Desktop\SharedFolder
..but when I boot up the VM into Windows 11, the shared folder is not there.
Any ideas what I am doing wrong or forgetting?
cardamom
(662 rep)
Jan 9, 2024, 07:32 PM
• Last activity: Jan 11, 2024, 07:56 PM
1
votes
1
answers
719
views
Issue mounting a network drive using fstab
I'm having a bit of a mare at the moment: I recently rebooted my host server, any my Ubuntu server 20.04 server was unable to mount a network drive again. I had a small issue where the `systemd-resolved` service wasn't running properly, but I was able to get that sorted. But it still doesn't want to...
I'm having a bit of a mare at the moment:
I recently rebooted my host server, any my Ubuntu server 20.04 server was unable to mount a network drive again. I had a small issue where the
systemd-resolved
service wasn't running properly, but I was able to get that sorted.
But it still doesn't want to mount the network drive.
The mount point definitely exists
ldadmin@LD-DOCKER01:~$ ls /mnt/
plex_data plex_media vuetorrent
Here's my fstab file
ldadmin@LD-DOCKER01:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
//10.11.10.10/media /mnt/plex_data cifs vers=3.0,credentials=/home/ldadmin/SMBCreds/Media,iocharset=utf8 0 0
# / was on /dev/ubuntu-vg/ubuntu-lv during curtin installation
/dev/disk/by-id/dm-uuid-LVM-dKtbpdhrXBO21N1jbjxfSX0xwSKAPf3uvec11xtX4odywT1Q47kYZmxyvw0eQ7ap / ext4 defaults 0 1
# /boot was on /dev/sda2 during curtin installation
/dev/disk/by-uuid/5dbadd90-cf4b-4cec-8b4b-ac149a5cd306 /boot ext4 defaults 0 1
# /boot/efi was on /dev/sda1 during curtin installation
/dev/disk/by-uuid/1400-9711 /boot/efi vfat defaults 0 1
/swap.img none swap sw 0 0
#//192.168.1.100/vuetorrent mnt/vuetorrent cifs vers=3.0,credentials=/home/ldadmin/SMBCreds/.Media,iocharset=utf8 0 0
Trying to re-map the network drive
ldadmin@LD-DOCKER01:~$ sudo mount -a
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
Permissions on the local mount point
ldadmin@LD-DOCKER01:~$ ls -l /mnt/
total 12
drwxr-xr-x 2 root root 4096 Nov 12 17:28 plex_data
drwxr-xr-x 2 root root 4096 Oct 1 19:32 plex_media
drwxr-xr-x 2 root root 4096 Oct 1 20:11 vuetorrent
I'm not terribly well versed in Linux, so I'm not sure where I should be looking to get some more specifics.
So far I've tried manually mounting the network drive with
ldadmin@LD-DOCKER01:~$ sudo mount -t cifs -o username=*USERNAME*,password=*PASSWORD* //10.11.10.10/media /mnt/plex_data//10.11.10.10/media /mnt/plex_data
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
I've also removed and recreated the mount point, reinstalled cifs-utils, tried mounting to another folder in /mnt/
I am able to ping the server where the network share is located as well.
Verified that I can access/mount that share from a different windows machine.
Thanks in advance!
fbarker92
(11 rep)
Nov 12, 2022, 06:35 PM
• Last activity: Dec 18, 2023, 11:31 AM
5
votes
4
answers
52795
views
Where to find the shared folder in Kali Linux?
I use *Kali Linux* as a virtual machine in *VMware Workstation Player* with *Windows 10 Home* as host. The *Player* has the option to pick a *Windows* folder to be used as a shared folder. I set this up, it says it's enabled, but in *Kali Linux* this shared folder should be present in `/mnt/hgfs`. `...
I use *Kali Linux* as a virtual machine in *VMware Workstation Player* with *Windows 10 Home* as host.
The *Player* has the option to pick a *Windows* folder to be used as a shared folder.
I set this up, it says it's enabled, but in *Kali Linux* this shared folder should be present in
/mnt/hgfs
. /mnt
exists, but is empty. I'm stuck here.
Petoetje59
(207 rep)
Jun 20, 2020, 07:17 PM
• Last activity: Dec 15, 2023, 07:36 AM
Showing page 1 of 20 total questions