encryptedpw.sh

来自「Shall高级编程」· Shell 代码 · 共 47 行

SH
47
字号
#!/bin/bash# Example "ex72.sh" modified to use encrypted password.#  Note that this is still rather insecure,#+ since the decrypted password is sent in the clear.#  Use something like "ssh" if this is a concern.E_BADARGS=65if [ -z "$1" ]then  echo "Usage: `basename $0` filename"  exit $E_BADARGSfi  Username=bozo           # Change to suit.pword=/home/bozo/secret/password_encrypted.file# File containing encrypted password.Filename=`basename $1`  # Strips pathname out of file name.Server="XXX"Directory="YYY"         # Change above to actual server name & directory.Password=`cruft <$pword`          # Decrypt password.#  Uses the author's own "cruft" file encryption package,#+ based on the classic "onetime pad" algorithm,#+ and obtainable from:#+ Primary-site:   ftp://ibiblio.org/pub/Linux/utils/file#+                 cruft-0.2.tar.gz [16k]ftp -n $Server <<End-Of-Sessionuser $Username $Passwordbinarybellcd $Directoryput $FilenamebyeEnd-Of-Session# -n option to "ftp" disables auto-logon.# Note that "bell" rings 'bell' after each file transfer.exit 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?