LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-20-2016, 10:08 AM   #1
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Not able to move a file to /tmp, file command shows no read permission


Have a developer bring something to my attention.

Have a file cmake-2.8.10.2.tar.gz and he has discovered he can't move it to his home directory, it currently lives under

Code:
/orthanc/Programs/Downloads
Code:
[root@server Downloads]# ls -al cmake-2.8.10.2.tar.gz
-rw-r--r--. 1 root root 5768373 Feb 24  2014 cmake-2.8.10.2.tar.gz
[root@server Downloads]#
If I chmod u+x and then try to move the file, say to /tmp, this is what I get:

Code:
[root@server Downloads]# chmod u+x cmake-2.8.10.2.tar.gz  ; cp -i cmake-2.8.10.2.tar.gz /tmp
cp: cannot open `cmake-2.8.10.2.tar.gz' for reading: Permission denied

Looking at file/stat command

Code:
[root@server Downloads]# file cmake-2.8.10.2.tar.gz ; stat cmake-2.8.10.2.tar.gz
cmake-2.8.10.2.tar.gz: writable, executable, regular file, no read permissions
  File: `cmake-2.8.10.2.tar.gz'
  Size: 5768373         Blocks: 11272      IO Block: 4096   regular file
Device: fd12h/64786d    Inode: 402469      Links: 1
Access: (0744/-rwxr--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2016-09-20 10:01:35.710776725 -0500
Modify: 2014-02-24 11:17:52.811790222 -0600
Change: 2016-09-20 10:01:35.675778704 -0500
[root@server Downloads]#
I've never seen the no read permissions, even with root as the user/group owning the file and chmod for the user is set to 777.

I can't even move this to a Windows 7 desktop so I could try a few other tools to look at the file.

We have anti-virus on this server, however nothing has been flagged at this time and I've alerted the team to dig deeper to see what they can see.

I don't see any odd processes running on the server via top

Some of the research online seems to point to a virus. Other things that I've read is that one of the files within the package maybe compromised.

Was wondering if others have seen this before?

thanks

Last edited by JockVSJock; 09-20-2016 at 10:20 AM.
 
Old 09-20-2016, 11:45 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by JockVSJock View Post
Code:
[root@server Downloads]# chmod u+x cmake-2.8.10.2.tar.gz  ; cp -i cmake-2.8.10.2.tar.gz /tmp
cp: cannot open `cmake-2.8.10.2.tar.gz' for reading: Permission denied
this has nothing to do with /tmp, since the file resides elsewhere.
 
Old 09-20-2016, 11:47 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by JockVSJock View Post
Have a developer bring something to my attention.

Have a file cmake-2.8.10.2.tar.gz and he has discovered he can't move it to his home directory, it currently lives under

Code:
/orthanc/Programs/Downloads
Code:
[root@server Downloads]# ls -al cmake-2.8.10.2.tar.gz
-rw-r--r--. 1 root root 5768373 Feb 24  2014 cmake-2.8.10.2.tar.gz
[root@server Downloads]#
erm.
why do you say it lives under...
then your prompt tells a different story?
 
Old 09-20-2016, 12:01 PM   #4
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Quote:
Originally Posted by JockVSJock View Post
Code:
[root@server Downloads]# ls -al cmake-2.8.10.2.tar.gz
-rw-r--r--. 1 root root 5768373 Feb 24  2014 cmake-2.8.10.2.tar.gz
[root@server Downloads]#
I'm going to assume this is a cut-and-paste, so it's a direct quotation of the terminal's contents.

The thing which pops out to me is the "." after -rw-r--r--

I don't know what the "." means, but it's odd and out of place to me.
 
Old 09-20-2016, 01:38 PM   #5
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by IsaacKuo View Post

The thing which pops out to me is the "." after -rw-r--r--

I don't know what the "." means, but it's odd and out of place to me.
The "." means SELinux is enabled.
 
Old 09-20-2016, 01:40 PM   #6
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by ondoho View Post
this has nothing to do with /tmp, since the file resides elsewhere.
Right, it lives under one directory, however I can't even move it to /tmp.
 
Old 09-20-2016, 02:00 PM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Is this directory on a local disk, or is it on some networked filesystem?
 
Old 09-20-2016, 03:00 PM   #8
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by rknichols View Post
Is this directory on a local disk, or is it on some networked filesystem?
This directory is an LVM, which lives on SAN.
 
Old 09-20-2016, 04:17 PM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by JockVSJock View Post
Have a developer bring something to my attention.

Have a file cmake-2.8.10.2.tar.gz and he has discovered he can't move it to his home directory, it currently lives under

Code:
/orthanc/Programs/Downloads
...
If I chmod u+x and then try to move the file, say to /tmp, this is what I get
Why not just move it to where the dev needs it? Why the extra stuff?
mv, chown/attr and done.

It's like stepping over a dollar to pick up a nickel.
 
Old 09-20-2016, 04:52 PM   #10
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by Habitual View Post
Why not just move it to where the dev needs it? Why the extra stuff?
mv, chown/attr and done.
That's what started this. He tried to move the .tar.gz to his home directory and can't do it. He even used sudo to try and move it and it didn't work.
 
Old 09-21-2016, 02:59 AM   #11
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
my previous posts were a little confused and out of focus.

which probably is a direct result of the permissions-related mess you are in.

my suspicion is that you (or someone else) are doing things as root that should be done as user.
why else would the file be in a user's directory, but owned by root?
 
Old 09-21-2016, 05:59 AM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by JockVSJock View Post
That's what started this. He tried to move the .tar.gz to his home directory and can't do it. He even used sudo to try and move it and it didn't work.
So, you gave root to a DEV?
You need Sudo - You're doing it wrong

Turn in your toaster.

Last edited by Habitual; 09-21-2016 at 06:00 AM.
 
Old 09-21-2016, 06:56 AM   #13
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by JockVSJock View Post
The "." means SELinux is enabled.
Use ls -Z to see the details.

ls(1)

Code:
       -Z, --context
              print any security context of each file
 
Old 09-21-2016, 07:42 AM   #14
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by Habitual View Post
So, you gave root to a DEV?
You need Sudo - You're doing it wrong

Turn in your toaster.
The file that we can't move is tied to 3rd party imaging software.

The DEV, used to be a sys admin, however as time has gone by, his role has become more DEV and less sys admin and I'm now the sys admin.

My toaster was turned in along time ago...with the cord cut...
 
Old 09-28-2016, 02:35 PM   #15
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 421

Rep: Reputation: 74
SELinux enabled? Please post

ls -lZ <file name>

then grep either the <filename> on /var/log/audit/audit.log (this is distro-dependent) and look for any denied entries. We can go from there.

With SELinux, even root is restricted to do various things without modifying contexts and rules. I think this is the case.
 
  


Reply

Tags
no read permissions, virus



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
Dumping master file: tmp-q05vQjwQ18: open : permission denied To learn Linux - Newbie 1 09-06-2016 12:35 AM
[SOLVED] Can't read lock file tmp .x0-lock xinit: stale nfs file handle everal Slackware 2 10-31-2011 07:11 AM
File Permission - Read an execute only file e_x_p Linux - Security 1 12-16-2009 07:08 AM
how do i get permission to move file into directory timalan SUSE / openSUSE 2 08-24-2005 09:25 PM
Create file using 'touch ./tmp.$$', file tmp.3941 is created, why? huangyanfeng Linux - General 1 04-13-2004 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:59 PM.

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