Don't miss

How to Setup Two-Factor Authentication (Google Authenticator) for SSH Logins


By default, SSH already uses a secure data communication between remote machines, but if you want to add some extra security layer to your SSH connections, you can add a Google Authenticator (two-factor authentication) module that allow you to enter a random one-time password (TOTP) verification code while connecting to SSH servers. You’ll have to enter the verification code from your smartphone or PC when you connect.
The Google Authenticator is an open-source module that includes implementations of one-time passcodes (TOTP) verification token developed by Google. It supports several mobile platforms, as well as PAM (Pluggable Authentication Module). These one-time passcodes are generated using open standards created by the OATH (Initiative for Open Authentication).
SSH Two Factor Authentication
SSH Two Factor Authentication
In this article I will show you how to setup and configure SSH for two-factor authentication underRed HatCentOSFedora and UbuntuLinux Mint and Debian.

Installing Google Authenticator Module

Open the machine that you want to setup two factor authentication and install following PAMlibraries along with development libraries that are needed for the PAM module to work correctly with Google authenticator module.
On Red HatCentOS and Fedora systems install the ‘pam-devel‘ package.
# yum install pam-devel make gcc-c++ wget
On UbuntuLinux Mint and Debian systems install ‘libpam0g-dev‘ package.
# apt-get install libpam0g-dev make gcc-c++ wget
Download and extract Google authenticator module under Home directory (assume you are already logged in home directory of root).
# cd /root
# wget https://google-authenticator.googlecode.com/files/libpam-google-authenticator-1.0-source.tar.bz2
# tar -xvf libpam-google-authenticator-1.0-source.tar.bz2
Type the following commands to compile and install Google authenticator module on the system.
# cd libpam-google-authenticator-1.0
# make
# make install
# google-authenticator
Once you run ‘google-authenticator‘ command, it will prompt you with a serious of question. Simply type “y” (yes) as the answer in most situation. If something goes wrong, you can type again ‘google-authenticator‘ command to reset the settings.
  1. Do you want authentication tokens to be time-based (y/n) y
After this question, you will get your ‘secret key‘ and ‘emergency codes‘. Write down these details somewhere, we will need the ‘secret key‘ later on to setup Google Authenticator app.
[root@tecmint libpam-google-authenticator-1.0]# google-authenticator

Do you want authentication tokens to be time-based (y/n) y

https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/root@tecmint.com%3Fsecret%3DXEKITDTYCBA2TLPL

Your new secret key is: XEKITDTYCBA2TLPL
Your verification code is 461618
Your emergency scratch codes are:
  65083399
  10733609
  47588351
  71111643
  92017550
Next, follow the setup wizard and in most cases type answer as “y” (yes) as shown below.
Do you want me to update your "/root/.google_authenticator" file (y/n) y

Do you want to disallow multiple uses of the same authentication
token? This restricts you to one login about every 30s, but it increases
your chances to notice or even prevent man-in-the-middle attacks (y/n) y

By default, tokens are good for 30 seconds and in order to compensate for
possible time-skew between the client and the server, we allow an extra
token before and after the current time. If you experience problems with poor
time synchronization, you can increase the window from its default
size of 1:30min to about 4min. Do you want to do so (y/n) y

If the computer that you are logging into isn't hardened against brute-force
login attempts, you can enable rate-limiting for the authentication module.
By default, this limits attackers to no more than 3 login attempts every 30s.
Do you want to enable rate-limiting (y/n) y

Configuring SSH to use Google Authenticator Module

Open the PAM configuration file ‘/etc/pam.d/sshd‘ and add the following line to the top of the file.
auth       required     pam_google_authenticator.so
Next, open the SSH configuration file ‘/etc/ssh/sshd_config‘ and scroll for fine the line that says.
ChallengeResponseAuthentication no
Change it to “yes“. So, it becomes like this.
ChallengeResponseAuthentication yes
Finally, restart SSH service to take new changes.
# /etc/init.d/sshd restart

Configuring Google Authenticator App

Launch Google Authenticator app in your smartphone. Press Menu and choose “Setup an account“. If you don’t have this app, you can download and install Google Authenticator app on your Android/iPhone/Blackberry devices.
Google Authenticator Setup Account
Google Authenticator Setup Account
Press “Enter key provided”.
Google Authenticator Secret Key
Enter Google Authenticator Secret Key
Add your account ‘Name‘ and enter the ‘secret key‘ generated earlier.
Google Authenticator Account Name
Google Authenticator Account Name and Secret Key
It will generate one time password (verification code) that will constantly changing every 30sec on your phone.
Google Authenticator One Time Password
Google Authenticator One Time Password
Now try to login via SSH, you will be prompted with Google Authenticator code (Verification code) and Password whenever you attempt to log in via SSH. You have only 30 seconds to enter this verification code, if you miss it will regenerate new verification code.
login as: tecmint
Access denied
Using keyboard-interactive authentication.
Verification code:
Using keyboard-interactive authentication.
Password:
Last login: Tue Apr 23 13:58:29 2013 from 172.16.25.125
[root@tecmint ~]#
If you don’t have smartphone, you can also use a Firefox add-on called GAuth Authenticator to do two-factor authentication.
Important: The two-factor authentication works with password based SSH login. If you are using any private/public key SSH session, it will ignore two-factor authentication and log you in directly.

How To Grant A User The Power Commands?


Change what the user can invoke a command.

Dijae ALL=(ALL) NOPASSWD: ALL

this will make the user Dijae invoke a root command without typing first sudo on every folder he wants to.

Manual:

NAME

visudo - edit the sudoers file 
SYNOPSIS

visudo [ -c ] [ -f sudoers ] [ -q ] [ -s ] [ -V ] 
DESCRIPTION

visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for parse errors. If the sudoers file is currently being edited you will receive a message to try again later.
There is a hard-coded list of editors that visudo will use set at compile-time that may be overridden via the editor sudoers Default
variable. This list defaults to the path to vi(1) on your system, as determined by the configure script. Normally, visudo does not honor the EDITOR
or VISUAL
environment variables unless they contain an editor in the aforementioned editors list. However, if visudo is configured with the ---with-enveditor flag or the enveditor Default
variable is set in sudoers, visudo will use any the editor defines by EDITOR
or VISUAL
. Note that this can be a security hole since it allows the user to execute any program they wish simply by setting EDITOR
or VISUAL
.
visudo parses the sudoers file after the edit and will not save the changes if there is a syntax error. Upon finding an error, visudo will print a message stating the line number(s) where the error occurred and the user will receive the ``What now?'' prompt. At this point the user may enter ``e'' to re-edit the sudoers file, ``x'' to exit without saving the changes, or ``Q'' to quit and save changes. The ``Q'' option should be used with extreme care because if visudo believes there to be a parse error, so will sudo and no one will be able to sudo again until the error is fixed. If ``e'' is typed to edit the sudoers file after a parse error has been detected, the cursor will be placed on the line where the error occurred (if the editor supports this feature). 
OPTIONS

visudo accepts the following command line options:
-c
Enable check-only mode. The existing sudoers file will be checked for syntax and a message will be printed to the standard output detailing the status of sudoers. If the syntax check completes successfully, visudo will exit with a value of 0. If a syntax error is encountered, visudo will exit with a value of 1.
-f
Specify and alternate sudoers file location. With this option visudo will edit (or check) the sudoers file of your choice, instead of the default, @sysconfdir@/sudoers. The lock file used is the specified sudoers file with ``.tmp'' appended to it.
-q
Enable quiet mode. In this mode details about syntax errors are not printed. This option is only useful when combined with the -c flag.
-s
Enable strict checking of the sudoers file. If an alias is used before it is defined, visudo will consider this a parse error. Note that it is not possible to differentiate between an alias and a hostname or username that consists solely of uppercase letters, digits, and the underscore ('_') character.
-V
The -V (version) option causes visudo to print its version number and exit.

ERRORS

sudoers file busy, try again later.
Someone else is currently editing the sudoers file.
/etc/sudoers.tmp: Permission denied
You didn't run visudo as root.
Can't find you in the passwd database
Your userid does not appear in the system passwd file.
Warning: undeclared Alias referenced near ...
Either you are using a {User,Runas,Host,Cmnd}_Alias before defining it or you have a user or hostname listed that consists solely of uppercase letters, digits, and the underscore ('_') character. If the latter, you can ignore the warnings (sudo will not complain). In -s (strict) mode these are errors, not warnings.

 Sources of Visudo 


Posted via Blogaway

Incremental Backup with TAR




We often use TAR to backup files to tape to make full backup or using ctime or atime for creating new file names. But while your files are getting larger, let's say apache, logs or any file that modifies from time to time you need to have incremental backups. Incremental backups let's you backup only the files/folder that are modified within the specified time range. To increment the backup, you need this unix command.

Check The Exact Capacity of Your Database


If you want to know the exact capacity of your database. Check this!
Image from: findicons.com

1. SQL script
Sum up the data_length + index_length is equal to the total table size.
  1. data_length – store the real data.
  2. index_length – store the table index.
Here’s the SQL script to list out the entire databases size
SELECT table_schema "Data Base Name", SUM( data_length + index_length) / 1024 / 1024 
"Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
Another SQL script to list out one database size, and each tables size in detail
SELECT TABLE_NAME, table_rows, data_length, index_length, 
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB"
FROM information_schema.TABLES WHERE table_schema = "schema_name";
2. Locate the MySQL stored data
Access this article to find out where does MySQL database saved the data.
Windows
Locate the MySQL ibdata1 file, right click on the file and click the properties, see the size? :)
Linux
Locate the MySQL ibdata1 file
mkyong@myserver:/var/lib/mysql$ ls -lh
total 1.5G
drwx------ 2 mysql mysql 4.0K 2009-08-26 13:36 mydatabase
-rw-r--r-- 1 root  root     0 2009-08-19 09:39 debian-5.0.flag
-rw-rw---- 1 mysql mysql 1.5G 2009-08-27 17:32 ibdata1
-rw-rw---- 1 mysql mysql 5.0M 2009-08-27 17:32 ib_logfile0
-rw-rw---- 1 mysql mysql 5.0M 2009-08-27 17:32 ib_logfile1
drwxr-xr-x 2 mysql root  4.0K 2009-08-19 11:19 mysql
-rw------- 1 root  root     6 2009-08-19 09:39 mysql_upgrade_info
Sources from: mykyong.com

Useful Uses of YUM




This link gives you techniques in using YUM.


What is YUM?
YUM (Yellowdog Updater Modified) is an open source command-line as well as graphical based package management tool for RPM (RedHat Package Manager) based Linux systems. It allows users and system administrator to easily install, update, remove or search software packages on a systems. It was developed and released by Seth Vidal under GPL (General Public License) as an open source, means anyone can allowed to download and access the code to fix bugs and develop customized packages. YUM uses numerous third party repositories to install packages automatically by resolving their dependencies issues.
1. Install a Package with YUM
To install a package called Firefox 14, just run the below command it will automatically find and install all required dependencies for Firefox.
# yum install firefox Loaded plugins: fastestmirror Dependencies Resolved ================================================================================================ Package Arch Version Repository Size ================================================================================================ Updating: firefox i686 10.0.6-1.el6.centos updates 20 M Updating for dependencies: xulrunner i686 10.0.6-1.el6.centos updates 12 M Transaction Summary ================================================================================================ Install 0 Package(s) Upgrade 2 Package(s) Total download size: 32 M Is this ok [y/N]: y Downloading Packages: (1/2): firefox-10.0.6-1.el6.centos.i686.rpm | 20 MB 01:10 (2/2): xulrunner-10.0.6-1.el6.centos.i686.rpm | 12 MB 00:52 ------------------------------------------------------------------------------------------------ Total 63 kB/s | 32 MB 02:04 Updated: firefox.i686 0:10.0.6-1.el6.centos Dependency Updated: xulrunner.i686 0:10.0.6-1.el6.centos Complete!
The above command will ask confirmation before installing any package on your system. If you want to install packages automatically without asking any confirmation, use option -y as shown in below example.
# yum -y install firefox
2. Removing a Package with YUM
To remove a package completely with their all dependencies, just run the following command as shown below.
# yum remove firefox Loaded plugins: fastestmirror Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package firefox.i686 0:10.0.6-1.el6.centos set to be erased --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================== Package Arch Version Repository Size ==================================================================================================== Removing: firefox i686 10.0.6-1.el6.centos @updates 23 M Transaction Summary ==================================================================================================== Remove 1 Package(s) Reinstall 0 Package(s) Downgrade 0 Package(s) Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Erasing : firefox-10.0.6-1.el6.centos.i686 1/1 Removed: firefox.i686 0:10.0.6-1.el6.centos Complete!
Same way the above command will ask confirmation before removing a package. To disable confirmation prompt just add option -y as shown in below.
# yum -y remove firefox
3. Updating a Package using YUM
Let’s say you have outdated version of MySQL package and you want to update it to the latest stable version. Just run the following command it will automatically resolves all dependencies issues and install them.
# yum update mysql Loaded plugins: fastestmirror Dependencies Resolved ============================================================================================================ Package Arch Version Repository Size ============================================================================================================ Updating: vsftpd i386 2.0.5-24.el5_8.1 updates 144 k Transaction Summary ============================================================================================================ Install 0 Package(s) Upgrade 1 Package(s) Total size: 144 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Updating : vsftpd 1/2 Cleanup : vsftpd 2/2 Updated: vsftpd.i386 0:2.0.5-24.el5_8.1 Complete!
4. List a Package using YUM
Use the list function to search for the specific package with name. For example to search for a package called openssh, use the command.
# yum list openssh Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.neu.edu.cn * epel: mirror.neu.edu.cn * extras: mirror.neu.edu.cn * rpmforge: mirror.nl.leaseweb.net * updates: mirror.nus.edu.sg Installed Packages openssh.i386 4.3p2-72.el5_6.3 installed Available Packages 4.3p2-82.el5 base
To make your search more accurate, define package name with their version, in case you know. For example to search for a specific version openssh-4.3p2 of the package, use the command.
# yum list openssh-4.3p2
5. Search for a Package using YUM
If you don’t remember the exact name of the package, then use search function to search all the available packages to match the name of the package you specified. For example, to search all the packages that matches the word .
# yum search vsftpd Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.neu.edu.cn * epel: mirror.neu.edu.cn * extras: mirror.neu.edu.cn * rpmforge: mirror.nl.leaseweb.net * updates: ftp.iitm.ac.in============================== Matched: vsftpd ======================== ccze.i386 : A robust log colorizer pure-ftpd-selinux.i386 : SELinux support for Pure-FTPD vsftpd.i386 : vsftpd - Very Secure Ftp Daemon
6. Get Information of a Package using YUM
Say you would like to know information of a package before installing it. To get information of a package just issue the below command.
# yum info firefox Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.neu.edu.cn * epel: mirror.neu.edu.cn * extras: mirror.neu.edu.cn * rpmforge: mirror.nl.leaseweb.net * updates: ftp.iitm.ac.in Available Packages Name : firefox Arch : i386 Version : 10.0.6 Release : 1.el5.centos Size : 20 M Repo : updates Summary : Mozilla Firefox Web browser URL : http://www.mozilla.org/projects/firefox/ License : MPLv1.1 or GPLv2+ or LGPLv2+ Description: Mozilla Firefox is an open-source web browser, designed for standards : compliance, performance and portability.
7. List all Available Packages using YUM
To list all the available packages in the Yum database, use the below command.
# yum list | less
8. List all Installed Packages using YUM
To list all the installed packages on a system, just issue below command, it will display all the installed packages.
# yum list installed | less
9. Yum Provides Function
Yum provides function is used to find which package a specific file belongs to. For example, if you would like to know the name of the package that has the /etc/httpd/conf/httpd.conf.
# yum provides /etc/httpd/conf/httpd.conf Loaded plugins: fastestmirror httpd-2.2.3-63.el5.centos.i386 : Apache HTTP Server Repo : base Matched from: Filename : /etc/httpd/conf/httpd.conf httpd-2.2.3-63.el5.centos.1.i386 : Apache HTTP Server Repo : updates Matched from: Filename : /etc/httpd/conf/httpd.conf httpd-2.2.3-65.el5.centos.i386 : Apache HTTP Server Repo : updates Matched from: Filename : /etc/httpd/conf/httpd.conf httpd-2.2.3-53.el5.centos.1.i386 : Apache HTTP Server Repo : installed Matched from: Other : Provides-match: /etc/httpd/conf/httpd.conf
10. Check for Available Updates using Yum
To find how many of installed packages on your system have updates available, to check use the following command.
# yum check-update
11. Update System using Yum
To keep your system up-to-date with all security and binary package updates, run the following command. It will install all latest patches and security updates to your system.
# yum update
12. List all available Group Packages
In Linux, number of packages are bundled to particular group. Instead of installing individual packages with yum, you can install particular group that will install all the related packages that belongs to the group. For example to list all the available groups, just issue following command.
# yum grouplist Installed Groups: Administration Tools DNS Name Server Dialup Networking Support Editors Engineering and Scientific FTP Server Graphics Java Development Legacy Network Server Available Groups: Authoring and Publishing Base Beagle Cluster Storage Clustering Development Libraries Development Tools Eclipse Educational Software KDE (K Desktop Environment) KDE Software Development
13. Install a Group Packages
To install a particular package group, we use option as groupinstall. Fore example, to install “MySQL Database“, just execute the below command.
# yum groupinstall 'MySQL Database' Dependencies Resolved ================================================================================================= Package Arch Version Repository Size ================================================================================================= Updating: unixODBC i386 2.2.11-10.el5 base 290 k Installing for dependencies: unixODBC-libs i386 2.2.11-10.el5 base 551 k Transaction Summary ================================================================================================= Install 1 Package(s) Upgrade 1 Package(s) Total size: 841 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : unixODBC-libs 1/3 Updating : unixODBC 2/3 Cleanup : unixODBC 3/3 Dependency Installed: unixODBC-libs.i386 0:2.2.11-10.el5 Updated: unixODBC.i386 0:2.2.11-10.el5 Complete!
14. Update a Group Packages
To update any existing installed group packages, just run the following command as shown below.
# yum groupupdate 'DNS Name Server' Dependencies Resolved ================================================================================================================ Package Arch Version Repository Size ================================================================================================================ Updating: bind i386 30:9.3.6-20.P1.el5_8.2 updates 981 k bind-chroot i386 30:9.3.6-20.P1.el5_8.2 updates 47 k Updating for dependencies: bind-libs i386 30:9.3.6-20.P1.el5_8.2 updates 864 k bind-utils i386 30:9.3.6-20.P1.el5_8.2 updates 174 k Transaction Summary ================================================================================================================ Install 0 Package(s) Upgrade 4 Package(s) Total size: 2.0 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Updating : bind-libs 1/8 Updating : bind 2/8 Updating : bind-chroot 3/8 Updating : bind-utils 4/8 Cleanup : bind 5/8 Cleanup : bind-chroot 6/8 Cleanup : bind-utils 7/8 Cleanup : bind-libs 8/8 Updated: bind.i386 30:9.3.6-20.P1.el5_8.2 bind-chroot.i386 30:9.3.6-20.P1.el5_8.2 Dependency Updated: bind-libs.i386 30:9.3.6-20.P1.el5_8.2 bind-utils.i386 30:9.3.6-20.P1.el5_8.2 Complete!
15. Remove a Group Packages
To delete or remove any existing installed group from the system, just use below command.
# yum groupremove 'DNS Name Server' Dependencies Resolved =========================================================================================================== Package Arch Version Repository Size =========================================================================================================== Removing: bind i386 30:9.3.6-20.P1.el5_8.2 installed 2.1 M bind-chroot i386 30:9.3.6-20.P1.el5_8.2 installed 0.0 Transaction Summary =========================================================================================================== Remove 2 Package(s) Reinstall 0 Package(s) Downgrade 0 Package(s) Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Erasing : bind 1/2 warning: /etc/sysconfig/named saved as /etc/sysconfig/named.rpmsave Erasing : bind-chroot 2/2 Removed: bind.i386 30:9.3.6-20.P1.el5_8.2 bind-chroot.i386 30:9.3.6-20.P1.el5_8.2 Complete!
16. List Enabled Yum Repositories
To list all enabled Yum repositories in your system, use following option.
# yum repolist repo id repo name status base CentOS-5 - Base enabled: 2,725 epel Extra Packages for Enterprise Linux 5 - i386 enabled: 5,783 extras CentOS-5 - Extras enabled: 282 mod-pagespeed mod-pagespeed enabled: 1 rpmforge RHEL 5 - RPMforge.net - dag enabled: 11,290 updates CentOS-5 - Updates enabled: 743 repolist: 20,824
16. List all Enabled and Disabled Yum Repositories
The following command will display all enabled and disabled yum repositories on the system.
# yum repolist all repo id repo name status C5.0-base CentOS-5.0 - Base disabled C5.0-centosplus CentOS-5.0 - Plus disabled C5.0-extras CentOS-5.0 - Extras disabled base CentOS-5 - Base enabled: 2,725 epel Extra Packages for Enterprise Linux 5 - i386 enabled: 5,783 extras CentOS-5 - Extras enabled: 282 repolist: 20,824
17. Install a Package from Specific Repository
To install a particular package from a specific enabled or disabled repository, you must use –enablerepo option in your yum command. For example to Install PhpMyAdmin 3.5.2package, just execute the command.
# yum --enablerepo=epel install phpmyadmin Dependencies Resolved ============================================================================================= Package Arch Version Repository Size ============================================================================================= Installing: phpMyAdmin noarch 3.5.1-1.el6 epel 4.2 M Transaction Summary ============================================================================================= Install 1 Package(s) Total download size: 4.2 M Installed size: 17 M Is this ok [y/N]: y Downloading Packages: phpMyAdmin-3.5.1-1.el6.noarch.rpm | 4.2 MB 00:25 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : phpMyAdmin-3.5.1-1.el6.noarch 1/1 Verifying : phpMyAdmin-3.5.1-1.el6.noarch 1/1 Installed: phpMyAdmin.noarch 0:3.5.1-1.el6 Complete!
18. Interactive Yum Shell
Yum utility provides a custom shell where you can execute multiple commands.
# yum shell Loaded plugins: fastestmirror Setting up Yum Shell > update httpd Loading mirror speeds from cached hostfile * base: mirrors.sin3.sg.voxel.net * epel: ftp.riken.jp * extras: mirrors.sin3.sg.voxel.net * updates: mirrors.sin3.sg.voxel.net Setting up Update Process >
19. Clean Yum Cache
By default yum keeps all the repository enabled package data in /var/cache/yum/ with each sub-directory, to clean all cached files from enabled repository, you need to run the following command regularly to clean up all the cache and make sure that there is nothing unnecessary space is using. We don’t want to give the output of the below command, because we like to keep cached data as it is.
# yum clean all
20. View History of Yum
To view all the past transactions of yum command, just use the following command.
# yum history Loaded plugins: fastestmirror ID | Login user | Date and time | Action(s) | Altered ------------------------------------------------------------------------------- 10 | root | 2012-08-11 15:19 | Install | 3 9 | root | 2012-08-11 15:11 | Install | 1 8 | root | 2012-08-11 15:10 | Erase | 1 EE 7 | root | 2012-08-10 17:44 | Install | 1 6 | root | 2012-08-10 12:19 | Install | 2 5 | root | 2012-08-10 12:14 | Install | 3 4 | root | 2012-08-10 12:12 | I, U | 13 E< 3 | root | 2012-08-09 13:01 | Install | 1 > 2 | root | 2012-08-08 20:13 | I, U | 292 EE 1 | System | 2012-08-08 17:15 | Install | 560 history list

How To Display Date And Time In "Oct 14, 2013 14:22:59" Format?



How to display date and time format like "Oct 14, 2013 14:21:59".


date +"%b %d, %Y %H:%M:%S"

This is useful in making a time stamp of your logs.

Helpful Administration Linx


Links for you. from JustLinux
Yolinux
This is a very good guide for administering your linux servers, also there are tutorials and other links possible for downloads and other related guides.

Adding Users and After

You will need to create the users directory manually. This requires three steps:
  1. Create directory in compliance to /etc/passwd, usually there will be already a /home/login entry.
  2. Copy initial files from /etc/skel
  3. And finally set right permissions:
    • mkdir /home/YOU
    • cd /home/YOU
    • cp /etc/skel/.* /etc/skel/* . But check for directories you might have missed to copy
    • chown -R YOU.YOURGROUP .
    • chmod -R go=u,go-w .
    • chmod go= .