If you are not very good at typing or your keyboard is messing with you and you are making a lot of mistakes when you navigate on your Linux server this option will be very helpful to you:

Just add shopt -s cdspell in your .bashrc file and suddenly you will be very good at typing.

Some examples:

[email protected]:cd /ect
/etc
[email protected]:/etc#
[email protected]:/var# cd miail
mail
[email protected]:/var/mail#

It is possible to configure logon or welcome banner in the SSH server with the use of the Banner directive in /etc/ssh/sshd_config file.The Banner directive is only available for SSH protocol version 2 and by default there are no banner configured.

1. Create a banner file.

First you need to create the file that will include your banner for your users. In Debian, the default banner is located in /etc/issue.net file

nano /etc/issue.net

You can put here anything you want or just a welcome message like this:

###############################################################

Welcome to my server!
Disconnect IMMEDIATELY if you are not an authorized user!

###############################################################

2. Configure the /etc/ssh/sshd_config file

Now, add or remove the # from the beginning of the line Banner /etc/issue.net from /etc/ssh/sshd_config file.

nano  /etc/ssh/sshd_config
Banner /etc/issue.net

Restart sshd daemon for the changes to take effect Continue Reading…

This script will send you an email that contains all cron jobs for all your users.

#!/bin/bash
# Show all users cron jobs and send a report via email
# Created by [email protected], no rights reserved.
# Please submit feedback and questions at [email protected]
# Homepage: http://www.debian-tutorials.com

EMAIL=$1
if [ -n "$EMAIL" ] ; then
	TMPFILE=/tmp/cronjobs.tmp.$$

        #get all users list
	for i in `cat /etc/passwd | cut -f1 -d :`; do
		echo "##################################################"
		echo "Username: ${i}"
		echo "##################################################"
		crontab -u ${i} -l 2>&1
		echo "##################################################"
	done > $TMPFILE
	cat $TMPFILE | mail -s "Cronjobs report for `hostname`" ${EMAIL}
	rm -f $TMPFILE
else
	echo "Usage: ./cronlist your_email_address"
	exit
fi

You can download this script directly from here: How to show cron jobs for all users

When you will start using the Bash shell more often, you will appreciate these shortcuts that can save you very much typing time:

Shortcut Description

Up/Down Arrow Keys

You can scroll back to an old command, hit ENTER, and execute the command without having to re-type it.

history command

Show your complete command history.

TAB Completion

If you type a partial command or filename that the shell recognizes, you can have it automatically completed for you if you press the TAB key.
Search your command history with

CTRL-R

Press CTRL-R and then type any portion of a recent command. It will search the commands for you, and once you find the command you want, just press ENTER.
Scrolling the screen with Shift- PageUpandPage Down Scroll back and forward through your terminal.

CTRL + P

Does the same as the up arrow
CTRL + N Does the same as the down arrow

CTRL + G

Terminates the search function (escape does the same thing)
CTRL+ S Searchs forward in the command history.
CTRL + A Move cursor to start of line
CTRL+ E Move cursor to end of line
CTRL +B move backward within a line
CTRL + F move forward within a line
CTRL +D deletes characters and moves down the line
CTRL + K deletes the entire line
CTRL + X + backspace deletes all characters from cursors current position back
CTRL + T transpose text moves character down the li
ESC then c will convert the letter above the cursor to upper case
history –c will clear all of your history. Good for if your trying to hide command line passwords enetered.

5 Steps to Secure your SSH Server

Valic —  February 5, 2013 — 3 Comments

SSH is the standard method for Admin’s to connect to Linux servers securely. But the default install of SSH server way far from perfect and may allow attackers to hack your server. This guide shows you how to secure your SSH server in few steps

1. Use Strong SSH Passwords

Try to make all your passwords more secure by following next rules:

  • Try to use minimum of 8 characters
  • Use upper and lower case letters
  • Also use  numbers in your password
  • special characters like #$&*

You have also a password generator in Linux called pwgen. Install and use it with the following commands:

apt-get install pwgen

pwgen command will generate a list of passwords of 8 characters. You can use the man documents to find more options.

2. Disable SSH root logins Continue Reading…

Page 1 of 41234