LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   trouble changing permissions (https://www.linuxquestions.org/questions/linux-newbie-8/trouble-changing-permissions-264912/)

0perat0r 12-10-2004 11:49 AM

trouble changing permissions
 
I have a file that I've been trying to change the permissions on so that I can copy it from a floppy. I have changed the ownership and group, but I still cannot copy it. It is somehow protected. I tried changing the permissions using chmod, but I got the following result:

[root@redvaio floppy]# chmod u=rwx,g=rwx,o=rwx jobs
chmod: changing permissions of `jobs' (requested: 0777, actual: 0755): Operation not permitted

What does this message mean? Is there a way around this? Thanks in advance.

jeffreybluml 12-10-2004 11:52 AM

This may be a silly question, but is the floppy write protected? If not, then the issue may be in your /etc/fstab file. I'd check the floppy first though...

Oh, and to shorten up your command a little, you can do:

chmod ugo+rwx

Just FYI...

0perat0r 12-10-2004 12:00 PM

No, that's not a dumb question :) That's actually the first thing I checked, so it's not write protected. I cannot copy the file from the floppy to a Windows system either. The thing is, I have other files on there that I can copy, no problem. The file was created on a work computer, which I think has something to do with it. It's silly, because it's not like it is secret company information, or anything. It's actuall a word document with some job postings I got from Monster. I changed the file type to "all files" before I booted up Linux and tried it that way. I'm curious what the automount (/etc/fstab) has to do with it?

Thanks

jeffreybluml 12-10-2004 12:06 PM

I figured fstab may be setting the permissions wierd or something, perhaps making it owned by another user or whatnot. Although, if you can SEE the file, I don't know why it wouldn't let you COPY it, unless you were trying to erase it from the floppy as well. Now, if you were trying to paste the copied file into a directory to which you don't have write permissions, that would make sense. Howver, I doubt you're doing that...

Now, the execute permission has no effect on copying something, right? Just the read permission....correct?

Man, I guess I don't know why it's giving you this issue....sorry....

I'll think on it for a bit...

0perat0r 12-10-2004 12:19 PM

Thanks for your feedback. I copy files into this directory all of the time without difficulty. The contents of my fstabs is:

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

I used the su command in the terminal, to do all of the changes as root. Maybe the file is corrupted, but my suspicion is that it has been protected in some way. If I try to give anyone but the owner (i.e.: group, others) write permission through the Red Hat GUI, it does not work. It does not allow me to put a check in that box in the file properties. This is really strange (and frustrating). I appreciate your help.

jeffreybluml 12-10-2004 12:26 PM

Try changing the fstab entry to allow any user to mount/unmount etc...like this:

/dev/fd0 /mnt/floppy auto noauto,users,kudzu 0 0

Worth a shot anyways....

0perat0r 12-10-2004 01:11 PM

I tried that, and no dice. Thanks for the suggestion, anyway.

jeffreybluml 12-10-2004 01:17 PM

Geez!

Well, although in saying this I am admitting defeat, are you able to get another copy of the file and see if the one you're currently working with got corrupted somehow?

Sorry, wish I had more....

0perat0r 12-10-2004 01:39 PM

That's OK. It may be that the file is just somehow corrupted. I cannot get another copy because it is on a workstation at a job site where they ended my contract yesturday :) I'm curious if there is a way to lock down file permissions through a Windows policy or something... It's an interesting challenge, in any case. I tried manipulating the file on a Linux system because there's so much more control over permissions. More and more I am not liking Windows.

sonajiso 12-11-2004 01:45 AM

Another attempt - cheap, I may add
 
Before I start, I must let you know that I am new to Linux, and know very little about computers. Thus, what I write here will probably be useless.

You may have already done this, otherwise try:
- Login as root in a terminal
- Mount the floppy
- Now asume that you mounted the floppy into the directory /a/b/c/d
- chmod -R 777 /a/b/c/d - access to all, but recursively applies on the folder, that is contents of the floppy.
- May take a while........
- try reading the file you want

If this fails and you still want your file, you might be able to recover some of the data, but I must warn you, this method is as messy as dangerous and time consuming. Additionally, you might not be able to decypher any of the information - not because it is encrypted or something, but you will need to use a sharp tool to carve out the goodies from the corrupt filesystem (Aprox 4000 useful Bytes or whatever your file size is from 14000000 Bytes of 'garbage').So be adwised, do this at your own risk / pain - the dd ( for ddanger ) part in particular one typo can mean your system.
Still reading? That's the spirit! Here we go:

- Have root priviliges
- If your floppy device is /dev/floppy and your home directory is /home/0perat0r/, type
- dd if=/dev/floppy of=/home/0perat0r/floppy.img bs=512 count=2880
- Now hope grep - or some other tool you might use / develop ( find better ones or program one for this particular purpose for yourself [this last one is the Linux way] depending on how valuable your info is ) - can recover chunks of the data on the floppy.

A little clarification: using dd, following the above example you can take a raw image of your floppy disk - if it has no corrupt sectors, that is - and save this image in a single file - in the above example floppy.img in your home directory.
More on dd at man dd . Just to point out, if you do cat or vi on floppy.img you will be able to look at plain text so might be able to recover some of your Monster links just by looking at this dump - I mean the dump of the contents of your disk.

AGAIN, BE ABSOLUTELY REALLY VERY CAREFUL WHAT YOU DO WITH dd UNDER ROOT!!! It can make filesystems disappear! You probably do not want that.

I stop now, before I cause you to kill your system. Furthermore I do not want to confuse you too much
if you are uncertain what I have shown you here, please repply before continuing
Please feel free to ask me if you have any further questions.

channi97 07-24-2005 12:52 PM

sonajiso, if you know little about computers, I know less than nothing.

I have a similar question: I have successfully copied a file from a floppy into my home folder, but I would like to put it in the /usr/games or /usr/share folder.
The message is 'You do not have permission.'
As I am coming from Windows, I imagine there should be a way to log into the GUI as an adminstrator, to have all the privileges one can dream of.
I know how to log in as root in a terminal, but from then on I'm lost.

I have recently spent about two days trying to log into my linux installation after adding a harddrive, and this is too long for being useful.
Linux has still a long way to go to become as 'easy' to handle as Windows, and it will only be achieved if you can live with linux without command line. I would like to belong to the select few who can handle this (because they are not doing anything else but work with computers) but I can't afford the time.

Well, may be there is a good reason why it doesn't let me copy my file into /usr. It knows me better than I do.

maginotjr 07-24-2005 02:13 PM

I think linux can be hard as windows if you have never seen both before... but this is other discussion...

first you need to be root to copy something elsewhere that is not your home folde (/usr/games or /usr/share)

to login as root you just need to type root and the password at your login manager screen. Or you could login as root in the Console them run the application you want, eg: konqueror or nautilus or xffm and so on...

if you're login direct without any question about what user you want to go you may search in the forum about "changing automaticly login" or something like that...


---

Now about the floppy, try add the follow parameter on you fstab:
Code:


/dev/fd0 /mnt/floppy auto noauto,users,kudzu,rw 0 0

now umount and mount again to see what you get. I realy think you have some problem with your floppy, what is very normal, because you said you cant copy from windows too, and windows only have restriction if the floppy is write protected...

[ ]'s

tkedwards 07-24-2005 08:32 PM

Quote:

As I am coming from Windows, I imagine there should be a way to log into the GUI as an adminstrator
Umm.. have you tried loggin in as root from the login screen? This will work but its not ideal due to the ease with which you can mess-up your system.

The best way is to start the indivdual programs as root while logged in as yourself. So if you use KDE you can start a konqueror instance by going Menu->Run Command and typing 'kdesu konqueror'. You could also open a terminal, type 'su' type in the root password and then type 'konqueror' to get the same effect.

channi97 07-25-2005 03:50 AM

Thank you for your helpful advice, but...

It sounds so logical I wonder why I didn't think of it myself.
I tried, and

bash: nautilus: command not found

I also tried some other suggested programs, all with the same result.

What could the reason be for this?

By the way, I'm using Gnome Desktop.

channi97 07-25-2005 04:11 AM

And more:

I have tried again and discovered that

If I log in as su the promt looks like this:

linux: /channi/home #

I type in

nautilus

then I get:

bash: nautilus: command not found

but in the logout state the command line looks like this:

channi@linux~>

I type in

nautilus

and then nautilus starts, but of course without the root privileges.

How do I run nautilus as su?


All times are GMT -5. The time now is 04:00 AM.