version=pmwiki-2.2.130 ordered=1 urlencoded=1 agent=Mozilla/5.0 (X11; OpenBSD amd64; rv:82.0) Gecko/20100101 Firefox/82.0 author=jrmu charset=UTF-8 csum= ctime=1604495914 host=125.231.63.134 name=Openbsd.Passwords rev=3 targets= text=(:title Password Management:)%0a%0aPassword management is a critical role for any sysadmin. These four functions can help you with password management.%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 -rc -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}%0a@]%0a%0aTo use the functions, first source the file:%0a%0a[@%0a$ . .profile%0a@]%0a%0aAfterwards, type the function in the command line:%0a%0a[@%0a$ newpass%0a@] time=1609676431 title=Password Management author:1609676431=jrmu diff:1609676431:1604503664:=8c8%0a%3c # Generates a new random password 80 chars in length%0a---%0a> # Generates a new alphanumeric password 80 chars in length%0a10,14d9%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 host:1609676431=125.231.63.134 author:1604503664=jrmu diff:1604503664:1604495914:=29,35c29,30%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---%0a> To use the functions, simply type them in the command line:%0a> %0a host:1604503664=38.81.163.7 author:1604495914=jrmu diff:1604495914:1604495914:=1,33d0%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 alphanumeric password 80 chars in length%0a%3c function newpass {%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, simply type them in the command line:%0a%3c %0a%3c [@%0a%3c $ newpass%0a%3c @]%0a\ No newline at end of file%0a host:1604495914=38.81.163.7