Friday, 28 June 2013

You (root) are not allowed to access to (crontab) because of pam configuration.


Error Massage :

# crontab -e
    Permission denied
    You (root) are not allowed to access to (crontab) because of pam configuration.

Solution :

open with vi /etc/pam.d/crond
#
# The PAM configuration file for the cron daemon
#
#
# No PAM authentication called, auth modules not needed
account    required   pam_access.so
to
#account    required   pam_access.so

account    include    password-auth
session    required   pam_loginuid.so
session    include    password-auth
auth       include    password-auth

Problem would be resolved.
~                                  

Wednesday, 26 June 2013

How to compress and extract zip, tar , tar.gz and tar.bz2 in Linux/RHEL/Centos


ZIP : Compress and extract zip file in Linux

Compress file and folder with zip

# zip -r archive-name.zip directory_name

extract file and folder with zip
#unzip archive-name.zip

TAR: Compress and extract TAR file in Linux

Compress file and folder with tar
# tar -cvf archive-name.tar directory_name

extract file and folder with tar
# tar -xvf archive-name.tar

Define location where you want to extract

# tar -xvf archive-name.tar -C /home/extract-here/

TAR.GZ: Compress and extract TAR.GZ file in Linux

Compress file and folder with tar.gz
# tar -zcvf archive-name.tar.gz directory_name

extract file and folder with tar
# tar -zxvf archive-name.tar.gz

Define location where you want to extract

# tar -zxvf archive-name.tar.gz -C /tmp/extract_here/

TAR.BZ2: Compress and extract TAR.BZ2 file in Linux

Compress file and folder with tar.bz2
# tar -jcvf archive-name.tar.bz2 directory_name

extract file and folder with tar
# tar -jxvf archive-name.tar.bz2

Define location where you want to extract

# tar -jxvf archive-name.tar.bz2 -C /tmp/extract_here/

Configure Limit all SSH users to access from specific IP


Confiure Limit all SSH users to access from specific IP
1.       Step :
vi   /etc/security/access.conf  and make changes:

# This term will be evaluated by string matching.
# comment: It might be better to use network/netmask instead.
#          The same is 192.168.201.0/24 or 192.168.201.0/255.255.255.0
#+ : root : 192.168.1. 10.201.5.0. 125.15.62.   (required network)
to
+ : root : 192.168.1. 10.201.5.0. 125.15.62.  
#
# User "root" should be able to have access from domain.
# Uses string matching also.
#+ : root : .foo.bar.org
#
# User "root" should be denied to get access from all other sources.
#- : root : ALL
to
- : root : ALL
#
# User "foo" and members of netgroup "nis_group" should be

2.  step open ssh pam file
vi /etc/pam.d/sshd
auth       required     pam_sepermit.so
auth       include      password-auth
account    required     pam_access.so   ( add this line)
account    required     pam_nologin.so
account    include      password-auth
password   include      password-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    required     pam_loginuid.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open env_params
session    optional     pam_keyinit.so force revoke
session    include      password-auth

#/etc/inid.d/sshd restart

 

 

Wednesday, 19 June 2013

Check Hardware RAID configuration command in Linux



Using SAS drive :
  #cd /proc/driver/cciss/
  #cat cciss0
 
Using SCSI drive :
#cat /proc/scsi/scsi


Thursday, 6 June 2013

The requested URL returned error: 404" Trying other mirror

Problem when install and remove any package in linux

http://repos.fedorapeople.org/repos/peter/erlang/epel-6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404" Trying other mirror.

Solution :

remove repos form repository:

# cd cd /etc/yum.repos.d/
#rm epel-erlang.repo
#yum install java( which package you want install)

Reset Grace Period of Windows Server 2012 RDS

Error: the remote session was disconnected because there are no remote desktop license servers available to provide license in aws Solu...