Discussion:
Can't run script on server
(too old to reply)
Java Jive
2024-12-18 18:39:43 UTC
Permalink
I have a QNAP 241+ server running the latest firmware, which exports
linux shares under NFS, and a laptop running Ubuntu 22 which contains
the following line in /etc/fstab ...

IPAddress:/Path /media/servername nfs user,defaults,rw,noauto 0 0

... allowing the share to be mounted by clicking the desktop icon or in
the file explorer. My user credentials are identical on the two
machines, particularly the user and group ID numbers are identical,
EXCEPT, for the greater convenience of Windows clients, the actual
username itself is proper-cased on the Server to match those on the
Windows clients, whereas it has to be all lower case on the Ubuntu
client, while on the server the root account is called admin, but still
has user ID = 0. Please note carefully the following sequence:

***@hostname:Slides# ssh ***@servername
Enter passphrase for key '/home/username/.ssh/id_rsa':
[~] # cd /Path/Slides
[Slides] # ll *.sh
-rwxrwxr-x 1 admin admins 55 2024-12-18 15:16 SlidesBackUp.sh*
-rwxrwxr-x 1 admin admins 52 2024-12-18 15:16 SlidesBlink.sh*
[Slides] # ll -n *.sh
-rwxrwxr-x 1 0 1000 55 2024-12-18 15:16 SlidesBackUp.sh*
-rwxrwxr-x 1 0 1000 52 2024-12-18 15:16 SlidesBlink.sh*
[Slides] # grep admins /etc/group
admins:x:1000:admin,Username
[Slides] # grep Username /etc/passwd
Username:x:1002:1002:UserDescription,,,:/share/homes/Username:/bin/sh
[Slides] # exit
logout
Connection to servername closed.
***@hostname:Slides# ll *.sh
-rwxrwxr-x 1 root admins 55 2024-12-18 15:16 SlidesBackUp.sh*
-rwxrwxr-x 1 root admins 52 2024-12-18 15:16 SlidesBlink.sh*
***@hostname:Slides# ll -n *.sh
-rwxrwxr-x 1 0 1000 55 2024-12-18 15:16 SlidesBackUp.sh*
-rwxrwxr-x 1 0 1000 52 2024-12-18 15:16 SlidesBlink.sh*
***@hostname:Slides# grep admins /etc/group
admins:x:1000:root,username
***@hostname:Slides# grep username /etc/passwd
username:x:1002:1002:UserDescription,,,:/home/username:/bin/bash
***@hostname:Slides# which bash
/usr/bin/bash
***@hostname:Slides# cat SlidesBlink.sh
#!/usr/bin/bash
feh -Fds -A './SlidesBackUp.sh %F'
***@hostname:Slides# ./SlidesBlink.sh
bash: ./SlidesBlink.sh: Permission denied

Why can't I run the script? All the relevant credentials are identical
except the capitalisation of the username, but surely it should be using
in preference the numeric ids anyway?

A similar but related problem ...

Time was, when accessing a Windows share from a Linux machine, you could
use an smbusers file to translate between usernames on the two machines,
so that, if the passwords on the corresponding accounts were identical,
you wouldn't be prompted for credentials when accessing one from the other.

A typical smbusers file in its simplest form would read thus:

# This file allows you to map usernames from the clients to the server.
# Unix_name = SMB_name1 SMB_name2 ...
#
# Cf. section 'username map' in the manual page of smb.conf for more
# information.

!root = Administrator
username = Username
nobody = guest pcguest smbguest

This functionality doesn't seem to work any more. Can anyone suggest
how to make it work again?
--
Fake news kills!

I may be contacted via the contact address given on my website:
www.macfh.co.uk
Anssi Saari
2024-12-18 19:19:28 UTC
Permalink
Post by Java Jive
Why can't I run the script? All the relevant credentials are
identical except the capitalisation of the username, but surely it
should be using in preference the numeric ids anyway?
That 'user' mount option implies also option noexec.
Java Jive
2024-12-18 19:45:12 UTC
Permalink
Post by Anssi Saari
Post by Java Jive
Why can't I run the script? All the relevant credentials are
identical except the capitalisation of the username, but surely it
should be using in preference the numeric ids anyway?
That 'user' mount option implies also option noexec.
Tx. I was wondering about that, but searches didn't come up with much.
Is there anyway of allowing user mounts without noexec?
--
Fake news kills!

I may be contacted via the contact address given on my website:
www.macfh.co.uk
Carlos E.R.
2024-12-18 19:59:30 UTC
Permalink
Post by Anssi Saari
Why can't I run the script?  All the relevant credentials are
identical except the capitalisation of the username, but surely it
should be using in preference the numeric ids anyway?
That 'user' mount option implies also option noexec.
Tx.  I was wondering about that, but searches didn't come up with much.
Is there anyway of allowing user mounts without noexec?
exec :-)
--
Cheers, Carlos.
Java Jive
2024-12-18 20:01:37 UTC
Permalink
Post by Anssi Saari
Why can't I run the script?  All the relevant credentials are
identical except the capitalisation of the username, but surely it
should be using in preference the numeric ids anyway?
That 'user' mount option implies also option noexec.
Tx.  I was wondering about that, but searches didn't come up with much.
Is there anyway of allowing user mounts without noexec?
I've found the solution now. The following does it:

IPAddress:/Path /media/servername nfs user,defaults,exec,rw,noauto 0 0

Thanks for your help.
--
Fake news kills!

I may be contacted via the contact address given on my website:
www.macfh.co.uk
Loading...