Blame
Date:
Sun Jan 29 05:00:28 2023 UTC
Message:
Daily backup
01
2023-01-22
jrmu
version=pmwiki-2.2.130 ordered=1 urlencoded=1
02
2023-01-22
jrmu
agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36
03
2023-01-22
jrmu
author=izzyb
04
2023-01-22
jrmu
charset=UTF-8
05
2023-01-22
jrmu
csum=Added Usage section with instructions for using the script
06
2023-01-22
jrmu
ctime=1612972788
07
2023-01-22
jrmu
host=68.148.177.239
08
2023-01-22
jrmu
name=Password.Management
09
2023-01-22
jrmu
rev=6
10
2023-01-22
jrmu
targets=
11
2023-01-22
jrmu
text=(:title Password Management:)%0a%0aPassword management is a critical role for any sysadmin. These four functions can help you with password management. They will work in both ksh and bash on openbsd or linux.%0a%0a'''NOTE:''' jot isn't installed by default in Debian Linux. Run this to install it:%0a%0a[@%0aapt install athena-jot%0a@]%0a%0a'''NOTE:''' this is an older version of jot then used in OpenBSD. It doesn't work as expected when combining -r -c to -rc so the code below was modified to be compatible with both.%0a%0a%0a----%0a%0aAppend these lines at the end of ~/.profile:%0a%0a[@%0a# Generates a new random password 80 chars in length%0afunction newpass {%0a jot -r -c -s '' 80 33 127%0a}%0a%0a# Generates a new alphanumeric password 80 chars in length%0afunction alnumpass {%0a cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-80} | head -n 1%0a}%0a%0a# Pages through all your passwords%0afunction getpass {%0a openssl aes-256-cbc -d -a -in $HOME/password.asc | less%0a}%0a%0a# Writes all your passwords to ~/password%0afunction allpass {%0a openssl aes-256-cbc -d -a -in $HOME/password.asc -out $HOME/password%0a}%0a%0a# Takes your passwords in ~/password, encrypts them, then overwrites password.asc%0afunction savepass {%0a openssl aes-256-cbc -a -in $HOME/password -out $HOME/password.asc && rm -P $HOME/password%0a cp $HOME/password.asc $HOME/password.asc.`date "+%25Y%25m%25d"`%0a%0a}%0a@]%0a%0aTo use the functions, first source the file:%0a%0a[@%0a$ . ~/.profile%0a@]%0a%0aType this to view the defined functions%0a%0a[@%0a$ functions%0a@]%0a%0aType the function in the command line:%0a%0a[@%0a$ newpass%0a@]%0a%0a%0a!! Usage%0a%0a''newpass'' and ''alnumpass'' generate passwords and print them to the screen. The specifics are left to the reader to decode from the commands. '''Hint:''' they generate 80 character passwords. Adjust according to your needs.%0a%0aThe remaining functions manage encrypting, decrypting, and displaying a password file using openssl. To use it, first create a file called password in your home directory.%0a%0a[@%0a$ vi ~/password%0a@]%0a%0aPut what you want in this file. There is no set format. Once you're finished editing it, run this to encrypt it.%0a%0a[@%0a$ savepass%0aenter aes-256-cbc encryption password:%0a@]%0a%0aEnter the password you wish to encrypt the file with at the prompt. It will encypt the file to ~/password.asc and create a dated backup file ~/password.asc.%3cdate>. It also deletes ~/password.%0a%0aTo view the contents of your password file type this:%0a%0a[@%0a$ getpass%0a@]%0a%0aThis decrypts the ~/password.asc file and pipes the output to less for viewing on the screen. It isn't obvious, but you are being prompted for the password to decrypt the file. Your input wont be shown on the screen. If you get it right, you'll see the contents of the file, if you get it wrong, you'll see encoded gibberish. It doesn't create a decrypted version of the password file either way. Hit q and enter to quit.%0a%0aTo edit the password file type the following:%0a%0a[@%0a$ allpass%0a@]%0a%0aThis decryptes the file to ~/password so you can edit it's contents. Remember to ''savepass'' again when finished to encrypt the updated file and remove the decrypted version.%0a
12
2023-01-22
jrmu
time=1649905795
13
2023-01-22
jrmu
title=Password Management
14
2023-01-22
jrmu
author:1649905795=izzyb
15
2023-01-22
jrmu
csum:1649905795=Added Usage section with instructions for using the script
16
2023-01-22
jrmu
diff:1649905795:1649736479:=53,54c53,54%0a%3c Type this to view the defined functions%0a%3c %0a---%0a> Afterwards, type the function in the command line:%0a> %0a56c56%0a%3c $ functions%0a---%0a> $ newpass%0a58,99d57%0a%3c %0a%3c Type the function in the command line:%0a%3c %0a%3c [@%0a%3c $ newpass%0a%3c @]%0a%3c %0a%3c %0a%3c !! Usage%0a%3c %0a%3c ''newpass'' and ''alnumpass'' generate passwords and print them to the screen. The specifics are left to the reader to decode from the commands. '''Hint:''' they generate 80 character passwords. Adjust according to your needs.%0a%3c %0a%3c The remaining functions manage encrypting, decrypting, and displaying a password file using openssl. To use it, first create a file called password in your home directory.%0a%3c %0a%3c [@%0a%3c $ vi ~/password%0a%3c @]%0a%3c %0a%3c Put what you want in this file. There is no set format. Once you're finished editing it, run this to encrypt it.%0a%3c %0a%3c [@%0a%3c $ savepass%0a%3c enter aes-256-cbc encryption password:%0a%3c @]%0a%3c %0a%3c Enter the password you wish to encrypt the file with at the prompt. It will encypt the file to ~/password.asc and create a dated backup file ~/password.asc.%3cdate>. It also deletes ~/password.%0a%3c %0a%3c To view the contents of your password file type this:%0a%3c %0a%3c [@%0a%3c $ getpass%0a%3c @]%0a%3c %0a%3c This decrypts the ~/password.asc file and pipes the output to less for viewing on the screen. It isn't obvious, but you are being prompted for the password to decrypt the file. Your input wont be shown on the screen. If you get it right, you'll see the contents of the file, if you get it wrong, you'll see encoded gibberish. It doesn't create a decrypted version of the password file either way. Hit q and enter to quit.%0a%3c %0a%3c To edit the password file type the following:%0a%3c %0a%3c [@%0a%3c $ allpass%0a%3c @]%0a%3c %0a%3c This decryptes the file to ~/password so you can edit it's contents. Remember to ''savepass'' again when finished to encrypt the updated file and remove the decrypted version.%0a
17
2023-01-22
jrmu
host:1649905795=68.148.177.239
18
2023-01-22
jrmu
author:1649736479=izzyb
19
2023-01-22
jrmu
csum:1649736479=Added notes for installing and running jot under linux
20
2023-01-22
jrmu
diff:1649736479:1649646960:=3,6c3,6%0a%3c Password management is a critical role for any sysadmin. These four functions can help you with password management. They will work in both ksh and bash on openbsd or linux.%0a%3c %0a%3c '''NOTE:''' jot isn't installed by default in Debian Linux. Run this to install it:%0a%3c %0a---%0a> Password management is a critical role for any sysadmin. These four functions can help you with password management.%0a> %0a> Append these lines at the end of ~/.profile:%0a> %0a8,18d7%0a%3c apt install athena-jot%0a%3c @]%0a%3c %0a%3c '''NOTE:''' this is an older version of jot then used in OpenBSD. It doesn't work as expected when combining -r -c to -rc so the code below was modified to be compatible with both.%0a%3c %0a%3c %0a%3c ----%0a%3c %0a%3c Append these lines at the end of ~/.profile:%0a%3c %0a%3c [@%0a21c10%0a%3c jot -r -c -s '' 80 33 127%0a---%0a> jot -rc -s '' 80 33 127%0a
21
2023-01-22
jrmu
host:1649736479=68.148.177.239
22
2023-01-22
jrmu
author:1649646960=izzyb
23
2023-01-22
jrmu
csum:1649646960=updated command to source the file to work in ksh
24
2023-01-22
jrmu
diff:1649646960:1642702993:minor=39c39%0a%3c $ . ~/.profile%0a---%0a> $ . .profile%0a
25
2023-01-22
jrmu
host:1649646960=68.148.177.239
26
2023-01-22
jrmu
author:1642702993=jrmu
27
2023-01-22
jrmu
diff:1642702993:1642702736:=31,32c31%0a%3c cp $HOME/password.asc $HOME/password.asc.`date "+%25Y%25m%25d"`%0a%3c %0a---%0a> cp $HOME/password.asc $HOME/password.asc.bak%0a
28
2023-01-22
jrmu
host:1642702993=38.87.162.8
29
2023-01-22
jrmu
author:1642702736=jrmu
30
2023-01-22
jrmu
diff:1642702736:1612972788:=31d30%0a%3c cp $HOME/password.asc $HOME/password.asc.bak%0a45c44%0a%3c @]%0a---%0a> @]%0a\ No newline at end of file%0a
31
2023-01-22
jrmu
host:1642702736=38.87.162.8
32
2023-01-22
jrmu
author:1612972788=jrmu
33
2023-01-22
jrmu
diff:1612972788:1612972788:=1,44d0%0a%3c (:title Password Management:)%0a%3c %0a%3c Password management is a critical role for any sysadmin. These four functions can help you with password management.%0a%3c %0a%3c Append these lines at the end of ~/.profile:%0a%3c %0a%3c [@%0a%3c # Generates a new random password 80 chars in length%0a%3c function newpass {%0a%3c jot -rc -s '' 80 33 127%0a%3c }%0a%3c %0a%3c # Generates a new alphanumeric password 80 chars in length%0a%3c function alnumpass {%0a%3c cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-80} | head -n 1%0a%3c }%0a%3c %0a%3c # Pages through all your passwords%0a%3c function getpass {%0a%3c openssl aes-256-cbc -d -a -in $HOME/password.asc | less%0a%3c }%0a%3c %0a%3c # Writes all your passwords to ~/password%0a%3c function allpass {%0a%3c openssl aes-256-cbc -d -a -in $HOME/password.asc -out $HOME/password%0a%3c }%0a%3c %0a%3c # Takes your passwords in ~/password, encrypts them, then overwrites password.asc%0a%3c function savepass {%0a%3c openssl aes-256-cbc -a -in $HOME/password -out $HOME/password.asc && rm -P $HOME/password%0a%3c }%0a%3c @]%0a%3c %0a%3c To use the functions, first source the file:%0a%3c %0a%3c [@%0a%3c $ . .profile%0a%3c @]%0a%3c %0a%3c Afterwards, type the function in the command line:%0a%3c %0a%3c [@%0a%3c $ newpass%0a%3c @]%0a\ No newline at end of file%0a
34
2023-01-22
jrmu
host:1612972788=198.251.81.119
IRCNow