background preloader

Linux

Facebook Twitter

(1) Super User. Everything Sysadmin. GPL AMI. Amazon's Elastic Computing Cloud (EC2) is a commercial service that provides virtual Linux systems running on Amazon's network, for which customers are charged by the hour. One of its useful features is the ability to launch a virtual system using a machine image (AMI) defined by another user, which could contain anything from a basic install of Linux up to a full application stack.

If you have an EC2 account, you can easily launch an image ( ami-9129eff8 ) containing Webmin, Virtualmin, Usermin and all the dependent programs like Apache, MySQL and Postfix, all running on CentOS. This lets you bring up a web hosting server in minutes, and either try out Virtualmin or start using it for real web hosting. The steps to do this are : Follow Amazon's getting started instructions to install the needed tools, in particular the Prerequisites, Setting up an Account and Setting up the Tools pages.

EC2 now has a separate European region, which has it's own set of machines and AMIs. 20 Linux Server Hardening Security Tips. Securing your Linux server is important to protect your data, intellectual property, and time, from the hands of crackers (hackers). The system administrator is responsible for security Linux box. In this first part of a Linux server security series, I will provide 20 hardening tips for default installation of Linux system. Linux Server Hardening Checklist and Tips The following instructions assume that you are using CentOS/RHEL or Ubuntu/Debian based Linux distribution. #1: Encrypt Data Communication All data transmitted over a network is open to monitoring.

Use scp, ssh, rsync, or sftp for file transfer. . #1.1: Avoid Using FTP, Telnet, And Rlogin / Rsh Services Under most network configurations, user names, passwords, FTP / telnet / rsh commands and transferred files can be captured by anyone on the same network using a packet sniffer. . #2: Minimize Software to Minimize Vulnerability Do you really need all sort of web services installed? #3: One Network Service Per System or VM Instance. 20 Linux Server Hardening Security Tips. Allow A Normal User To Run Commands As root Under Linux / UNIX Operating Systems. From my mail bag: I would like to run few commands such as stop or start web server as a root user.

How do I allow a normal user to run these commands as root? You need to use the sudo command which is use to execute a command as another user. It allows a permitted user to execute a command as the superuser or another user, as specified in the /etc/sudoers (config file that defines or list of who can run what) file. Sudo command sudo is more more secure than su command. If the invoking user is root or if the target user is the same as the invoking user, no password is required.

/etc/sudoers Syntax Following is general syntax used by /etc/sudoers file: USER HOSTNAME=COMMAND Where, USER: Name of normal user HOSTNAME: Where command is allowed to run. How do I use sudo? Give user rokcy access to halt/shutdown command and restart Apache web server. Password: Restarting apache-perl 1.3 web server.... If rokcy want to shutdown computer he needs to type command: $ sudo /sbin/halt Output: Password:

Chromebooks and Chrome OS. Puzzling Commandlines. In bash, the most common command-line-interpreter in Linux, you can execute more than one command in sequence or concurrently. One command can built upon the results of the others. This is a result of the UNIX-philosophy: “Many small programs that each do one task well.” stdin, stdout and stderr – redirection – ‘<’, ‘>’, and ‘>>’ While most shell-commands can take filenames for input and output, a common concept is that of standard-input (stdin, usually the keyboard) and standard-output (stdout, usually the screen) for regular input and output. Let’s take the calculator ‘bc’ as an example: stw@sixty-four:~> bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.

All I entered (with my keyboard = stdin) was ‘bc’, ‘17+4’, ‘6*7’, and ‘2000+1’, each with the enter-key terminating the line. I now prepare a file with these calculations in it: I do a ‘cat’, without an input-filename (thus it will read from stdin, which is the keyboard). We can also redirec stderr. RegExr. Shell Scripting: Create Report / Log File Names With Date in Filenames.

Sometime you need to create a shell scripts with output filenames with date in it. For example instead of log file named "secure.log", you can create a filename called "secure-jan-02-06.log" or "secure-DATE-FORMAT.log". The DATE-FORMAT can be set as per requirements: => dd-mm-yyyy => mm-dd-yyyy => yyyy-mm-dd => Month-Day-Year The date in the filename will make it easy to find out all logs or reports. You can display the current date and time in the given FORMAT using date command. If you just type date command it will display in standard FORMAT: $ date Output: Sun Feb 5 18:23:44 IST 2006 date Command Syntax The syntax is as follows for GNU/date: date +"FORMAT" To display date in MONTH-DD-YYYY format use the date command as follows: $ date +"%b-%d-%y" Sample outputs: Feb-05-06 Where, FORMAT can be any one of the following: Get the date in YYYY-mm-dd format NOW=$(date +"%Y-%m-%d") NOW=$(date +"%F") To create a file with date in filename, enter: LOGFILE="log-$NOW.log" To display filename, enter: #!

BASH Programming - Introduction HOW-TO: Variables. NextPreviousContents 5. Variables You can use variables as in any programming languages. There are no data types. A variable in bash can contain a number, a character, a string of characters. You have no need to declare a variable, just assigning a value to its reference will create it. 5.1 Sample: Hello World! #! Line 2 creates a variable called STR and assigns the string "Hello World! " 5.2 Sample: A very simple backup script (little bit better) #! This script introduces another thing. Notice that in this script, the output filename will be different every day, due to the format switch to the date command(+%Y%m%d). Some more examples: echo ls echo $(ls) 5.3 Local variables Local variables can be created by using the keyword local. #!

This example should be enought to show how to use a local variable.

Legacy OS 4 Mini: Light-weight Linux for older PCs. Have an old computer lying around that you’d like to use for some light web surfing, document editing, and other tasks? I mean like a PC with a 1999-era Intel Pentium III processor? It turns out there’s an OS for that… and it’s not Windows 98. Legacy OS 4 Mini is a light-weight Linux operating system designed to run on older PC hardware. It supports any PC with a Pentium II 800 MHz or faster processor, 256MB of RAM, and 4GB of disk space. For better performance, you’ll want a Pentium 4 processor, but as the name suggests, Legacy will run on… legacy hardware. In fact, you may have problems running the operating system on hardware that’s too recent. The operating system can run a number of modern apps including Skype and Pidgin for chat, Transmission and Ktorrent for bittorrent, Amarok for music, SMPlayer for videos, and Opera for surfing the web.

Legacy OS 4 Mini is based on Puppy Linux, but the user interface has been modified, as has the list of preloaded applications.