在没有加密的情况下,如何对linux/unix上的文件夹进行密码保护?

如果您不需要或不想加密计算机上的文件,但希望停止随意窥探,那么在Linux/Unix上用密码保护文件夹的最佳方法是什么?今天的超级用户问答帖子对一位好奇的读者的问题提供了有用的答案。...

在没有加密的情况下,如何对linux/unix上的文件夹进行密码保护?

如果您不需要或不想加密计算机上的文件,但希望停止随意窥探,那么在Linux/Unix上用密码保护文件夹的最佳方法是什么?今天的超级用户问答帖子对一位好奇的读者的问题提供了有用的答案。

今天的问题;回答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,是一个由社区驱动的Q&分组;一个网站。

照片由Nathan Meijer(Flickr)提供。

问题

超级用户读者Zane Woodard想知道如何在Linux/Unix上不加密地对文件夹进行密码保护:

I have searched around quite a bit for either a built-in feature or program to do this, but had no luck. I want to password protect a folder, but do not want to encrypt it.

The security of the contents of the folder is not important, the password would just act as a deterrent to somebody attempting to access the contents of the folder from my computer. Think of it like a password lock on a computer, if you were to remove the hard-drive, you could easily take all the files the user had, but the password is still a deterrent to people accessing the contents of the drive.

Two main reas*** for not using encryption here are:

  • Decreased performance for opening files.
  • Encryption prevents the contents from being indexed/searchable.

Is anybody aware of a solution?

有没有一个简单的解决方案,赞恩可以用来密码保护他的文件夹?

答案

超级用户贡献者R舒尔茨和Bodo Thiesen为我们提供了答案。首先,R舒尔茨:

The easiest way would be to change the permissi*** of the files so that they are not readable by anyone other than the owner. Once that is done, a user would have to either log in as you (which should require a password) or sudo as root (which should also require a password). To change the permissi***, simply use the following command on any files you do not want others to have access to.

  • chmod og-rwx filename

This assumes that when you are not at your computer, your screen is locked and there is a password for your account as well as the root account.

接着是博多·蒂森的回答:

Create a new user for these protected files and/or directories. Then replace $newuser with the new user account name:

  • chown $newuser filename directoryname
  • chmod og-rwx filename directoryname

This way, the files and directories are safe even if you do not log out and have your screen unlocked for some reason.


有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。

  • 发表于 2021-07-15 04:43
  • 阅读 ( 179 )
  • 分类:互联网

你可能感兴趣的文章

如何在ubuntu中加密文件和文件夹

... 我们讨论过保护macOS上的文件和文件夹以及保护Windows上的文件夹。您还可以通过加密文件和文件夹来保护Linux上的信息。 ...

  • 发布于 2021-03-11 16:31
  • 阅读 ( 853 )

如何对mac上的文件和文件夹进行密码保护

...你来说有点过分了。对于某些文件和文件夹,有更简单的密码保护选项。 ...

  • 发布于 2021-03-14 01:15
  • 阅读 ( 203 )

windows 10上的“拒绝访问”文件夹错误?5个简单的修复

... 如果您在尝试访问文件或文件夹时在Windows 10上看到“拒绝访问”消息,我们将指导您完成解决此问题的步骤。 ...

  • 发布于 2021-03-17 23:57
  • 阅读 ( 640 )

如何密码保护你的U盘:5个简单的方法

想学习如何保护闪存驱动器吗?不幸的是,你不能用密码保护整个U盘。但是您可以加密分区、文件夹和存档。 ...

  • 发布于 2021-03-18 13:59
  • 阅读 ( 253 )

想保持个人数据的安全吗?下面是如何加密文件

... 在Mac上加密文件和文件夹时,MacOS允许您直接压缩和密码保护数据,而无需第三方软件。 ...

  • 发布于 2021-03-28 13:03
  • 阅读 ( 175 )

如何使用onedrive的“个人保险库”保护您的文件

... 如何使用个人保险库 要使用Personal Vault,只需打开OneDrive文件夹,然后单击或轻触“Personal Vault”文件夹。你可以在windows10pc上通过网站或使用你喜欢的智能**应用程序来实现这一点。 例如,在Windows10上,只需打开文件资源管理...

  • 发布于 2021-04-02 22:16
  • 阅读 ( 268 )

如何防止在microsoft excel中编辑工作簿、工作表和单元格

...打开时,Excel将提示您输入密码。 如果要从文件中删除密码保护,请打开它(当然,这需要您提供当前密码),然后按照指定密码的相同步骤进行操作。只有这一次,使密码字段为空,然后单击“确定” 将工作簿设为只读 使...

  • 发布于 2021-04-03 23:30
  • 阅读 ( 189 )

如何开始使用usenet,这是torrents的最佳替代方案

...cOS,安装更简单,只需双击安装程序并将其拖到Applicati***文件夹。 安装完成后,您的默认web浏览器将打开到端口8080上的本地主机的连接,在那里您将收到SABnzbd快速启动向导的欢迎。选择您的语言,然后单击“开始向导”按钮...

  • 发布于 2021-04-06 08:24
  • 阅读 ( 140 )

如何在windows上设置bitlocker加密

...启用BitLocker。 如何使用bitlocker加密驱动器 相关:如何在没有可信平台模块(TPM)的情况下使用BitLocker 要将BitLocker用于驱动器,您真正需要做的就是启用它,选择解锁方法密码、PIN等,然后设置其他一些选项。不过,在我们开始...

  • 发布于 2021-04-07 05:13
  • 阅读 ( 243 )

如何绕过和重置每个操作系统上的密码

...置和更改系统上的密码。如果Grub引导菜单被锁定并且受密码保护,您仍然可以引导到Linux live媒体并从那里更改您的密码。 同样,加密将防止在没有加密密码短语的情况下访问和修改系统。我们以Ubuntu为例,但是几乎每个Linux发...

  • 发布于 2021-04-07 20:32
  • 阅读 ( 267 )
iytr646152
iytr646152

0 篇文章

相关推荐