Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Generate random passwords of arbitrary length
- # - with no arguments genpasswd will produce a 20 character random password
- # - genpasswd alos accepts an integer value to produce random passwords of
- # arbitrary length (within the limits of the random source)
- create_passwd ()
- {
- local i=$1
- [ "$i" == "" ] && i=20
- # uses /dev/random as the random source - slower 'more random'
- # tr -dc A-Za-z0-9_ < /dev/random | head -c ${i} | xargs
- # uses /dev/urandom as the random source- faster 'less random'
- tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${i} | xargs
- }
- # Generate ssh key pairs
- # - requires ssh-keygen
- # - generates strong key pairs
- # - key pairs are uniquely identifiable
- create_ssh ()
- {
- ssh-keygen -b 4096 -v -C "$(whoami)@$(hostname) $(date +"%F-%T (%A %B %d %Y %H:%M %Z %z)")"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement