December 2014
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  

Categories

December 2014
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  

How to Remove commands from your history

How to remove if your typed password or sensitive information in your command console.

[root@linux1 ~]#history 1 history 2 mypassword 3 otherpassword 4 ls -la 5 sudo rm -f /home/

Remove sensitive command with numbered entry.

[root@linux1 ~]#history -d 2

[root@linux1 ~]#history 1 history 2 otherpassword 3 ls -la 4 sudo rm -f /home/

[…]

How to Change Username in Linux

How to Change Username in Linux

-l, –login NEW_LOGIN The name of the user will be changed from LOGIN to NEW_LOGIN. Nothing else is changed. In particular, the user´s home directory name should probably be changed manually to reflect the new login name.

Example:

Change existing username account from alice to tom:

usermod -l <new_login> […]

Unlock account in linux using pam_tally2

DESCRIPTION This module maintains a count of attempted accesses, can reset count on success, can deny access if too many attempts fail.

pam_tally2 comes in two parts: pam_tally2.so and pam_tally2. The former is the PAM module and the latter, a stand-alone program. pam_tally2 is an (optional) application which can be used to interrogate and manipulate […]

tee command and examples

NAME tee – read from standard input and write to standard output and files

SYNOPSIS tee [OPTION]… [FILE]…

DESCRIPTION Copy standard input to each FILE, and also to standard output. -a, –append append to the given FILEs, do not overwrite -i, –ignore-interrupts ignore interrupt signals –help display this help and exit –version output version information […]

find Unauthorized SUID/SGID System Executables and fix them

find Unauthorized SUID/SGID System Executables and fix them.

The following command discovers and prints any setuid or setgid files on local partitions. Run it once for each local partition PART:

# find PART -xdev \( -perm -4000 -o -perm -2000 \) -type f -print

If the file does not require a setuid or setgid […]

convert F-Secure/Tectia SSH format to OpenSSH format?

Solutions: To convert F-Secure public key to OpenSSH format # ssh-keygen -i -f path/to/public.key >> path/to/new/opensshpublic.key

To convert F-Secure private key to OpenSSH format # ssh-keygen -i -f path/to/private.key > path/to/new/opensshprivate.key

To convert OpenSSH public/private key to another commercial key. Public key conversion: # ssh-keygen -e -f path/to/opensshpublic.key > path/to/publickey.key

Private key conversion: # ssh-keygen […]

Setup Umask

The default umask for Solaris 10 and Ubuntu normal useris 0022, however default umask for CentOS normal user account is 0002. Hence default directory permissions are 775 and file permission are 664.

The umask creation of new executable file is calculated as follows:

Default permissions 777 subtract umask value 022 Allowed permissions 755

The umask […]

Red Hat Enterprise Linux 6 Security TIPS and Hardening

 

Rules In Pre-release Final STIG for Red Hat Enterprise Linux 6

 

V-ID CCI CAT Title Description Check Procedures Fixtext RHEL-06-000001 CCI-000366 low The system must use a separate file system for /tmp. The /tmp partition is used as temporary storage by many programs. Placing /tmp in its own partition enables the setting of […]