LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-14-2013, 05:03 PM   #1
Gflames
LQ Newbie
 
Registered: Nov 2012
Location: Malawi
Posts: 25

Rep: Reputation: Disabled
file system permission is set to to read and write only


trying to improve my file permission security I typed the following command

#find / \( -type f -not -perm 0600 -exec chmod 0600 '{}' ';' \) -or \( -type d -not -perm 0700 -exec chmod 0700 '{}' ';' \)
I have tried changing the file permission settings of every file on the system to 0777,but still cant login using the X window and am failing to login as root user even in CMI mode
Am using Fedora15
 
Old 12-14-2013, 05:52 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Gflames View Post
trying to improve my file permission security I typed the following command

#find / \( -type f -not -perm 0600 -exec chmod 0600 '{}' ';' \) -or \( -type d -not -perm 0700 -exec chmod 0700 '{}' ';' \)
I have tried changing the file permission settings of every file on the system to 0777,but still cant login using the X window and am failing to login as root user even in CMI mode
Am using Fedora15
I'll refrain from any outright sarcasm (we've all done things we wish we hadn't!), but why would you think that would improve security in the first case?

So let's start with, "Don't do that!".

Because you did this for the entire filesystem, your best move would probably be to reinstall. Otherwise you will likely be stumbling over permission problems for a long time into the future and trying to sort them out individually will exhaust you and everyone on the forums!

I am not a Fedora user, but I think Fedora 15 is ancient as well, so maybe restart with a newer version. And read up on GNU/Linux filesystem basics and security along the way.

Last edited by astrogeek; 12-14-2013 at 06:13 PM.
 
Old 12-14-2013, 06:04 PM   #3
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
Gosh, after making every program in the system non-executable, I wonder why it wouldn't run. In all likelihood, full recovery will only be possible by re-installing. What you can try, though, is to boot from the installation medium in rescue mode (I presume that's how you've been trying to fix things), mount your full file system tree starting with the root on some temporary directory, and then try restoring the permissions thus:
Code:
rpm --root /mnt/tmpdir --setperms -a
That should restore the permissions on all files and directories that are owned by any package, but will not affect anything that any program created later when run, which of course would include all of your personal files.

As I indicated at the start, massive permission mixups are generally considered unrecoverable unless you have a complete backup. Even if you get the system to run again, you will find yourself continually running into strange problems caused by incorrect permissions (to say nothing of the security implications of all those mode 777 files you have now).

Last edited by rknichols; 12-14-2013 at 06:08 PM.
 
Old 12-14-2013, 06:30 PM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by Gflames View Post
I thought i was improving my files permission security by typing
#find / \( -type f -not -perm 0600 -exec chmod 0600 '{}' ';' ) -or \( -type d -not -perm 0700 -exec chmod 0700 '{}' ';' )
The system was down until
I tried to change the file permission of every file on the system to 0777, but now I cant login using the X-window neither am I able to run programs as a root
I am using Fedora 15
The find command above does the following:
  1. any regular file will be set to read/write by root only. Nothing can be executed anymore, even by root.
  2. any directory willbe set to read/write/execute by root only. Nobody but root can list any directory, create files in them or cd to them.

The easiest way to repair this is reinstallation. If there is some data you need to recover first, use a live DVD. Any live DVD, not only Fedora, is applicable.
 
Old 12-23-2013, 06:31 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You could try these cmds first http://www.cyberciti.biz/tips/reset-...ermission.html
If that doesn't work, re-install and DON'T fool around with settings like that again

Changing individual dirs/files that you understand completely is one thing, but blanket changes WILL break stuff, as you've discovered.

PS You could look into this later http://bastille-linux.sourceforge.net/

Last edited by chrism01; 12-23-2013 at 06:34 PM.
 
  


Reply



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
Read and Write a JFFS2 file system from WIndows PC xenorealm Linux - General 2 12-15-2010 06:39 PM
recursive write permission on cifs mounted file system mamunbabu2001 Linux - Newbie 2 05-18-2010 08:23 AM
Read Write for NTFS file system geeedeee Linux - Laptop and Netbook 8 06-05-2006 07:41 PM
set permanent read-write permission on shares Randall Slack Linux - Networking 1 10-30-2005 08:54 PM
Change from Read only to Read Write File System? justiceisblind Linux - Newbie 3 03-03-2002 07:23 PM

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

All times are GMT -5. The time now is 02:04 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