LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-10-2023, 11:29 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,569

Rep: Reputation: 177Reputation: 177
/srv/tomcat/bin/tomcat-juli.jar (Permission denied)


This is another simple problem I'm stuck figuring out. I'm trying to compile a java program:
Code:
javac testMYSQL.java
error: error reading /srv/tomcat/bin/tomcat-juli.jar; /srv/tomcat/bin/tomcat-juli.jar (Permission denied)
1 error
The permissions on that file are:
Code:
ls -l /srv/tomcat/bin/tomcat-juli.jar
-rw-r-x--- 1 root tomcat 46861 Feb 21  2022 /srv/tomcat/bin/tomcat-juli.jar*
My user is cwauser. I have:
Code:
$ grep cwauser /etc/group
tomcat:x:200:cwauser
So, the tomcat-juli.jar file has group read permission for group tomcat, and user cwauser is a member of the tomcat group.

So why is the permission denied?
 
Old 03-11-2023, 07:05 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,913

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
you need to check all the parent dirs up to / (if cwauser has right to read those dirs).
 
Old 03-11-2023, 10:44 AM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,569

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by pan64 View Post
you need to check all the parent dirs up to / (if cwauser has right to read those dirs).
I believe I did do that:
Code:
# ls -ld /srv/tomcat/bin
drwxrwxr-x 2 root tomcat 4096 Mar  3  2022 /srv/tomcat/bin/

# ls -ld /srv/tomcat
lrwxrwxrwx 1 root root 37 Mar  2 01:48 /srv/tomcat -> /user/util/src/apache-tomcat-10.0.17//

# ls -ld /user/util/src/apache-tomcat-10.0.17/
drwxr-xr-x 9 root root 4096 Mar  2 02:26 /user/util/src/apache-tomcat-10.0.17//

# ls -ld /srv
drwxr-xr-x 2 root root 4096 Mar  2 01:48 /srv/

# ls -ld /
drwxr-xr-x 24 root root 4096 Mar 11 00:59 //
The directory tree appears to give rx to everyone. My group file shows cwauser as a member of this group (original post). I cannot even 'cat /srv/tomcat/bin/tomcat-juli.jar >/dev/null' without the permission error.

This computer uses PAM. Could that have something to do with it?

Last edited by mfoley; 03-11-2023 at 10:47 AM.
 
Old 03-11-2023, 01:00 PM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,913

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
so there is a symlink in it. In that case you might need to check /user/util/src/apache-tomcat-10.0.17 too.
 
Old 03-17-2023, 11:46 PM   #5
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,569

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by pan64 View Post
so there is a symlink in it. In that case you might need to check /user/util/src/apache-tomcat-10.0.17 too.
I did do that as well. Permissions on /user/util/src/apache-tomcat-10.0.17 are shown in post #3. Beneath that directory:
Code:
$ ls -ld /user/util/src/apache-tomcat-10.0.17/bin
drwxrwxr-x 2 root tomcat 4096 Mar  3  2022 /user/util/src/apache-tomcat-10.0.17/bin/

$ ls -l /user/util/src/apache-tomcat-10.0.17/bin/tomcat-juli.jar
-rwxr-x--- 1 root tomcat 46861 Feb 21  2022 /user/util/src/apache-tomcat-10.0.17/bin/tomcat-juli.jar*
As shown in my op, cwauser (my user) is a member of the tomcat group.

While I'm at it:
Code:
$ ls -ld /user
drwxr-xr-x 3 root root 4096 Feb 25 13:41 /user/

$ ls -ld /user/util
drwxr-xr-x 4 root root 4096 Feb 25 17:34 /user/util/

$ ls -ld /user/util/src
drwxr-xr-x 6 root root 4096 Mar 11 01:18 /user/util/src/
Very puzzling.

Last edited by mfoley; 03-17-2023 at 11:50 PM.
 
Old 03-20-2023, 12:15 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,913

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
you might try:
Code:
strace -o /tmp/filename -f cat /srv/tomcat/bin/tomcat-juli.jar >/dev/null
and look for the error message in /tmp/filename
 
  


Reply

Tags
permission denied



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tried to install a .bin but "bash: ./CmapTools64.bin: Permission denied" Xime1008 Linux - Newbie 6 05-16-2011 06:24 PM
[SOLVED] /usr/bin/xterm: Could not exec /bin/bash: Permission Denied suheng Linux - Newbie 2 09-24-2010 05:31 PM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
ESI Juli@ ALSA support dirk_gently Linux - Hardware 0 08-18-2007 06:04 PM
Permission Denied while installing new jar library for my new application lavinal Linux - Software 1 09-02-2004 04:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration