user9853395
user9853395

Reputation: 39

Encrypting a value inside bash script

#!/bin/bash
USERNAME='user'
PASSWORD='1234567890'

printf "$USERNAME\n$PASSWORD" | connect address

How do I encrpyt or hide the value for PASSWORD so that one can't open this bash script file and see the username and password?

Upvotes: 0

Views: 353

Answers (1)

math-s
math-s

Reputation: 145

If you dont want people to open your code you can make a binary from that script:

$ sudo apt install shc     # for debian or debian based
$ shc -f script.sh
$ ls -l script.sh.x

Check https://tecadmin.net/create-binary-file-from-shell-script/

Upvotes: 2

Related Questions