简体   繁体   English

限制 Ubuntu 用户权限

[英]Restrict Ubuntu user permissions

I am using Ubuntu 20.04 to host my application.我正在使用 Ubuntu 20.04 来托管我的应用程序。 The device that hosts the application will deliver to the client, meaning I would like to strip the regular desktop user from every permission.托管应用程序的设备将交付给客户端,这意味着我想剥夺普通桌面用户的所有权限。 After a research, I added to the user .bashrc file false aliases something like:经过研究,我向用户 .bashrc 文件添加了错误别名,例如:

alias ls="printf ''"别名 ls="printf ''"

The problem is that the user can still write every command under a specific path:问题是用户仍然可以在特定路径下编写每个命令:

bin/su bin/cd斌/苏斌/cd

This way he has complete power over the system.这样他就拥有了对系统的完全控制权。 I would love to get some help with this issue.我很想在这个问题上得到一些帮助。 Thank you all!谢谢你们!

solution for restrict the terminal Create a group for terminal users限制终端的解决方案为终端用户创建一个组

addgroup terminalusers
usermod -a -G terminalusers <user>
chown root:terminalusers /usr/bin/mate-terminal
chmod 750 /usr/bin/mate-terminal

After this process, the terminal would be blocked Buenos - you can block every application you want with the command which在此过程之后,终端将被阻止 Buenos - 您可以使用以下命令阻止您想要的每个应用程序

This should do这应该做

addgroup <group-username>
usermod -a -G <group-username> <user>
chown root:<group-username> /usr/bin/<terminal-name>
chmod 750 /usr/bin/bash #permissions can be as per requirement like 760 etc

Ubuntu uses bash. Ubuntu 使用 bash。 On other distros we may have to see which shell and terminal they use eg gnome version of ubuntu has gnome terminal and bash.在其他发行版上,我们可能需要查看它们使用的 shell 和终端,例如 ubuntu 的 gnome 版本具有 gnome 终端和 bash。 Kali has zsh (which I think is better). Kali 有 zsh(我认为它更好)。

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

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