Posts

Showing posts with the label random password

Linux Tricks

Here are some of the tricks, i'll keep it updating as i'll get something new. Cheers :) 1 . use "ftp 0" or "ssh 0" command instead of typing "ftp 0.0.0.0" or "ssh localhost" or "ftp localhost" for quickly testing newly configured ftpd or sshd service. 2 . See memory and rss usage on your system: #watch ps -A --sort -rss -o pid,comm,pmem,rss 3 . Sample random password generator (put in your ~/.bashrc): genpasswd ( ) { local l= $1 [ "$l" == "" ] && l= 20 tr - dc A-Za-z0-9_ < /dev/urandom | head -c $ { l } | xargs } Run it: genpasswd 16 Output: uw8CnDVMwC6vOKgW 4. You can configure any Linux system to automatically log users out after a period of inactivity. Simply login as the root user and create a file called /etc/profile.d/autologout.sh, # vi /etc/profile.d/autologout.sh Append the following code: TMOUT= 300 readonly TMOUT export T...