简体   繁体   English

以非 root 用户身份在 linux 中列出目录内容

[英]Issue listing directory contents in linux as non-root user

I am executing script through docker container as non-root user.我正在以非 root 用户身份通过 docker 容器执行脚本。 Inside script creating a directory "/var/lib/user/flags/" using mkdir -p /var/lib/user/flags .内部脚本使用mkdir -p /var/lib/user/flags创建目录“/var/lib/user/flags/” Changed the permission of directory to allow full access using chown -R user:user /var/lib/user/flags Using touch command created file inside /var/lib/user/flags For debugging added ls -ltr /var/lib/user/flags inside script where the output displays the file with correct user and group permissions,but when browsing the directory the file is not present.使用chown -R user:user /var/lib/user/flags更改目录的权限以允许完全访问使用 touch 命令在/var/lib/user/flags中创建文件用于调试添加ls -ltr /var/lib/user/flags在脚本中 output 显示具有正确用户和组权限的文件,但是在浏览目录时该文件不存在。
Need that the file must be available at the target folder.需要该文件必须在目标文件夹中可用。

Thank you谢谢

The issue I was facing has resolved.我面临的问题已经解决。 The issue was that the clickhouse server when starts/restarts deletes this flags directory specific file for performing replication, for which I went through the documentations.问题是 clickhouse 服务器在启动/重新启动时会删除此标志目录特定文件以执行复制,为此我浏览了文档。

Thank you for helping.感谢您的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM