Friday, August 24, 2012

Request for a certficate with multiple DNS names


We can secure a larger number of domains with only one certificate.

On the basis of this concept I installed single certificate on more then one websites.

To request a certificate which includes more than one FQDN (fully qualified domain name), We need to create a specially formatted CSR with more than one commonName (CN) in its subject.

Below are the steps to create and sign such certificate.

Step 1) Create a private key for requesting a certificate

[root@host2 load]# openssl genrsa -out www.domain.tld.key 2048

Step 2) Generate csr for multiple domains.

[root@host2 load]#openssl req -new -key  www.domain.tld.key -subj "/C=IE/O=inst_name/CN=first_fqdn/CN=second_fqdn/CN=third_fqdn"  -out www.domain.tld.csr

Step 3) As a CA Sign csr to certificate

[root@host2 load]# openssl ca -in www.domain.tld.csr -out www.domain.tld.crt

Wednesday, August 1, 2012

CHATTR & LSATTR COMMAND SYNTEX

Dear friend 
Last day one of my friend who was appearing in RHCE exam face a problem in troubleshooting section
That he was unable to modify /etc/passwd file 

then i suggest him to use
lsattr /etc/passwd 

then he find 
----i--------  /etc/passwd

& then he use

chattr -i /etc/passwd
so i am posting syntax & attributes for chattr command

SYNTAX & COMMAND FOR CHATTR
                 
chattr - change file attributes on a Linux second extended file system
SYNOPSIS
chattr [ -RV ] [ -v version ] [ mode ] files...
DESCRIPTION
chattr changes the file attributes on a Linux second extended file system. 

OPTIONS

-R
Recursively change attributes of directories and their contents. Symbolic links encountered during 

recursive directory traversals are ignored. 
-V
Be verbose with chattr's output and print the program version. 
-v version
Set the file's version/generation number. 

Opcodes
+
Add attribute.
-
 Remove attribute.
=
Assign attributes (removing unspecified attributes).


ATTRIBUTES

1) A file with the `i' attribute cannot be modified: it cannot be deleted or renamed, no link can be 

created to this file and no data can be written to the file. Only the superuser or a process pessessing 

the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

2) A file with the `j' attribute has all of its data written to the ext3 journal before being written to 

the file itself, if the filesystem is mounted with the "data=ordered" or "data=writeback" options. When 

the filesystem is mounted with the "data=journalled" option all file data is already journalled and this 

attribute has no effect. Only the superuser or a process possessing the CAP_SYS_RESOURCE capability can 

set or clear this attribute.

3)  When a file with the `s' attribute set is deleted, its blocks are zeroed and written back to the disk.

4) When a file with the `S' attribute set is modified, the changes are written synchronously on the disk; 

this is equivalent to the `sync' mount option applied to a subset of the files. 

5) When a file with the `u' attribute set is deleted, its contents are saved. This allows the user to ask 

for its undeletion. 

6) A file with the `a' attribute set can only be open in append mode for writing. Only the superuser or a 

process pessessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

7) A file with the `c' attribute set is automatically compressed on the disk by the kernel. A read from 

this file returns uncompressed data. A write to this file compresses data before storing them on the 

disk.

8) When a directory with the `D' attribute set is modified, the changes are written synchronously on the 

disk; this is equivalent to the `dirsync' mount option applied to a subset of the files.

9) A file with the `d' attribute set is not candidate for backup when the "dump" program is run. 

Renew k8s certificates

Check If certificate expires: amikum@~:03:06:54(⎈ |local-cluster:default):sudo kubeadm certs check-expiration CERTIFICATE                EXP...