Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you have no other means of setting permissions then if you would want to do something like that it should be along the lines of doing 'find /var -type d -print0|xargs -0 -iD chmod 0755 'D'; find /var -type f -print0|xargs -0 -iF chmod 0644 'F';'.
Quote:
Originally Posted by san_to_all
rpm --setperms filesystem-2.4.19-1.fc10.i386
and response was sh: -line 1: syntax error near unexpected token ')'
sh: -line 1: '[ -L '/'] || chmod t a number) '/''
Of course dv502's FUP post makes things easier but running 'rpm --setperms filesystem' should work (I'll not going into under-the-hood details about how this works) but in case it still doesn't work for you you can try the manual version of the same (an adaptation of this old post) but only addressing the filesystem package and nothing under /usr/(.*/)share:
Run and review the command, then remove the "echo" statement to execute.
* Whatever procedure you choose, after you're done running 'rpm -Vva|grep "^\.\{8\}";' should show any entities with other attributes to correct.
** While the reflex of re-installing from scratch may prove to be faster in some cases I hope this shows that it is not always necessary and also showcases the merits of using a mature, full-featured, easy-usable package management system.
I tried first dv502 suggestion but it shows same error recursiverly with only directory name changed.
Then I tried unSpawn's suggestion but running command
-----------
chmod 0755 / /bin /bin/*sh* /bin/rpm /var /var/lib /var/lib/rpm; chmod 0644 /var/lib/rpm/*
rpm -q --dump filesystem | grep -v share/ | awk '{print $5, %1}' | while read MODE ENTITY; do
MODE=${MODE:2:6}; echo "chmod ${MODE//207/07} ${ENTITY}"
done
------------
showed the prompt like this
>
and waits for additional command.
Resetting file permissions seems to be not working. Can I copy my data directory into pendrive or send it to windows filesystem? because I am able to reach within that directory and could check the file size.
Hi, Unspawn
Just before your last post I tried
chmod 777 /
chmod 777 /var
chmod 777 /var/www
and linux started very well. I backed up my all data.
Only problem is that,it starts in single user mode, shutdown button is unavailable, windows filesystem and dvd drive is not mounting and few programs don't run saying insufficient file permissions.
-----------
I ran code from your last post.
rpm -q --dump filesystem | grep -v share/ | awk '{print $5, $1}' | while read MODE ENTITY; do
-------------
but it shows the same promt
>
----------------
There is no question of quiting when people like you and dv502 and lots of other Linux community people out there to help others!
777 is a is insecure permission setting for a root filesystem. 755 would be a better choice.
Quote:
Originally Posted by san_to_all
-----------
I ran code from your last post.
rpm -q --dump filesystem | grep -v share/ | awk '{print $5, $1}' | while read MODE ENTITY; do
-------------
but it shows the same promt
>
Did you ran the code exactly as above?
The code above is a line replacement. It is suppose to be run with the complete script that unSpawn gave you.
That's why I ask if he had run the code that way, because it is wrong. It is a line replacement for the script.
What concerns me is he uses the permission setting of 777 for the root filesystem.
Just in case unSpawn's script doesn't work or runs into more errors and san_to_all doesn't want to re-install, or better yet upgrade to fedora 13, san_to_all should at least chmod the root filesystem to 755 which is more secure than 777.
Hi,
dv502
Yes it was my mistake, sorry for that.
Now I run the code with full script. When I run the code with echo command it shows all directory in root with permisstions.
-------------------
chmod 0755 /
chmod 0755 /bin
-------------------
And when I run code without echo command response was
-----------------
bash: chmod 0755 /: No such file or directory
bash: chmod 0755 /bin: No such file or directory
-----------------
(with all directory in root)
Then I tried as you said
chmod 755 /
command run successfully. But there is no change single user mode or other problem which I described in my last post.
I haven't started linux in single user mode now.
It was normal boot process.
In your last post, you said your system still starts at single user mode.
Can you look for a line in your /etc/inittab like below.
id:5:initdefault:
Depending on the distro, the number in bold can be 2,3 or 5.
If the number is 1, that is single user mode. You'll need to change it.
Here is an excerpt of my inittab file which describes the runlevels.
Note: Some linux distros will have their own runlevel system.
# Default runlevel. The runlevels used by PCLinuxOS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:5:initdefault:
I think I am wrong to say I am in single user mode.But sure, I messed up something with permissions,and I don't remember now exactly.
For me most important thing was my data. and I could backed it up just because all of you guys. Thank's for supporting me.
I'am going to upgrade to F13.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.