Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# file descriptor
# Change 400000 to increase or decrease number of file descriptor
echo "* soft nofile 400000" >> /etc/security/limits.conf
echo "* hard nofile 400000" >> /etc/security/limits.conf
# Changing kernal parameters (modify value if required)
@prafulbagai
prafulbagai / secure.sh
Last active March 26, 2017 15:22
secure your CentOS machine
#!/bin/bash
# Script to add a user to Linux system
if [ $(id -u) -eq 0 ]; then
# If user & pass not provided in command line arguments, then ask.
if [[ -z "$1" && -z "$2" ]]; then
read -p "Enter username : " username
read -s -p "Enter password : " password
else
username="$1"