Which permissions do I need in order to send someone else / root files?
Clash Royale CLAN TAG#URR8PPP
So I was playing a little with permissions in my system and then I noticed there is no permission specified for sending the file somewhere else.
I tried, as a simple user, the following command:mail -a //etc/shadow myAddress@domain.com
I was satisfied to get a Permission Denied
message, but it's still not clear what the permissions are required in order to send a file.
I mean, I use the mail
command for mail protocol, but what about other commands or other protocols?
btw, the permissions for the shadow
file were:
-rw-r----- 1 root shadow 1759 Oct 23 2017 shadow
permissions email
add a comment |
So I was playing a little with permissions in my system and then I noticed there is no permission specified for sending the file somewhere else.
I tried, as a simple user, the following command:mail -a //etc/shadow myAddress@domain.com
I was satisfied to get a Permission Denied
message, but it's still not clear what the permissions are required in order to send a file.
I mean, I use the mail
command for mail protocol, but what about other commands or other protocols?
btw, the permissions for the shadow
file were:
-rw-r----- 1 root shadow 1759 Oct 23 2017 shadow
permissions email
add a comment |
So I was playing a little with permissions in my system and then I noticed there is no permission specified for sending the file somewhere else.
I tried, as a simple user, the following command:mail -a //etc/shadow myAddress@domain.com
I was satisfied to get a Permission Denied
message, but it's still not clear what the permissions are required in order to send a file.
I mean, I use the mail
command for mail protocol, but what about other commands or other protocols?
btw, the permissions for the shadow
file were:
-rw-r----- 1 root shadow 1759 Oct 23 2017 shadow
permissions email
So I was playing a little with permissions in my system and then I noticed there is no permission specified for sending the file somewhere else.
I tried, as a simple user, the following command:mail -a //etc/shadow myAddress@domain.com
I was satisfied to get a Permission Denied
message, but it's still not clear what the permissions are required in order to send a file.
I mean, I use the mail
command for mail protocol, but what about other commands or other protocols?
btw, the permissions for the shadow
file were:
-rw-r----- 1 root shadow 1759 Oct 23 2017 shadow
permissions email
permissions email
edited Feb 13 at 2:47
Community♦
1
1
asked Feb 12 at 15:36
Z E NirZ E Nir
56119
56119
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There isn't one, because "sending" a file isn't really a filesystem-level operation. What the mail
command does, is that it opens the file for reading, reads the data, and sends (writes) it over the network socket (probably encoded in the case of email, not that it matters). Similarly, an FTP client, scp
, or any other would do the same, they'd read the file as usual.
You don't have read access to /etc/shadow
, so mail
running with your user id cannot open it for reading.
Linux does have the sendfile()
system call, which directly copies data between two file descriptors, but that's basically the same as calling read()
on the one and write()
on the other fd, except that it happens within the kernel so there's less system call overhead. It, too, requires the source to be opened for reading.
1
So you claim I can send a file if and only if I got reading permissions?
– Z E Nir
Feb 12 at 15:46
1
@ZENir That is correct. You have to be able to read a file in order to send it.
– Tripp Kinetics
Feb 12 at 16:11
Thank you both!
– Z E Nir
Feb 12 at 16:20
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500199%2fwhich-permissions-do-i-need-in-order-to-send-someone-else-root-files%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There isn't one, because "sending" a file isn't really a filesystem-level operation. What the mail
command does, is that it opens the file for reading, reads the data, and sends (writes) it over the network socket (probably encoded in the case of email, not that it matters). Similarly, an FTP client, scp
, or any other would do the same, they'd read the file as usual.
You don't have read access to /etc/shadow
, so mail
running with your user id cannot open it for reading.
Linux does have the sendfile()
system call, which directly copies data between two file descriptors, but that's basically the same as calling read()
on the one and write()
on the other fd, except that it happens within the kernel so there's less system call overhead. It, too, requires the source to be opened for reading.
1
So you claim I can send a file if and only if I got reading permissions?
– Z E Nir
Feb 12 at 15:46
1
@ZENir That is correct. You have to be able to read a file in order to send it.
– Tripp Kinetics
Feb 12 at 16:11
Thank you both!
– Z E Nir
Feb 12 at 16:20
add a comment |
There isn't one, because "sending" a file isn't really a filesystem-level operation. What the mail
command does, is that it opens the file for reading, reads the data, and sends (writes) it over the network socket (probably encoded in the case of email, not that it matters). Similarly, an FTP client, scp
, or any other would do the same, they'd read the file as usual.
You don't have read access to /etc/shadow
, so mail
running with your user id cannot open it for reading.
Linux does have the sendfile()
system call, which directly copies data between two file descriptors, but that's basically the same as calling read()
on the one and write()
on the other fd, except that it happens within the kernel so there's less system call overhead. It, too, requires the source to be opened for reading.
1
So you claim I can send a file if and only if I got reading permissions?
– Z E Nir
Feb 12 at 15:46
1
@ZENir That is correct. You have to be able to read a file in order to send it.
– Tripp Kinetics
Feb 12 at 16:11
Thank you both!
– Z E Nir
Feb 12 at 16:20
add a comment |
There isn't one, because "sending" a file isn't really a filesystem-level operation. What the mail
command does, is that it opens the file for reading, reads the data, and sends (writes) it over the network socket (probably encoded in the case of email, not that it matters). Similarly, an FTP client, scp
, or any other would do the same, they'd read the file as usual.
You don't have read access to /etc/shadow
, so mail
running with your user id cannot open it for reading.
Linux does have the sendfile()
system call, which directly copies data between two file descriptors, but that's basically the same as calling read()
on the one and write()
on the other fd, except that it happens within the kernel so there's less system call overhead. It, too, requires the source to be opened for reading.
There isn't one, because "sending" a file isn't really a filesystem-level operation. What the mail
command does, is that it opens the file for reading, reads the data, and sends (writes) it over the network socket (probably encoded in the case of email, not that it matters). Similarly, an FTP client, scp
, or any other would do the same, they'd read the file as usual.
You don't have read access to /etc/shadow
, so mail
running with your user id cannot open it for reading.
Linux does have the sendfile()
system call, which directly copies data between two file descriptors, but that's basically the same as calling read()
on the one and write()
on the other fd, except that it happens within the kernel so there's less system call overhead. It, too, requires the source to be opened for reading.
answered Feb 12 at 15:42
ilkkachuilkkachu
60.4k1098171
60.4k1098171
1
So you claim I can send a file if and only if I got reading permissions?
– Z E Nir
Feb 12 at 15:46
1
@ZENir That is correct. You have to be able to read a file in order to send it.
– Tripp Kinetics
Feb 12 at 16:11
Thank you both!
– Z E Nir
Feb 12 at 16:20
add a comment |
1
So you claim I can send a file if and only if I got reading permissions?
– Z E Nir
Feb 12 at 15:46
1
@ZENir That is correct. You have to be able to read a file in order to send it.
– Tripp Kinetics
Feb 12 at 16:11
Thank you both!
– Z E Nir
Feb 12 at 16:20
1
1
So you claim I can send a file if and only if I got reading permissions?
– Z E Nir
Feb 12 at 15:46
So you claim I can send a file if and only if I got reading permissions?
– Z E Nir
Feb 12 at 15:46
1
1
@ZENir That is correct. You have to be able to read a file in order to send it.
– Tripp Kinetics
Feb 12 at 16:11
@ZENir That is correct. You have to be able to read a file in order to send it.
– Tripp Kinetics
Feb 12 at 16:11
Thank you both!
– Z E Nir
Feb 12 at 16:20
Thank you both!
– Z E Nir
Feb 12 at 16:20
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500199%2fwhich-permissions-do-i-need-in-order-to-send-someone-else-root-files%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown