Linux

Path to ssh configuration file

Openssh config file hath

Where to find the ssh configuration file? More often we forget path of the ssh file. Sorry we remember the ssh file path but we forget ssh configuration file name. Path for ssh config file # /etc/ssh/sshd_config The /etc/ssh/sshd_config in the file path for Openssh. Some time i do configure in  ..

Awk command to print specific line from a file

Use conditional statement on command line

awk command to print specific line from a file $ awk 'FNR==3' <file> Use conditional statement on command line $ awk '{if (NR == 3) print}' <file> Both the above commands will print the third line from the specified file. Sed command to get a specified line $  ..

Ls command to list only directories

Ls command to list directories

Linux ls command to list directories alone Sometime we might need to list only the directories. ls command to list only directories # ls -ad */ The above command will list only the directories and the hidden directories. Output: Desktop/ Documents/ Download/ Music/ Pictures/ ls command to list directories and  ..

How to find dns records using host command

Linux host command to get DNS records

Linux host command Using "host" command we shall easily get the DNS Records - MX, CNAME, A - of a domain. host commands are often used by network or linux admins to find the DNS record's. In normal the dig command is used by most of the Linux admins to find  ..

Shell script to modify directory permission

Change all directory permission

Shell Script to Modify permission of all directories Step 1: create a directory name list eg: if you want to change all public_html directory permission to 755 $ cd /home $ ls > /root/dir_list step2: Copy and past it in the command prompt $ for i  ..

Steps to investigate hacked linux server

Check your server is hacked or not

Steps to investigate hacked linux server Check your server is hacked or not Following are the few to investigate whether the linux server is hacked or not: Follow the steps one by one and analyse or check your linux server is hacked or not. Who is on the Server: $ w $ netstat  ..

What is semaphore

About Semaphores

what is semaphore? Semaphores are used to prevent processes from accessing the same resource, usually shared memory, at the same time.The number of System V semaphores configured for use is controlled by the kernel parameter SEMMNS. SEMMNS Number of semaphores in the system. The default and minimum value is 60. The maximum value  ..

Error ndc connection to remote host closed

Named service down

Error Ndc: connection to remote host closed The error ndc connection to remote host closed indicate's that the remote server is using an older version of the command protocol, this host is not authorized to connect, or the key is invalid. Follow the steps to fix the error connection to remote host  ..

How to change the time zone

Change server to local time

Changing The Timezone In order to change the timezone please make use of the following tips, rm -f /etc/localtime ln -s /usr/share/zoneinfo/Asia/Calcutta /etc/localtime Thats it. In the above example I have chose India as my timezone. You can check your system's timezone in cat /etc/sysconfig/clock   ..

List for requests for comments rfc

Requests for Comments (RFC)

List for Requests for Comments RFC Requests for Comments (RFC) RFC: Requests for Comments -RFCs is an ongoing set of documents issued by the Internet Engineering Task Force -IETF at the Network Information Center -NIC that presents new protocols and establishes standards for the Internet protocol suite. Each such document defines an aspect  ..

Deny ssh access for root user

Disabling ssh access for root and allowing su

Disabling ssh access for root and allowing "su" The following are the steps to disable root and enable "su" over SSH step : 1 create a user make him a member of wheel group.(use cpanel and WHM or manually using shell) step : 2 uncomment the following line in the file /etc/pam.d/su auth required  ..

Redhat sysreport backup tool

Linux system recovery

First step towards system backup and recovery. Sysreport is a simple tool that will backup all the critical files of a linux box. Just run the command "sysreport" and it will backup all the critical files of the server and create a compressed tar file in the name of the server and  ..

Create file with date timestamp

Copy or rename a file with date time stamp

Creating file with date time stamp Many times you may need to need to create a file file with date and time stamp. It will be much helpful for the administrator when they have a copy of configuration or other files with date and time timestamp. Command to create a file with  ..

How to deny allow certain ip address

Secure SSH by blocking IP Address

Harden Server In the last article we have seen how to secure shell by alerting through mail. You can also harden the server by blocking the certain server IP Address or by block all the IP Address except a certain IP Address so that you can login into you shell only  ..

Secure ssh

Mail alerts when someone logs into your SSH

Mail alerts when someone logs into your SSH You can make your ssh or shell secure by alerting yourself when someone login to your ssh. Just add any one of the shell script in your profile. Find Profile in your home directory vi /root/.bash_profile Script to secure SSH echo 'ALERT - Root Shell Access (YourserverName)  ..

< Previous 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Next

Tech Bluff