[SOLVED] How to get permissions to copy-paste or write files to directories outside /home?
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
-
- Level 1
- Posts: 38
- Joined: Fri Nov 10, 2023 10:11 am
[SOLVED] How to get permissions to copy-paste or write files to directories outside /home?
I want to know how I can get permission to copy-paste or move files from /home to other directories like /usr
Similarly, I can't write files and save them in the /etc directory. What should I do?
Similarly, I can't write files and save them in the /etc directory. What should I do?
Last edited by LockBot on Sun May 12, 2024 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
-
- Level 21
- Posts: 12639
- Joined: Sun Aug 09, 2015 10:00 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
There is a reason you can't write to these directories. There are system files here and user data should not be here.
The advice is don't do it. You should run the commands with sudo if you want to disregard the advice, Like
The advice is don't do it. You should run the commands with sudo if you want to disregard the advice, Like
Code: Select all
sudo vim
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak
Mint 22 Cinnamon 0U/8gb
Regards,
Deepak
Mint 22 Cinnamon 0U/8gb
-
- Level 1
- Posts: 38
- Joined: Fri Nov 10, 2023 10:11 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
Thank you for replying. I understand there is a reason for restrictions on permissions but I had downloaded a theme from GitHub which needed to be moved to the /usr/share/themes directory to make it available on my system. I also wanted to install mpv following the instructions outlined here: https://fruit.je/apt. One of the steps there wanted me to write something to /etc/apt/sources.list.d/fruit.list.deepakdeshp wrote: ⤴Sun Nov 12, 2023 4:03 am There is a reason you can't write to these directories. There are system files here and user data should not be here.
The advice is don't do it. You should run the commands with sudo if you want to disregard the advice, LikeCode: Select all
sudo vim
Similarly, following on instructions listed here: https://www.jamescoyle.net/how-to/3116- ... unt-script for creating an rclone mount service I need to create a script with
vi /etc/systemd/system/rclone.service
. I was wondering if there was a way to do these things without messing up my OS.
-
- Level 21
- Posts: 12639
- Joined: Sun Aug 09, 2015 10:00 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
instead of vi use sudo vi to edit the file and you can write to the system folders like /etc
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak
Mint 22 Cinnamon 0U/8gb
Regards,
Deepak
Mint 22 Cinnamon 0U/8gb
-
- Level 9
- Posts: 2630
- Joined: Wed Aug 14, 2019 1:02 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
The Fruit repository website is providing a less than ideal practice to add 3rd party repository. The correct dirctory to saving 3rd party gpg keys should have been either /etc/apt/keyrings or /usr/share/keyrings. Then the source list should point itself to use that added key. Overall the modified instruction will be:
assuming you are running LM 21.x.
Then for the creation of fruit.list, one way to create/edit system config files in Linux Mint is
This will let you edit system config file in our usual GUI text editor. The difference from this versus
----
Similar procedure can be applied for /etc/systemd/system/rclone.service
Code: Select all
sudo curl --output-dir /usr/share/keyrings -O https://apt.fruit.je/fruit.gpg
Code: Select all
deb [signed-by=/usr/share/keyrings/fruit.gpg] http://apt.fruit.je/ubuntu jammy mpv
Then for the creation of fruit.list, one way to create/edit system config files in Linux Mint is
Code: Select all
sudo touch /etc/apt/sources.list.d/fruit-mpv.list
xed admin:///etc/apt/sources.list.d/fruit-mpv.list
sudo xed <usual-file-path>
is, when one sudo xed, the text editor is opened as root. Meanwhile {c]xed admin:///[/c] open the text editor normally so it takes your existing text editor preferences and can open the file as a tab inside the text editor if you already have other text files opened (this works even if the other text files is just "unsaved document 1"). It can even be listed as a "recent file" in File > Recents too.touch
creates a file if that file doesn't exist. The second line of command can't work if the file hasn't existed.----
Similar procedure can be applied for /etc/systemd/system/rclone.service
-
- Level 1
- Posts: 38
- Joined: Fri Nov 10, 2023 10:11 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
Thank you for a detailed response! But I already followed the previous advice of usingbillyswong wrote: ⤴Sun Nov 12, 2023 6:00 am The Fruit repository website is providing a less than ideal practice to add 3rd party repository. The correct dirctory to saving 3rd party gpg keys should have been either /etc/apt/keyrings or /usr/share/keyrings. Then the source list should point itself to use that added key. Overall the modified instruction will be:Code: Select all
sudo curl --output-dir /usr/share/keyrings -O https://apt.fruit.je/fruit.gpg
assuming you are running LM 21.x.Code: Select all
deb [signed-by=/usr/share/keyrings/fruit.gpg] http://apt.fruit.je/ubuntu jammy mpv
Then for the creation of fruit.list, one way to create/edit system config files in Linux Mint isThis will let you edit system config file in our usual GUI text editor. The difference from this versusCode: Select all
sudo touch /etc/apt/sources.list.d/fruit-mpv.list xed admin:///etc/apt/sources.list.d/fruit-mpv.list
sudo xed <usual-file-path>
is, when one sudo xed, the text editor is opened as root. Meanwhile {c]xed admin:///[/c] open the text editor normally so it takes your existing text editor preferences and can open the file as a tab inside the text editor if you already have other text files opened (this works even if the other text files is just "unsaved document 1"). It can even be listed as a "recent file" in File > Recents too.
touch
creates a file if that file doesn't exist. The second line of command can't work if the file hasn't existed.
----
Similar procedure can be applied for /etc/systemd/system/rclone.service
sudo
with the commands I found in the above-mentioned instructions. Do you reckon I might face some problems because of this?-
- Level 9
- Posts: 2630
- Joined: Wed Aug 14, 2019 1:02 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
sudo vi is okay. The gpg key shall be fixed. Some background story of why the fruit repository instruction in their website is not ideallinuxmintforumsuser wrote: ⤴Sun Nov 12, 2023 9:23 am Thank you for a detailed response! But I already followed the previous advice of usingsudo
with the commands I found in the above-mentioned instructions. Do you reckon I might face some problems because of this?
https://medium.com/@glegoux/ubuntu-22-0 ... bbee8aec84
TLDR: A gpg key given by a 3rd party repository shall be used only for authenticating software downloaded from that repository. However, the old key installation approach (or the way "fruit" circumvented the recent deprecation) let the key authenticates any software packages downloaded from any servers or any other actions that may ask for signature check. This is placing too much a trust to a 3rd party repository key.
-
- Level 1
- Posts: 38
- Joined: Fri Nov 10, 2023 10:11 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
So should I delete the gpg key and add it again in the way you suggested. Would this mess with my installed mpv package? Or any other installs made using the Fruit repository during mpv's installation?billyswong wrote: ⤴Sun Nov 12, 2023 11:37 amsudo vi is okay. The gpg key shall be fixed. Some background story of why the fruit repository instruction in their website is not ideallinuxmintforumsuser wrote: ⤴Sun Nov 12, 2023 9:23 am Thank you for a detailed response! But I already followed the previous advice of usingsudo
with the commands I found in the above-mentioned instructions. Do you reckon I might face some problems because of this?
https://medium.com/@glegoux/ubuntu-22-0 ... bbee8aec84
TLDR: A gpg key given by a 3rd party repository shall be used only for authenticating software downloaded from that repository. However, the old key installation approach (or the way "fruit" circumvented the recent deprecation) let the key authenticates any software packages downloaded from any servers or any other actions that may ask for signature check. This is placing too much a trust to a 3rd party repository key.
-
- Level 9
- Posts: 2630
- Joined: Wed Aug 14, 2019 1:02 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
To smooth the process, you can fix thing in the following order:
1. Add / copy the key to the correct place
2. Edit the list file(s), add the "signed-by" tag
3. Remove the key in old location
4.
1. Add / copy the key to the correct place
2. Edit the list file(s), add the "signed-by" tag
3. Remove the key in old location
4.
sudo apt update
-
- Level 1
- Posts: 38
- Joined: Fri Nov 10, 2023 10:11 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
How can I find the location of the key and determine the correct location to add/copy it? Additionally, how can I edit the list file, add the "signed-by" tag, and remove the key in old location?billyswong wrote: ⤴Mon Nov 13, 2023 9:43 am To smooth the process, you can fix thing in the following order:
1. Add / copy the key to the correct place
2. Edit the list file(s), add the "signed-by" tag
3. Remove the key in old location
4.sudo apt update
-
- Level 9
- Posts: 2630
- Joined: Wed Aug 14, 2019 1:02 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
In https://fruit.je/apt the command line given for key installation islinuxmintforumsuser wrote: ⤴Mon Nov 13, 2023 11:07 am How can I find the location of the key and determine the correct location to add/copy it? Additionally, how can I edit the list file, add the "signed-by" tag, and remove the key in old location?
So assuming you did run that command, you can go to "/etc/apt/trusted.gpg.d" and see the key created there, as it is the "output directory". now for copying files, the command will beCode: Select all
sudo curl --output-dir /etc/apt/trusted.gpg.d -O https://apt.fruit.je/fruit.gpg
Code: Select all
sudo cp /etc/apt/trusted.gpg.d/fruit.gpg /usr/share/keyrings/fruit.gpg
Code: Select all
xed admin:///etc/apt/sources.list.d/fruit.list
At the end, you can remove the old key by
Code: Select all
sudo rm /etc/apt/trusted.gpg.d/fruit.gpg
-
- Level 1
- Posts: 38
- Joined: Fri Nov 10, 2023 10:11 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
Thank you very much! Just to make sure I did everything right,billyswong wrote: ⤴Mon Nov 13, 2023 2:43 pm In https://fruit.je/apt the command line given for key installation isSo assuming you did run that command, you can go to "/etc/apt/trusted.gpg.d" and see the key created there, as it is the "output directory". now for copying files, the command will beCode: Select all
sudo curl --output-dir /etc/apt/trusted.gpg.d -O https://apt.fruit.je/fruit.gpg
For editing the list file, assuming you followed the instruction in fruit.je, the file is at "/etc/apt/sources.list.d/fruit.list". So you can just runCode: Select all
sudo cp /etc/apt/trusted.gpg.d/fruit.gpg /usr/share/keyrings/fruit.gpg
as well.Code: Select all
xed admin:///etc/apt/sources.list.d/fruit.list
At the end, you can remove the old key byCode: Select all
sudo rm /etc/apt/trusted.gpg.d/fruit.gpg
/etc/apt/sources.list.d/fruit.list
should look like this:
Code: Select all
deb [signed-by=/usr/share/keyrings/fruit.gpg] https://apt.fruit.je/ubuntu jammy mpv
-
- Level 9
- Posts: 2630
- Joined: Wed Aug 14, 2019 1:02 am
Re: How to get permissions to copy-paste or write files to directories outside /home?
Yes.linuxmintforumsuser wrote: ⤴Mon Nov 13, 2023 3:00 pm Thank you very much! Just to make sure I did everything right,/etc/apt/sources.list.d/fruit.list
should look like this:Code: Select all
deb [signed-by=/usr/share/keyrings/fruit.gpg] https://apt.fruit.je/ubuntu jammy mpv