Comments on: How to Use Encrypted Password in Linux Bash Shell Script https://www.linuxtechi.com/encrypted-password-bash-shell-script/ Wed, 12 Jul 2023 07:21:20 +0000 hourly 1 By: Damien https://www.linuxtechi.com/encrypted-password-bash-shell-script/#comment-55783 Wed, 12 Jul 2023 07:21:20 +0000 https://www.linuxtechi.com/?p=12592#comment-55783 I’m interested if this can be used locally with sudo? So I have a script that runs without terminal using a GUI with only a few limited operations needing root for file access. I’ve found sudo is only reliable across versions when using the -S switch but this always needs a clear text password. One idea I had is using OpenSSL like the above to encrypt a piped password using a random key and then use the key each time to decode it when needed. But, I started off with both a pass code and key in variables, so they are still in the same unprotected place. I wonder then if it would be safer to save the code to a temporary file instead? A slight issue I see with saving and then chmodding a file is that a file could be intercepted before the permissions are set. It would be good to specify this but that is the limits of redirection I suppose.

]]>
By: Himanshu https://www.linuxtechi.com/encrypted-password-bash-shell-script/#comment-51270 Mon, 03 Apr 2023 11:45:09 +0000 https://www.linuxtechi.com/?p=12592#comment-51270 ssh -o StrictHostKeyChecking=no in this -o is not fond is anyone help.

]]>
By: Zerik https://www.linuxtechi.com/encrypted-password-bash-shell-script/#comment-50020 Sat, 04 Mar 2023 17:17:37 +0000 https://www.linuxtechi.com/?p=12592#comment-50020 In reply to Joe.

I was planning to ask the user for the secret password before decrypting the file. Or maybe use a public key of some kind.

]]>
By: Pradeep Kumar https://www.linuxtechi.com/encrypted-password-bash-shell-script/#comment-49460 Mon, 20 Feb 2023 04:52:56 +0000 https://www.linuxtechi.com/?p=12592#comment-49460 In reply to Joe.

Hi Joe,

From security point of view, using encrypted password in shell script play an important role.

]]>
By: Joe https://www.linuxtechi.com/encrypted-password-bash-shell-script/#comment-49423 Sun, 19 Feb 2023 09:00:16 +0000 https://www.linuxtechi.com/?p=12592#comment-49423 What is the advantage of encrypting the original password but including the decryption password?

]]>
By: Andrew https://www.linuxtechi.com/encrypted-password-bash-shell-script/#comment-23767 Wed, 13 Oct 2021 06:44:59 +0000 https://www.linuxtechi.com/?p=12592#comment-23767 thanks, I found this very easy to follow. Got it all working in about 10 mins. Much better than cleartext passwords 🙂

]]>