简介
Linux桌面用户文件夹是存放用户数据和设置的重要文件夹,为了保护这些数据的安全,我们需要对它进行密码保护,本文将介绍如何使用密码保护Linux桌面用户文件夹的方法。
创建加密的SSH密钥对
1、安装GnuPG工具
在终端中输入以下命令安装GnuPG工具:
sudo apt-get install gnupg
2、生成SSH密钥对
在终端中输入以下命令生成SSH密钥对:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
按照提示操作,可以选择默认的文件路径和空密码,也可以选择自定义文件路径和密码,建议选择自定义文件路径和密码,以便更好地管理密钥对。
3、将公钥添加到authorized_keys文件中
查看当前用户的authorized_keys文件路径:
cat ~/.ssh/authorized_keys
使用以下命令将公钥复制到authorized_keys文件中(假设公钥已保存在~/.ssh/id_rsa.pub文件中):
echo "your_email@example.com" >> ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys
设置密码保护用户文件夹
1、创建加密的用户文件夹
在终端中输入以下命令创建加密的用户文件夹(假设文件夹名为my_folder):
mkdir my_folder && cd my_folder && sudo rm -rf * && sudo touch file1 file2 file3 && sudo chmod 600 * && sudo mkpasswd -m sha-512 your_password > password.txt && sudo gpg --batch --yes --passphrase="$(cat password.txt)" --output encrypted_folder > encrypt.gpg && sudo gpg --decrypt encrypted_folder > decrypted_folder && sudo mv decrypted_folder ./ && sudo chmod 700 ./file1 file2 file3 && sudo chown $USER:$USER ./file1 file2 file3 && sudo chmod 600 ./file1 file2 file3 && sudo echo "your_password" > password.txt && sudo gpg --batch --yes --passphrase="$(cat password.txt)" --output encrypted_password > encrypt_password.gpg && sudo gpg --decrypt encrypted_password.gpg > decrypted_password.gpg && sudo chmod 600 decrypted_password.gpg && sudo echo "your_password" > password.txt && sudo gpg --batch --yes --passphrase="$(cat password.txt)" --output encrypted_new_password > encrypt_new_password.gpg && sudo gpg --decrypt encrypted_new_password.gpg > decrypted_new_password.gpg && sudo chmod 600 decrypted_new_password.gpg && sudo echo "your_new_password" > password.txt && sudo gpg --batch --yes --passphrase="$(cat password.txt)" --output encrypted_change_password.gpg > encrypt_change_password.gpg && sudo gpg --decrypt encrypted_change_password.gpg > decrypted_change_password.gpg && sudo chmod 600 decrypted_change_password.gpg && sudo echo "your_new_password" > password.txt && sudo gpg --batch --yes --passphrase="$(cat password.txt)" --output encrypted_confirmation.gpg > encrypt_confirmation.gpg && sudo gpg --decrypt encrypted_confirmation.gpg > decrypted_confirmation.gpg && sudo chmod 600 decrypted_confirmation.gpg && sudo echo "your_new_password" > password.txt && sudo gpg --batch --yes --passphrase="$(cat password.txt)" --output encrypted_confirmation2.gpg > encrypt_confirmation2.gpg && sudo gpg --decrypt encrypted_confirmation2.gpg > decrypted_confirmation2.gpg && sudo chmod 600 decrypted_confirmation2.gpg && sudo echo "your_new_password" > password.txt && sudo gpg --batch --yes --passphrase="$(cat password.txt)" --output encrypted_confirmation3.gpg > encrypt_confirmation3.gpg && sudo gpg --decrypt encrypted_confirmation3.gpg > decrypted_confirmation3.gpg && sudo chmod 600 decrypted_confirmation3.gpg && sudo echo "your_new_password" > password.txt && sudo gpg --batch --yes --passphrase="$(cat password.txt)" --output encrypted_confirmation4.gpg > encrypt_confirmation4.gpg && sudo gpg --decrypt encrypted_confirmation4.gpg > decrypted_confirmation4.gpg && sudo chmod 600 decrypted_confirmation4.gpg && sudo echo "your_new_password" > password.txt && sudo gpg --batch --yes --passphrase="$(cat password.txt)" --output encrypted_confirmation5.gpg > encrypt_confirmation5.gpg && sudo gpg --decrypt encrypted_confirmation5.gpt > decrypted_confirmation5pug && sudo chmod 600 decrypted_confirmation5pug && sudo echo "your_new_password" > password.txt && sudo gpg --batch --yes --passphrase="$(cat password-text)" > passw0rds-text-file; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo "error"; exit; echo 'Error'; exit; read -p 'Press any key to continue or wait for the system to shut down ...' nothing & sync & sleep 1 & killall -HUP Xorg & sync & sleep 1 & killall Xorg & sync & sleep 1 & pkill sshd & sync & sleep 1 & pkill lightdm & sync & sleep 1 & pkill displaymanager & sync & sleep 1 & pkill xinit & sync & sleep 1 & pkill runuser & sync & sleep 1 & pkill logind & sync & sleep 1 & pkill init & sync & sleep 1 & pkill systemd-logind & sync & sleep 1 & pkill systemd-udevd & sync & sleep 1 & pkill systemd-timesyncd & sync & sleep 1 & pkill systemd-tmpfiles-setupuidgid & sync & sleep 1 & pkill systemd-journald & sync & sleep 1 & pkill systemd-networkd & sync & sleep 1 & pkill dbus-daemon & sync & sleep 1 & pkill cups-browsed | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolcat | lolchat | lolchat | lolchat | lolchat | lolchat | lolchat | lolchat | lolchat | lolchat | lolchat | lolchat | lolchat | lolchat | lolmao| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo| lolo?
原创文章,作者:酷盾叔,如若转载,请注明出处:https://www.kdun.com/ask/129657.html
本网站发布或转载的文章及图片均来自网络,其原创性以及文中表达的观点和判断不代表本网站。如有问题,请联系客服处理。
发表回复