Ubuntu 20.04 登录时没有“查看密码”选项

Ubuntu 20.04 登录时没有“查看密码”选项

有没有办法禁用登录屏幕上的眼睛图标,以防止有人“意外”打开它,从而将密码暴露在外?谢谢!

答案1

假设您全新安装了 Ubuntu 20.04,解决方法是将眼睛图标大小设置为 1px,以使其不可见且不具有反应性。

使用解决方法

使用以下命令从 github 下载脚本。

wget -qO - https://github.com/PRATAP-KUMAR/focalgdm3/archive/remove-eye-icon.tar.gz | tar zx --strip-components=1 focalgdm3-remove-eye-icon/focalgdm3

运行命令

sudo ./focalgdm3 \#4f194c

您可以选择将上述命令中的颜色更改为任意颜色,或者如果您希望将图像作为背景,则可以用图像的绝对路径#4f194c替换颜色。\#4f194c

在此处输入图片描述

恢复正常

运行命令

sudo ./focalgdm3 --reset

以上仅适用于登录屏幕..而不适用于锁定屏幕,要对锁定屏幕使用相同的主题文件,我们需要单独进行配置。


为锁屏配置相同的文件

使用以下命令将用于登录屏幕的 gresource 文件复制到系统默认文件夹

sudo cp /usr/local/share/gnome-shell/theme/custom/custom-gnome-shell-theme.gresource /usr/share/gnome-shell/theme/Yaru/

在此处输入图片描述

$ ls /usr/share/gnome-shell/theme/Yaru/
custom-gnome-shell-theme.gresource  gnome-shell-theme.gresource
$ 

现在,为了摆脱系统升级带来的改变,请制作该文件的本地副本/usr/share/gnome-shell/modes/ubuntu.json

sudo mkdir -p /usr/local/share/gnome-shell/modes
cp /usr/share/gnome-shell/modes/ubuntu.json /usr/local/share/gnome-shell/modes

打开文件ubuntu.json

sudo -H gedit /usr/local/share/gnome-shell/modes/ubuntu.json

现在编辑ubuntu.json文件以使用gdm3.css包含以下内容的登录屏幕文件。

{
    "parentMode": "user",
    "stylesheetName": "gdm3.css",
    "themeResourceName": "theme/Yaru/custom-gnome-shell-theme.gresource",
    "debugFlags": ["backtrace-crashes-all"],
    "enabledExtensions": ["[email protected]", "[email protected]", "desktop-icons@csoriano"]
}

现在重新启动以查看更改..

在此处输入图片描述

要恢复正常,请删除我们为锁屏目的创建的两个文件。

sudo rm /usr/local/share/gnome-shell/modes/ubuntu.json /usr/share/gnome-shell/theme/Yaru/custom-gnome-shell-theme.gresource

参考:
如何在 Ubuntu 20.04 中更改登录屏幕主题或背景?
如何在 Ubuntu 20.04 中自定义锁屏主题

相关内容