Read-only file on Linux

Silen -  
 Silen -
Hello,
I accidentally closed my rights on a folder of photos downloaded from a USB stick to my AAO, and I can no longer restore my ownership rights or access the photos inside the folder, which is marked with a small cross in the bottom right corner.

I am a beginner with Linux and I don’t yet master all the command lines; I tried xterm commands as root like cp, rm, mv, and every time it says 'folder name': no such file or directory.

How can I regain control over the folder and recover the photos?

A second question related to the first, how do I transfer folders from an external hard drive plugged into the AAO to another external hard drive also plugged into the AAO, as it doesn’t allow me to copy and paste the folders?
Thank you for your help
Silen
Configuration: Linux Fedora Firefox 2.0.0.14

8 réponses

Flachy Joe Posted messages 2303 Status Membre 261
 
Hello,
1. Use the chown command to change the owner of the file and the chmod command with the u+rw option to restore read-write permissions for the owner. These commands must be executed with administrative rights, so they should be preceded by sudo.

2. By default, NTFS (Windows) partitions are mounted as read-only, you need to install the ntfs-3g driver to be able to write to them.

Do some research and don't hesitate to ask questions if you get stuck.
Good luck.
--
;-) Flachy Joe ;-)
" There is no limit (sound, light, absolute zero, Pauli's exclusion principle) that the human mind cannot cross in a flawed calculation. " Unknown
0
Silen
 
Hello Flachy Joe,
Actually, I can't figure out what to do after I've launched xterm and entered my password after the command su -
What is the syntax so that the system points to the folder in question which is in the Documents folder of AAO?
Like:
chmod /folder name or chown /folder name?
Thanks for your Linux clarifications
0
Marc02 Posted messages 203 Registration date   Status Membre Last intervention   43
 
It's true that in the syntax of chown, I've often mixed up my pinglets.
One day I encountered the same issue and I bypassed the difficulty by starting a session with root as the user and in a graphical environment, opening the file manager, and through "properties," I checked the boxes to give all permissions to the file that had been locked until then.
0
Flachy Joe Posted messages 2303 Status Membre 261
 
It's exactly the thing not to do; by connecting as root on a graphical session, you launch a multitude of various utilities that will run with all the necessary rights to mess things up everywhere.

To get information about a command, type
man the_command

In short::
sudo chown user directory
and
sudo chmod u+rw directory


NB: it is not recommended to use the su command to start a root terminal session when the sudo utility is installed.
--
;-) Flachy Joe ;-)
My public PGP key is available in my profile.
0
Silen
 
Hi Flachy Joe,

if I understand correctly, when I launch xterm by pressing "alt f2"
I shouldn't type su - "confidential code"?
how do I activate sudo?
the folder in question is located on my disk, documents, and is called SudConnexion
there are photos normally inside, and I really want to recover them

what is the step by step syntax to follow to recover this file?!

thank you in advance, Linux users!
0
Flachy Joe Posted messages 2303 Status Membre 261
 
It's not easy step by step: you're the only one who knows the name of your folders...
[Alt+F2] xterm then:
cd path_to_disk sudo chown your_login the_folder # HERE IT ASKS FOR YOUR PASSWORD, IT'S NOT THE ROOT PASSWORD BUT YOURS sudo chmod -R u+rwx the_folder 
If it tells you
bash: sudo: command not found
then you can install sudo with
su apt-get install sudo exit 


--
;-) Flachy Joe ;-)
My public PGP key is available in my profile.
0
jeanbi Posted messages 15399 Registration date   Status Contributeur Last intervention   2 383
 
Hello,
he is on Fedora so apt-get install sudo is not right
yum install sudo is
and it's not enough to just install sudo, it also needs to be configured!!!
and to do that you have to edit the sudoers file.
it would be good before advancing things to do some research when you don't know.
as for the problem, it is easily fixable
you just have to open dolphin or nautilus, I don't know what he has
either if it's a notebook
sudo dolphin or nautilus
and there he can transfer the folders
if sudo is not installed
su -
password
dolphin or nautilus and the same process

see you later
--
FC 11 - Mandriva 2009 - Debian 5.0-
The best things take time. (JC ANGLADE)
think about the tips https://www.commentcamarche.net/list
0
Flachy Joe Posted messages 2303 Status Membre 261 > jeanbi Posted messages 15399 Registration date   Status Contributeur Last intervention  
 
Sorry for the apt-get, I didn't pay attention to its distribution
It seems to me that when I installed it on Debian it was configured, but that's probably not the case for all distributions or all configurations (with a single user, the default config is obvious...). Thanks for the remark.

From what I understand, he doesn't want to MOVE the files but ACCESS them, so the permissions still need to be modified.
--
;-) Flachy Joe ;-)
My public PGP key is available in my profile.
0
jeanbi Posted messages 15399 Registration date   Status Contributeur Last intervention   2 383
 
re, on Debian sudo is not installed!
2 root can do everything so even just to access it is enough
cya
--
FC 11 - Mandriva 2009 - Debian 5.0-
The best things take time. (JC ANGLADE)
think about the tips https://www.commentcamarche.net/list
0
Flachy Joe Posted messages 2303 Status Membre 261
 
Hey, on Debian, sudo n'est pas installé ! Well no, but you can install it (with apt-get for that matter).

Root can do anything, so just to access it is enough I wouldn't launch something like a file explorer as root. From a security standpoint, it's zero and there's no better way to mess up and end up with even more folders whose permissions are limited to root.
--
;-) Flachy Joe ;-)
My public PGP key is available in my profile.
0
jeanbi Posted messages 15399 Registration date   Status Contributeur Last intervention   2 383 > Flachy Joe Posted messages 2303 Status Membre
 
re,
sorry!!! and you think that using sudo is secure!!
see you later
--
FC 11 - Mandriva 2009 - Debian 5.0-
The best things require patience. (JC ANGLADE)
think about the tips https://www.commentcamarche.net/list
0
Flachy Joe Posted messages 2303 Status Membre 261 > jeanbi Posted messages 15399 Registration date   Status Contributeur Last intervention  
 
That's precisely the principle: you launch the commands one by one with sudo instead of logging in as root. Since each command to be run as root is preceded by sudo, you can't go wrong and run a command as root that you meant to run as a regular user.
Moreover, you were talking about the sudo configuration; if you looked into it, you would have noticed that the permission rules are perfectly adaptable. You can choose which command each user can run and with what rights. For example, if you have a strange configuration where disks change, it may be wise to allow anyone to access mount (and only mount) as root—something you cannot do without sudo without modifying the permissions on the executable itself.
In fact, sudo doesn't just mean "do as root," but "do as root if I have the rights."
--
;-) Flachy Joe ;-)
My public PGP key is available in my profile.
0
Silen
 
Hello gentlemen,

I have read your posts, interesting! By the way, if I understand correctly, I need to install sudo & configure it.
My machine is an Acer Aspire One, a notebook without a hard drive, so it has 4GB of RAM.
Okay, so if I understand correctly,
- after opening my xterm window,
- I type su- "password"
- then yum install sudo
- then dolphin or nautilus

I want to OPEN the file, ACCESS it, and not transfer it!
It is simply located in "my documents" on the machine's memory, and is called SudConnexion

@ vs read
0
Flachy Joe Posted messages 2303 Status Membre 261
 
Hi,
What you're indicating doesn't allow knowing the exact path to your folder.
Go to this location with a file browser (even if you don't have access inside the directory) and display the address bar (from the view menu, depending on what you are using) and copy its content here. It will be something like /home/toto/documents/SudConnexion

sudo is more secure than su but isn't necessary if you understand what you are doing as root and are careful to close the log.
Basically, only execute commands after su that you have read the documentation for or that are perfectly commented, when it comes to help provided on a forum.

--
;-) Flachy Joe ;-)
My public PGP key is available in my profile.
0
jeanbi Posted messages 15399 Registration date   Status Contributeur Last intervention   2 383
 
Hello
sudo is more secure than su

where did you read that??? Avoid saying such nonsense
it would be good for you to know what you're talking about
sudo refers to a sudoers file in which we define the user’s rights and what they can do with their password (under Ubuntu for example, 1 single user and root password)
su - on the other hand requires the administrator password, it's still not the same thing
see you
--
FC 11 - Mandriva 2009 - Debian 5.0 -
The best things require patience. (JC ANGLADE)
think of the tips https://www.commentcamarche.net/list
0
Flachy Joe Posted messages 2303 Status Membre 261
 
Thank you for your participation Jeanbi, but look a little higher, I detailed my point of view on what I call the security of sudo and su. I stand by my point: in a single user environment and/or managed by a newbie (and in other cases...) sudo is much more secure than su.

--
;-) Flachy Joe ;-)
My public PGP key is available in my profile.
0
Silen > Flachy Joe Posted messages 2303 Status Membre
 
Hello Flachy Joe,


I finally found a workaround for this little issue.

Here's the procedure that was shown to me by a colleague who knows Linux, though not this version.

So my Acer Aspire One runs on Fedora 8.0.

1/ alt+F2 to switch to “xterm” mode by typing xterm in the dialog box
2/ log in as administrator, or root,
so
type
su -
your password - it is invisible in this version -
hit enter

3/ once in root mode, type

cd thunar

(thunar is the file manager for the Fedora version on AAO), if I'm not mistaken
then hit enter, you are in administrator mode

4/ when you open a window, a red banner indicates that you are operating in administrator mode with all the risks that it entails

5/ open the folder that contains the problematic folder which you could not access

6/ right-click on the inaccessible folder

7/ choose preferences, and set read and write access

8/ close the folder

9/ close the xterm dialog window to switch back to simple user mode

the folder is accessible again, and I've recovered all my photos!

@ good to hear, hello Linux users!
ciao
0