Ubuntu: Two factor authentication for SSH

Secure Shell (SSH) is a cryptographic network protocol for secure data communication, remote shell services or command execution between two network connected computers. Usually the network is insecure over which the computers are connected.

Install the two factor authentication

Open a terminal session (Ctrl+Alt+T)

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

Google authenticator is fetched to the pwd.
To install authenticator:

sudo apt-get install libpam0g-dev
cd libpam-google-authenticator-1.0
make
sudo make install

Now run:

google-authenticator

This will now ask you to configure your autheticator by asking (Y/N) questions.

Configure SSH to use the Google Authenticator
Open the pam.d/sshd file:

sudo vim /etc/pam.d/sshd

Add this line to the top of the file:

auth       required     pam_google_authenticator.so

Save file and exit (Esc + :wq)
Now open, sshd_config file

sudo vim /etc/ssh/sshd_config

Scroll down the list till you find:

ChallengeResponseAuthentication no

Change it to “yes”

ChallengeResponseAuthentication yes

Save file and exit(Esc + :wq)
Restart the ssh server:

sudo service ssh restart

Setting up new account in your Google Authenticator app

1. Open the Google Authenticator app in your smartphone. Press Menu and select “setup an account”

google-authenticator-setup-account

2. Press “Enter key provided”.

google-authenticator-enter-key

3. Give your account a name and enter the secret key generated earlier.

Now when you connect via SSH to your remote computer, you will see the request for the verification key.

Note: The two-factor authentication only works for password-based login. If you are already using a public/private key for your SSH session, it will bypass the two-factor authentication and log you in directly.

Automatically mount ntfs partition in Ubuntu 12.04

1. Install ntfs-config ‘sudo apt-get install ntfs-config’

2. Launch terminal using Ctrl+Alt+T. Issue ‘sudo ntfs-config’.

3. In order to automatically mount each ntfs partition use “Auto configure”.

4. ntfs-config would show the available ntfs partitions. Check the box adjacent to the drive you want to automount. In the place for you can put the name which you want to use for that particular drive for eg : mnt1

Install Dropbox in Ubuntu 12.04 under proxy

Dropbox is a file hosting service operated by Dropbox, Inc. that offers cloud storagefile synchronization, and client software.

Download dropbox daemon according to your system configuration :

32bit: http://www.dropbox.com/download?plat=lnx.x86 
64bit: http://www.dropbox.com/download?plat=lnx.x86_64

Extract the archive in home folder. The extracted folder will be a hidden one. 

Press Ctrl+h to view the hidden folder of the directory.

Launch terminal using Ctrl+Alt+T and start Dropbox daemon using ‘/home/user/.dropbox-dist/dropboxd’

Now set the proxy and link your system to the dropbox account.

In order to autostart dropbox everytime you boot the system use ‘ln -s ~/.dropbox/dropboxd  /usr/share/autostart/dropboxd’

After installing Ubuntu 12.04 Precise Pangolin

These instructions presume you are proficient with PPAs, .Debs, and other terminal commands, Ubuntu Tweak, and require a full set of video, audio, and archive codecs, as well as Skype, Flash, and a truck-load of wallpapers.

Enable Partner Repository.

Add the GetDeb and PlayDeb packages.

sudo add-apt-repository ppa:nae-team/ppa
sudo add-apt-repository ppa:tualatrix/ppa
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo add-apt-repository ppa:rye/ubuntuone-extras

sudo wget –output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list
sudo apt-get –quiet update
sudo apt-get –yes –quiet –allow-unauthenticated install medibuntu-keyring

sudo apt-get –quiet update

sudo apt-get install firestarter synaptic ubuntu-tweak vlc gimp gimp-data gimp-plugin-registry gimp-data-extras openshot openshot-doc transmission-gtk transmission-common y-ppa-manager skype bleachbit indicator-ubuntuone lo-menubar libxss1 libnss3-1d openjdk-7-jre unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack lha arj cabextract file-roller non-free-codecs libxine1-ffmpeg gxine mencoder flac faac faad sox ffmpeg2theora libmpeg2-4 uudeview libmpeg3-1 mpeg3-utils mpegdemux liba52-dev mpeg2dec vorbis-tools id3v2 mpg321 mpg123 libflac++6 ffmpeg totem-mozilla icedax tagtool easytag id3tool lame nautilus-actions-extra nautilus-script-audio-convert libmad0 libjpeg-progs libdvdcss2 w32codecs libavcodec53 libavutil51 ubuntu-restricted-extras app-install-data-medibuntu apport-hooks-medibuntu ubuntu-wallpapers*

Install Google Chrome choose the 64bit .Deb (32bit if you’re still running that).

Check for and Install All Updates Via Update Manager.

OpenCL for intel device using UBUNTU

1. Download the package from : http://software.intel.com/en-us/articles/download-intel-opencl-sdk/
2. Install rpm(Red Hat Package Manager) and alien packages : sudo apt-get install rpm alien

3. Convert rpm to .deb using alien : sudo alien -d ‘rpm file name’
4. Install .deb package : sudo dpkg -i ‘deb_file.deb’
5. Change permissions of ‘/etc/OpenCL/vendors/intelocl64.icd’ : chmod 777 /etc/OpenCL/vendors/intelocl64.icd
6. Execute : `sudo echo “libintelocl.so” > /etc/OpenCL/vendors/intelocl64.icd`
7. libOpenCL.so is installed in /usr/lib64. If you do not have anyother OpenCL platform move it to /usr/lib and run ‘sudo ldconfig’ thereafter.

8. Export the LD_LIBRARY_PATH by : ‘export LD_LIBRARY_PATH=/usr/lib64/OpenCL/vendors/intel:$LD_LIBRARY_PATH’
You will find that the OpenCL headers are installed in /usr/include/CL. Now you can enjoy writing OpenCL codes on your Intel machine.