AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-269349

user3447014's questions

Martin Hope
user3447014
Asked: 2020-08-12 13:55:07 +0800 CST

授予用户对根文件夹中文件夹的权限

  • 0

在我的根文件夹中,我有一个名为 app 的文件夹(例如/root/myapp)。此/root/app文件夹归用户 root 和组team. 我已通过使用将其应用于整个目录chown -R root:team /root/myapp;但是我有一个用户是该team组的一部分,他们无法访问此文件夹。

 ⚡ root@dev  ~/myapp   dev ●  ls -la                                 
total 10568                                                                       
drwxrwxr-x 18 root team    4096 Aug 11 21:44 .                                  
drwx------  9 root root      4096 Aug 11 21:47 ..                                 
-rw-rw-r--  1 root team     341 Jun 17 02:17 .env                               
drwxrw-r-x  8 root team    4096 Aug 11 21:47 .git                               
-rw-rw-r--  1 root team    1573 Aug 11 15:53 .gitignore                                       
-rw-rw-r--  1 root team    4405 Jul 30 15:11 Gemfile                            
-rw-rw-r--  1 root team   13315 Aug  3 17:18 Gemfile.lock                       
-rw-rw-r--  1 root team     384 Jun 17 02:11 README.md                          
-rw-rw-r--  1 root team     227 Jun 17 02:11 Rakefile                           
drwxrw-r-x 13 root team    4096 Aug 11 20:23 app                                
drwxrw-r-x  2 root team    4096 Jun 17 02:11 bin                                
drwxrw-r-x  3 root team    4096 Jun 17 02:11 cfn-templates                      
drwxrw-r-x  5 root team    4096 Aug 11 15:54 config                             
-rw-rw-r--  1 root team     130 Jun 17 02:11 config.ru                          
drwxrw-r-x  3 root team    4096 Aug 11 16:08 db                                 
drwxrw-r-x  2 root team    4096 Aug 11 16:49 doc                                             
drwxrw-r-x  6 root team    4096 Aug 11 20:23 lib                                
drwxrw-r-x  2 root team    4096 Jun 17 02:27 log                                
-rw-rw-r--  1 root team   34733 Aug 11 16:50 models.dot                         
-rw-rw-r--  1 root team 4439122 Aug 11 16:50 models.png                         
drwxrw-r-x  2 root team    4096 Jun 17 02:11 nginx                              
drwxrw-r-x 51 root team    4096 Jun 17 02:27 node_modules                       
-rw-rw-r--  1 root team   14122 Jun 17 02:27 package-lock.json                  
-rw-rw-r--  1 root team     706 Jun 17 02:11 package.json                       
drwxrw-r-x  2 root team    4096 Aug  3 18:38 public                             
drwxrw-r-x  2 root team    4096 Jun 17 02:11 storage                            
drwxrw-r-x 10 root team    4096 Jun 17 02:11 test                               
drwxrw-r-x  5 root team    4096 Jun 17 02:25 tmp                                
drwxrw-r-x  2 root team    4096 Jun 17 02:11 vendor                             

当我运行时groups user1,我可以看到它user1在team组中:

 ⚡ root@dev  ~/myapp   dev ●  groups user1                                                                                                                     
user1 : user1 team

在该用户的主目录中,我以下列方式创建了一个符号链接ln -s /root/myapp /home/user1/myapp:但是,如果我尝试 cd 进入该用户下的该目录,我会得到permission denied.

知道是什么原因造成的吗?据我了解,团队中的任何人都应该能够读取、写入或执行整个目录。

这是来自用户用户's home directory as the 用户的 ls:

│user1@dev ~ % ls -la                                             
│total 84
│drwxr-xr-x 3 user1 user1  4096 Aug 11 21:55 .
│drwxr-xr-x 3 root    root     4096 Aug 11 21:17 ..
│-rw------- 1 user1 user1    29 Aug 11 21:19 .bash_history
│-rw-r--r-- 1 user1 user1   220 Apr  4  2018 .bash_logout
│-rw-r--r-- 1 user1 user1  3771 Apr  4  2018 .bashrc
│-rw-r--r-- 1 user1 user1     0 Jun 23 04:40 .cloud-locale-test.skip
│-rw-r--r-- 1 user1 user1   807 Apr  4  2018 .profile
│drwxr-xr-x 2 root    root     4096 Aug 11 21:17 .ssh
│-rw------- 1 user1 user1   695 Aug 11 21:32 .viminfo
│-rw-rw-r-- 1 user1 user1 42357 Aug 11 21:19 .zcompdump
│-rw------- 1 user1 user1   673 Aug 11 21:55 .zsh_history
│-rw-r--r-- 1 user1 user1  1295 Aug 11 21:21 .zshrc
│lrwxrwxrwx 1 user1 user1    10 Aug 11 21:18 myapp -> /root/myapp
permissions
  • 1 个回答
  • 2218 Views
Martin Hope
user3447014
Asked: 2019-11-24 07:48:26 +0800 CST

运行桌面快捷方式只是在文本编辑器中打开它

  • 5

我查看了与该主题有关的其他一些 StackExchange 问题,但无论出于何种原因,我仍然无法解决。

这是test.desktop我桌面上的简单文件:

[Desktop Entry]
Version=1.0
Name=Test        
Comment=Test the terminal running a command inside it
Exec=gnome-terminal -e "~/test.rb"
Icon=utilities-terminal
Terminal=false
Type=Application
Categories=Application;

我只是想创建一个在双击时运行 Ruby 脚本的快捷方式。我试图让最终用户非常容易打开它,但是当我双击文件时,它只会在文本编辑器中不断打开。

我还验证了它也具有写入权限,但仍然没有。如果我替换~/test.rb为ifconfig,它仍然不起作用。

我在这里做错了什么?

gnome command-line unity ruby .desktop
  • 1 个回答
  • 2904 Views
Martin Hope
user3447014
Asked: 2019-09-14 04:37:06 +0800 CST

无法更新或升级 Ubuntu。没有可用的东西(没有新的包,什么都没有)

  • 1

我无法安装任何新软件包,甚至无法从 Ubuntu 18.04 升级。这就像虚拟机被困在 Ubuntu 18.04 刚刚问世的旧时代。没有可用的新软件包或任何东西。有些事情肯定是搞砸了,我不知道如何解决这个问题。

[root:7e2d33988106:/]# lsb_release -a                                                                                                                                                                                                                                   12:55PM/09.12
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic

[root:7e2d33988106:/]# cat /etc/apt/sources.list | grep -v "#" | sort -u                                                                                                                                                                                                12:55PM/09.12

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic universe
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe
deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted
deb http://security.ubuntu.com/ubuntu/ bionic-security multiverse
deb http://security.ubuntu.com/ubuntu/ bionic-security universe

[root:7e2d33988106:/]# apt update; apt upgrade -y; apt full-upgrade -y; apt dist-upgrade -y; apt autoremove -y; apt clean -y                                                                                                                                            12:55PM/09.12
Hit:1 https://deb.nodesource.com/node_6.x bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                       
Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease                                                                           
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]       
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]     
Reading package lists... Done       
E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 17h 54min 25s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 17h 55min 3s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease is not valid yet (invalid for another 17h 55min 58s). Updates for this repository will not be applied.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

知道为什么没有新的软件包可用吗?我已经好几个月没有升级这个 docker 容器了。

package-management updates upgrade apt
  • 1 个回答
  • 347 Views
Martin Hope
user3447014
Asked: 2018-09-13 07:52:26 +0800 CST

我的 sudoers 文件和 NOPASSWD 中有“apache reload”,但它仍然要求

  • 1

我认为这是一个非常简单的过程。我想基本上重新加载 apache(因为我会经常添加/删除虚拟主机),但如果没有提示我输入密码,我似乎无法让 Apache 重新加载。

这是我的/etc/sudoers文件:

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults    env_reset
Defaults    mail_badpass
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

# Host alias specification

# User alias specification
subzero ALL=(ALL) NOPASSWD:/etc/init.d/apache2 reload

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

我已经注销并重新登录,但仍然没有成功。知道为什么这可能不起作用吗?

我还尝试将其移至底部以防万一它是优先事项,但仍然没有运气。

sudo apache2
  • 1 个回答
  • 537 Views
Martin Hope
user3447014
Asked: 2017-09-14 14:21:09 +0800 CST

Auto SSH on startup 实际上正在启动,但它不是映射命令?

  • 1

所以我有一个 Ubuntu 16.04 系统,它应该在每次系统启动时运行我编写的 SSH 脚本。这是我第一次尝试让它工作,所以以前从未有过。

脚本非常简单:

while true; do sleep 60; ssh root@ip -i ~/.ssh/key -R xxxx:localhost:22; done

它位于一个名为autossh.sh.

为了让脚本自动运行,我尝试将它包含在 /etc/rc.local 中(在退出 0 之前),我尝试将它添加到 Ubuntu GUI 的启动应用程序列表中。

在这两次我重新启动计算机期间,我可以看到脚本实际上正在运行,但它没有像命令应该做的那样将远程端口映射到 localhost 22。如果我手动运行该命令,它可以工作,但它只是在启动时不起作用。

是否有一些明显的东西我在这里遗漏了阻止该脚本正常工作的东西?

command-line
  • 1 个回答
  • 1889 Views
Martin Hope
user3447014
Asked: 2017-03-15 19:11:06 +0800 CST

我只能在一台显示器上显示 Ubuntu 系统托盘/栏吗?

  • 0

我想我会更容易找到这个问题的答案,但我基本上有三台显示器,我只希望顶部栏显示在一台显示器上。

当我使用 VMware Workstation 并全屏显示 VM 时,我无法访问在该 VM 内全屏显示的应用程序上的最小化、关闭等按钮,因为我的 Ubuntu 顶部系统/菜单栏位于每个屏幕。变得非常烦人。

有没有办法做到这一点?

unity
  • 1 个回答
  • 318 Views
Martin Hope
user3447014
Asked: 2017-02-24 13:00:11 +0800 CST

如何挂载 AFP 共享?

  • 3

所以我可以通过 afp://ip/share 连接到我的 Macbook 的共享,但这是我在访问该目录时所能获得的。为了让我将此共享文件夹传递给我的虚拟机,我希望能够将其挂载到一个文件夹,并将该文件夹传递给虚拟机。

但是,我似乎无法弄清楚如何到达这一步。由于与 SMB 签名等相关的问题,我无法通过 SMB 连接到共享,我花了几个小时没有成功。

我尝试使用 afpfs-ng,但我什至无法编译并正常工作。我尝试了以下方法:

git clone https://github.com/simonvetter/afpfs-ng
cd afpfs-ng
./configure
make
sudo make install

然后尝试运行它,但出现错误:

$ mount_afp afp://192.168.1.13/Documents docs/
mount_afp: error while loading shared libraries: libafpclient.so.0: cannot open shared object file: No such file or directory

任何建议将不胜感激。

networking
  • 2 个回答
  • 14750 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve