feed-image  ISSN 1836-5930

linux

Linux eBooks FREE Download

A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide


Poll

Do you care about your privacy when using a FACEBOOK?
 


Partner Linux Sites: TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

LINUX ADMINISTRATION NOTES & CODE SNIPPETS

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

One solution to this problem is to add a correct key for a particular server manually. If you feel 100% that this warring can be ingnored simply remove a line ...

Read more ...

Ubuntu and Debian google-talkplug installation howto

Installing this plugin on any Linux system should be a easy task. First download google-talkplugin_current_i386.deb package. On a Ubuntu system use: sudo dpkg -i google-talkplugin_current_i386.deb on a system where sudo is ...

Read more ...

WWW Mechanize - 401 Authorization Required

Here is a small script on how to login to a .htaccess protected page. Suppose that URL we want to login to is: http(:)//www(.)example(.)com/ and here are credentials required to login: username: www password: ...

Read more ...

Extract email address from a text file

A following perl script and regular expression extracts all email addresses from an given text file. Sample text: This perl script extracts all email addresses from an given text file. This email ...

Read more ...

Regular expression to validate credit card number

Credit card numbers contain four groups of numbers where each group contains 4 numbers. The following regular expression ( regexp ) will accept all credit card number in this format: ...

Read more ...

Regular Expression to validate US postal codes

Simple way to validate US postal codes using regular expression and optionally bash. US postall codes accept five digit ZIP number + optional 4 digit code. For example 32344-4444 and ...

Read more ...

vfat file system - unable to create uppercase directory name

Are you unable to create uppercase directory name on your storage device mounted as vfat file system. The reason for this behavior is that vfat filesystem is by default mounted ...

Read more ...

How To secure ssh

Here are couple ways on how to change your sshd default configuration settings to make ssh daemon more secure / restrictive and thus protecting your server from unwanted intruders. NOTE: Everytime you ...

Read more ...

More in: Linux administration notes & code snippets

-
+
8
Linuxconfig.org
Ssh port forwarding

SSH Port Forwarding allows us to create a very simple "VPN" which lets you to secure insecure protocols such us telnet or ftp. When creating encrypted ssh connections a client needs to be connected to a ssh server on a remote host, thus creating a ssh tunnel via which an insecure information will travel. In this scenario, we are going to use ssh port forwarding to create an encrypted tunnel for telnet connection.

Enable telnet server on remote host

Let us first confirm that the telnet server is running on a remote host:

$ netstat -ant | grep 23 

remote server port 23

Create ssh tunnel to remote host

In this example you will open port 4500 on your local host and tunnel it to the port 23 on your remote host. You do not have to do this as a root. Since we are using a port higher than 1024 a ordinary user is able to create this port forward connection. Keep in mind that a tunnel is erected only when the ssh connection is running.

# ssh -L 4500:127.0.0.1:23 linuxconfig.org 

create tunnel
At this point, every connection which uses port 4500 on the localhost will be redirected to remote port 23.

Telnet to remote host via ssh port forwarding

Before we attempt to telnet to a remote host via tunnel, we need to ensure that the tunnel is still running:

# netstat -ant | grep 4500 

ssh port forwarding
Once we know that the tunnel is still running we can attempt to telnet on local port 4500.

# telnet localhost 4500 

Telnet to remote host via ssh port forwarding

 
Bash scripting Tutorial
Free BASH scripting guide DOWNLOAD This bash script tutorial assumes no previous knowledge of bash scripting.As you will soon discover in this quick comprehensive bash scripting guide, learning the bash shell scripting is very easy task.

Lets begin this bash scripting tutorial with a simple "Hello World" script. Let's start with Learning the bash Shell: Unix Shell Programming

>>> Bash Scripting Guide FREE PDF DOWNLOAD <<<
>PDF DOWNLOAD<

Hello World Bash Shell Script

 

 

First you need to find out where is your bash interpreter located. Enter the following into your command line:

$ which bash 

bash interpreter location: /bin/bash

 

Open up you favorite text editor and a create file called hello_world.sh. Insert the following lines to a file:

NOTE:Every bash shell script in this tutorial starts with shebang:"#!" which is not read as a comment. First line is also a place where you put your interpreter which is in this case: /bin/bash.

Here is our first bash shell script example:

#!/bin/bash
# declare STRING variable
STRING="Hello World"
#print variable on a screen
echo $STRING









Navigate to a directory where your hello_world.sh is located and make the file executable:

$ chmod +x hello_world.sh 

Make bash shell script executable

Now you are ready to execute your first bash script:

./hello_world.sh 

Example of simple bash shell script

Read more...
 
Setup Bootsplash on Debian - grub silent or verbose boot mode

Grub boot verbose modeGrub Boot Silent mode

 

 

 

 

 

 

 

 

 

 

Install Prerequisites

apt-get install linux-source-2.6.18 kernel-package \
linux-patch-bootsplash bootsplash libc6-dev

Patching Linux kernel

Uncompress Linux Kernel Source

cd /usr/src
tar xjf linux-source-2.6.18.tar.bz2

Uncompress Linux Kernel Source

Read more...
 
Partition Encryption

Scenario

In this Linux config we are going to create encrypted partition for user "linuxconfig" and use pam_mount to mount it under /home/linuxconfig directory. For this config we have used Debian Linux, however the very same principle for creating encrypted partitions can be applied also for any other Linux distributions such as SuSe, RedHat, Gentoo, Ubuntu.

Prerequisites

First and the most important one is to make sure that on partition on which you are going to encrypt, is empty. If you have some important data there move them NOW to some save place. When creating encrypted partition all data will be removed. Secondly we need to satisfied software prerequisite so you need to install packages for:

  • cryptsetup ( Ubuntu, Debian package: cryptsetup )
  • pam_mount ( Ubuntu, Debian package: libpam-mount )
Read more...
 
«StartPrev12345678910NextEnd»

Page 9 of 11