我有一个 linux 多用户服务器,在 /etc/passwd 中有 100 多个用户
我想允许用户“预订”/“保留”他们喜欢的名字(在这种情况下是一个子域,但细节无关紧要)
我创建了一个名为/reservations和 chmod 777的目录。
如果用户 johndoe 这样做,touch /reservations/coolsite他表示他想“拥有”这个名字“coolsite”
应该建立“机制”,以便,
johndoe 可以稍后改变主意,rm /reservations/coolsite取消预订那个名字
不允许另一个用户touch /reservations/coolsite,因为 johndoe 首先要求它。
如果 johndoerm他的文件,则允许其他用户预订。
用户不能访问rm / rename / mv / etc其他人的文件
用户 johndoe 可以通过执行多个预订 touch /reservations/coolsite && touch /reservations/coolsite2
这是否可以使用某种标准的 linux 权限机制?
我不想为此求助于 perl,自从 ruby 和她的波浪状金发一起出现的那一天起,我的 perl 技能就变得生疏了......
当通过 ssh 在服务器内运行时,我的 bash 脚本运行时噪音更大。
+ sudo apt-get install -yqq nodejs
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
Run Code Online (Sandbox Code Playgroud)
我在那里看到的建议之一是做 export TERM=linux
有没有副作用?在脚本的开头这样做是否是个好主意,如下所示:
#!/bin/bash
set -e
set -x
TERM=linux
Run Code Online (Sandbox Code Playgroud) 如何创建一个文件夹:
我怎样才能一步完成此操作?
下载备份命令:
curl http://s3.aws.com/backup.sql
Run Code Online (Sandbox Code Playgroud)
恢复备份命令:
sudo -u postgres psql <PIPE-THE-OUTPUT-OF-PREVIOUS-COMMAND>
Run Code Online (Sandbox Code Playgroud) bash ×2
chmod ×2
directory ×2
permissions ×2
curl ×1
multi-user ×1
perl ×1
pipe ×1
postgresql ×1
read-only ×1
scripts ×1
ssh ×1