Categories

rsync + inotify

rsync + inotify is a more commonly used real-time synchronization solution, but it is not applicable in all the scenes,

rsync + inotify more suitable for the following 10 small-scale web cluster in real-time synchronization, but in the use of rsync + inotify solution and the use of rsync daily, rsync + inotify rsync server […]

OpenSSH Server Best Security Practices

OpenSSH server is the standard SSH client and server. OpenSSH is suggested for remote login, transfer file by means of SCP or SFTP, and a much more. SSH is perfect to keep confidentiality and integrity for data exchanged between two systems and networks. OpenSSH encrypts all traffic and password to effectively eliminate with assaults. In […]

expect,sshpass,pash

expect,sshpass,pash rpm -qa expect

yum install expect -y

useradd mohan

echo 123456|passwd –stdin mohan

su – mohan

ssh-keygen -t dsa -P ” -f ~/.ssh/id_dsa >/dev/null 2>&1

yum install lrzsz -y

cat mohan_sshkey.exp #!/usr/bin/expect if { $argc !=2 } { send_user “usage: expect mohan_sshkey.exp file host\n” exit } […]

expect,sshpass,pash

expect,sshpass,pash rpm -qa expect

yum install expect -y

useradd mohan

echo 123456|passwd –stdin mohan

su – mohan

ssh-keygen -t dsa -P ” -f ~/.ssh/id_dsa >/dev/null 2>&1

yum install lrzsz -y

cat mohan_sshkey.exp #!/usr/bin/expect if { $argc !=2 } { send_user “usage: expect mohan_sshkey.exp file host\n” exit } #define var set file [lindex $argv 0] set […]

pvresize command

Resolution

pvresize is a tool to resize Physical Volume which may already be in a volume group and have active logical volumes allocated on it.

Expand the PV on /dev/sda1 after enlarging the partition with fdisk:

pvresize /dev/sda1

Shrink the PV on /dev/sda1 prior to shrinking the partition with fdisk (ensure that the PV size […]

SSH vulnerabilities: HMAC algorithms and CBC ciphers

e defaults in the various RHEL version differ and the current default can be found in manual page for sshd_config. For example RHEL6:

The default is: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128, aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc, aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se

You can remove the CBC ciphers by adding the line for RHEL7:

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,arcfour

The line for RHEL6:

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,arcfour

The line for RHEL5 (note the order of ciphers – the […]

Changing temporary directory for sort – bash

I was sorting a very big file using Linux sort command and unfortunately the sort failed as there was not enough space on my /tmp directory.

$ sort -t “|” -k5 ka.log.32323112.out > ka.log.32323112.out sort: /tmp/sort1928700448: write error: No space left on device

just to mention, sort by default uses /tmp for temporaries.

So, how you […]

find large files on Linux

Find large files on Fedora / CentOS / RHEL

Search for big files (50MB or more) on your current directory:

find ./ -type f -size +50000k -exec ls -lh {} ; | awk ‘{ print $9 “: ” $5 }’

Output:

[root@my.server.com:~]pwd /home [root@my.server.com:~]find . -type f -size +50000k -exec ls -lh {} ; | […]

Samba in CentOS 6.8 as Secondary DC with Microsoft Active Directory 2012R2

1 . https://bugzilla.samba.org/show_bug.cgi?id=10265 It’s necessary to manually lower the domain and forest functional levels on the Windows 2012 server first, via Powershell: Set-ADForestMode -Identity “mydom.local” -ForestMode Windows2008R2Forest Set-ADDomainMode -Identity “mydom.local” -DomainMode Windows2008R2Domain 2. Need a fresh installed minimal CentOS 6.x OS . Disable SELinux and firewall . Update software packages . Please check above notes […]

grubby fatal error: unable to find a suitable template

grubby fatal error: unable to find a suitable template

Updating   : selinux-policy-3.7.19-292.el6_8.3.noarch                                                                                                             8/28 Updating   : selinux-policy-targeted-3.7.19-292.el6_8.3.noarch                                                                                                    9/28 Installing : kernel-2.6.32-642.15.1.el6.x86_64                                                                                                                   10/28 grubby fatal error: unable to find a suitable template Updating   : ntp-4.2.6p5-10.el6.centos.2.x86_64                                                                                                                  11/28 Updating   : libtiff-3.9.4-21.el6_8.x86_64                                                                                                                       12/28 Updating   : kernel-headers-2.6.32-642.15.1.el6.x86_64                                                                                                           13/28 Updating   : tzdata-2017a-1.el6.noarch                                                                                                                           14/28 Cleanup    : kernel-2.6.32-573.26.1.el6.x86_64                                                                                                                   15/28 warning:    erase unlink of /lib/modules/2.6.32-573.26.1.el6.x86_64/weak-updates […]

Page 1 of 2112345...1020...Last »