Score:0

How can stop sftp download and upload a specific file in the root user and cat command

in flag

how to stop sftp root user transfir and donload for specific file

linux centos 7

I have a text file located in the root folder But . I want to give someone a root user password and I need to protect my file. I want to make sure that this person cannot download this file to his device via sftp

and stop cat this file

in flag
You can't. If you give someone root access he has all privileges to remove your restrictions. Either you trust someone to give him root access or you don't.
Score:2
cn flag

I have a text file located in the root folder ...

Probably not a Good Idea to start with.
Linux has conventions about where files should be placed. The root directory is not one of them.

But I want to give someone a root user password ...

Bad Idea.
Always keep the biggest and best tools in the toolbox for yourself, so that you can clean up the mess made by other people (and processes).
If you hand out the root password, you abandon all control of that server.

... and I need to protect my file.

You cannot have both.
Anyone with root access can do anything. By design.

(What's in this oh-so-important file, anyway?)

Find another way to get this user the access that they require.
sudo is a common solution and it doesn't [have to] involve handing out root access! (You can tell sudo to allow certain commands to run as a specific user, not just root).

I want to make sure that this person cannot download this file to his device via sftp and stop cat this file

If you don't want them to be able to look at the file (through cat) and you don't want them to be able to read the file (to download it) what do you want them to be able to do with it?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.