November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

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 […]

Puppet 3.7.1 on CentOS 6.5

Puppet 3.7.1 on CentOS 6.5 quick start – I

All below doc is from or based on https://docs.puppetlabs.com/

1. Basic Install

1.1 install OS and prepare the node

1.1.1 Network Layout and install OS

Name IP OS Desc puppet01 192.168.1.10 CentOS 6.5 puppet master puppet02 192.168.1.20 CentOS 6.5 puppet client puppet03 192.168.1.30 CentOS 5.10 puppet […]

hostnamectl and timedatectl and date and HWCLOCK

Modify CentOS 7 hostname

In CentOS, there are three definitions hostname: static (static), transient (transient), and flexible (pretty). “Static” host name is also called kernel hostname, is the system at boot time from /etc/hostname automatic initialization of the host name. “Transient” host name is in the system is running temporarily assigned host name, for example, […]

RAID

RAID

A soft RAID vs Hard RAID: a> Software RAID is an abstraction layer in an OS between physical and logical disk, and this abstraction layer will consume some CPU resources. Hardware RAID is not the problem; b> can support hot-swappable RAID hard disks, the benefits of this can be brought online to replace a […]

TAR data over SSH and SCP

The GNU version of the tar archiving utility (and other old version of tar) can be use through network over ssh session.

1. Tarred file transfer Scp is very inefficient when copying many small files because it sets up a separate transfer for each file. It is possible to solve this problem by creating a […]

Linux Troubleshooting Commands

Biggest 10 Files du -sh * | sort -n | tail du -x -a . | sort -n -r | head -n 10

List All the Process By memory usage ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10 ps -eo pcpu,pid,user,args | […]

TOP 12 ‘PS’ PERFORMANCE COMMANDS

TOP 12 ‘PS’ PERFORMANCE COMMANDS

admin@UM 02:03 AIX, Unix I use following ps commands in order to check for performance probelms: 1) Displaying top CPU_consuming processes:

# ps aux|head -1; ps aux|sort -rn +2|head -10 2) Displaying top 10 memory-consuming processes:

# ps aux|head -1; ps aux|sort -rn +3|head 3) Displaying process in order […]

LINUX MEMORY

Find Memory Usage

System memory used and free

Total Used and Free Memory in MBytes (in that order)

free -m|grep “buffers/cache”|cut -d”:” -f2 Memory by Process

Raw

ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS Human readable

ps -e -orss=,args= | sort -b -k1,1n | awk ‘{ split( “KB MB GB” , v […]