[Newbies] 如何禁止用户安装程序
Tofloor
poster avatar
zhichiguochanadd1
deepin
2021-06-01 00:40
Author

百度了一圈没找到答案,想问一下各位大佬,添加了多个用户之后,如何禁止其中的一些用户安装软件(包括从应用商店安装,或者直接禁止他们使用应用商店),禁止另一些用户运行opt下面的某些程序?

Reply Favorite View the author
All Replies
SamLukeYes
deepin
2021-06-01 01:03
#1

直接把应用商店卸载就行了。不通过应用商店在全局安装软件都是需要管理员密码的。

Reply View the author
Feng Yu
deepin
2021-06-01 01:39
#2

安装软件包需要sudo权限,你添加普通用户之后不给sudo权限不就完了?这样用户只能用已经安装好的软件,不能安装全局软件

Reply View the author
zhichiguochanadd1
deepin
2021-06-01 01:47
#3

两位有道理啊,是这么个逻辑,怎么就没想到

Reply View the author
zhichiguochanadd1
deepin
2021-06-01 04:44
#4
Feng Yu

安装软件包需要sudo权限,你添加普通用户之后不给sudo权限不就完了?这样用户只能用已经安装好的软件,不能安装全局软件

我把用户从sudo组删除之后,还是可以从应用商店安装程序

Reply View the author
Feng Yu
deepin
2021-06-01 06:30
#5
zhichiguochanadd1

我把用户从sudo组删除之后,还是可以从应用商店安装程序

那就没办法了,看了下deepin-app-store的进程,它为了让用户不用输入密码,会以root身份运行一个daemon,以绕过密码确认,以前很老的版本会要求用户自己输入密码以提权,甚至别的Linux发行版的软件中心也都会这么设计

Reply View the author
deepinuser17
deepin
2021-06-01 07:57
#6

可以试试这个方法: 用文件许可限制来阻止其他用户运行应用商店程序.

 

系统初始状态:

$ ls -lh /usr/bin/deepin-app-store
-rwxr-xr-x 1 root root 1.1M Feb  2 21:17 /usr/bin/deepin-app-store

$ getfacl /usr/bin/deepin-app-store
getfacl: Removing leading '/' from absolute path names
# file: usr/bin/deepin-app-store
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

 

创建一个用户租, 把不允许运行应用商店的用户加到这个组里.  例如组名, nostore.

然后修改/usr/bin/deepin-app-store文件许可如下:

$ getfacl /usr/bin/deepin-app-store
getfacl: Removing leading '/' from absolute path names
# file: usr/bin/deepin-app-store
# owner: root
# group: root
user::rwx
group::r-x
group:nostore:---
other::r-x

具体操作步骤可以参考以下链接:

https://debian.cn/articles/383?www

https://blog.csdn.net/weixin_34327223/article/details/92727492

 

上网搜索关键字, debian, setfacl, getfacl

Reply View the author
zhichiguochanadd1
deepin
2021-06-01 21:02
#7
deepinuser17

可以试试这个方法: 用文件许可限制来阻止其他用户运行应用商店程序.

 

系统初始状态:

$ ls -lh /usr/bin/deepin-app-store
-rwxr-xr-x 1 root root 1.1M Feb  2 21:17 /usr/bin/deepin-app-store

$ getfacl /usr/bin/deepin-app-store
getfacl: Removing leading '/' from absolute path names
# file: usr/bin/deepin-app-store
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

 

创建一个用户租, 把不允许运行应用商店的用户加到这个组里.  例如组名, nostore.

然后修改/usr/bin/deepin-app-store文件许可如下:

$ getfacl /usr/bin/deepin-app-store
getfacl: Removing leading '/' from absolute path names
# file: usr/bin/deepin-app-store
# owner: root
# group: root
user::rwx
group::r-x
group:nostore:---
other::r-x

具体操作步骤可以参考以下链接:

https://debian.cn/articles/383?www

https://blog.csdn.net/weixin_34327223/article/details/92727492

 

上网搜索关键字, debian, setfacl, getfacl

感谢感谢,成功解决问题

Reply View the author