I am able to execute all the by using the prefix sudo. As of now I was able to remove the password dependency for user qedbuser.

I would like to not use the word sudo. One my application is trying to save a file in CIFS (SMB) file system. This has been mounted in the local. Every time I run the application. I am getting a error message permission is denied.

  1. Is there a way to not use the key word sudo?
  2. Is there a way to save and create files in the mounted location without using the key word sudo?

Note: I have logged in as domain user.

The following are the privileges for the folder

drwxr-xr-x 2 root root 0 Mar 22 16:00 archives

This is a mounted folder and this was mounted using command:

sudo mount -t cifs -o username=qedbuser,password=****,domain=EUR // /home/local/EUR/qedbuser/nb/aa/archives/
  • sudo is a utility, not a keyword in the shell. You can't omit using sudo to run things as another user. – Kusalananda Mar 22 at 10:19
  • root doesn't mix well with NFS (root can write to NFS of course, but remote NFS server must allow it), have you tried as normal user ? are both local user id and user id on NFS server same ? – Archemar Mar 22 at 10:29
  • both the local user and user id on NFS is the same. – user_xtech007 Mar 22 at 10:32
  • 1
    yes but sudo by default will make you root, and root by default is denied from writing to NFS mount point. – Archemar Mar 22 at 10:34
  • 1
    Does your application run as user qedbuser? – roaima Mar 22 at 10:45

Your mount command is missing the noperm option. What this does is tell the client to check the username/group against the synthetic ownerships, which in your case are root and root. By specifying noperm the permissions check is deferred to the server.

The man page for mount.cifs writes,

perm Client does permission checks (vfs_permission check of uid and gid of the file against the mode and desired operation), Note that this is in addition to the normal ACL check on the target machine done by the server software. Client permission checking is enabled by default.

noperm Client does not do permission checks. This can expose files on this mount to access by other users on the local client system. It is typically only needed when the server supports the CIFS Unix Extensions but the UIDs/GIDs on the client and server system do not match closely enough to allow access by the user doing the mount. Note that this does not affect the normal ACL check on the target machine done by the server software (of the server ACL against the user name provided at mount time).

This mount command should work better for you without the need to use sudo for your application:

sudo mount -t cifs -o username=qedbuser,password=****,domain=EUR,noperm // /home/local/EUR/qedbuser/nb/aa/archives/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.