How to run sudo command without password on Linux?

There comes a time when you want to execute a command with root privileges but you don’t want to enter root password again and again. May be you want to allow a user to be able to execute one particular command but can’t share root password or some command needs to be executed on boot but requires root..sounds familiar? Keep reading.

The kind of approach we will be using is very often frowned upon. Mainly because it beats the purpose of sudo i.e. allowing only privileged users to execute certain commands. It is also looked upon as security breach, but you are fine if you know what you are doing.

You can run sudo command without password on linux by modifying /etc/sudoers file which maintains – which user can execute what. Before editing this file, lets take a backup – just in case – it gets messed up.

ayushhgoyal@linuxstall:$ sudo cp /etc/sudoers /root/sudoers.bak

/etc/sudoers file can be edited in any editor of your choice but it is highly recommended to use visudo command. If there is a syntax error in sudoers file then you will be locked out of shell and we don’t want that. While visudo command checks for correct syntax and restricts user from saving a corrupt sudoers file. Enter following command to edit sudoers file:

ayushhgoyal@linuxstall:$ sudo visudo

For example, if we want user “ayush” to be able to execute, say, “visudo” without asking for password then we will have to append following line in sudoers file in the end.

 ayush ALL = NOPASSWD: /usr/sbin/visudo 

This needs to be added at the very last of sudoers file because if there are matching entries then last line will override all previous occurrences.

This is how my sudoers looks after editing:

sudoers_sudo

Now, user “ayush” won’t be prompted to enter password while executing “sudo visudo”.

You can replace your own username and command(s) you want to execute without entering root password:

 [username] ALL = NOPASSWD: [command] 

This can be extended for multiple commands by comma separating them.

How to make password visible in linux terminal

Whenever you need to execute a command with root privileges / with sudo – you have to enter password. One gets used to not see the password as he types but it can make few people uncomfortable while entering long and complex passwords. If one messes up one character, the whole password needs to be re-entered because we are just.. not sure. This stops now.

Today lets see a tweak that will make password asterisks visible as one types.

We are going to add “pwfeedback” in sudoers file and we will be good to go.

Launch terminal using Ctrl + Alt + T.

Run “sudo visudo” and enter password when prompted (This is the last time you won’t get to see the password asterisks while typing).

sudo visudo

sudo visudo

Note: By default, the file is opened with nano editor. The reason behind this is while saving the sudoers file, if the syntax is wrong, user will not be able to run any command using sudo or root privileges. With nano editor, syntax is checked upon saving. So it is always recommended to edit sudoers file via nano.

You will see sudoers file like one below. Using arrow keys, navigate to the end of line:

Defaults env_reset

2

We need to append this line with “,pwfeedback”. Result should look like this:

Defaults env_reset,pwfeedback

3

Save with Ctrl + X and then typing y when prompted. You will be prompted to enter a filename, press “Enter” to accept default.

4

Now close and re-launch command prompt to see if this worked. You’re welcome ;)
This is how it looks on my terminal:

5

Thank us by sharing this post.

How to get Gnome Classic Desktop in Ubuntu 14.04

New users of Ubuntu 14.04 tend to search for solutions to shift window control panels to right or try to get away from Unity. Unity just doesn’t connect with some users (including me) and we crave for our good old classic Gnome.

Well, we can’t shift window control panels to right anymore (some tricks for older versions) as they have hard coded them to left side from now on. But, we can have our good old Gnome classic back. Follow this tutorial to install Gnome Classic Desktop in Ubuntu 14.04.

Start your terminal via shortcut Ctrl + Alt + T. First, we will update Ubuntu and then we will install Gnome Classic Desktop.

ayushhgoyal@linuxstall:$ sudo apt-get update
ayushhgoyal@linuxstall:$ sudo apt-get install gnome-session-fallback

Enter your password when prompted. A message will be displayed asking how much disk space will be used where you enter “y”.

Then..then nothing..you have installed Gnome Classic Desktop on your Ubuntu 14.04. To see it in action you need to logout.

Now, at the login screen if you click the Ubuntu button, you will be provided with the choice to select a desktop environment. Go on and choose Gnome Classic, key in your credentials and enjoy.

How to add taskbar in Ubuntu 14.04?

You may be struggling with the recent switch to Ubuntu 14.04 or simple Unity is not what you expected it to be. Not having a taskbar to put minimized windows is what I missed the most when I made the switch. And, I know I am not the only one. So, here we will go through steps for how to install a taskbar in Ubuntu 14.04.

Tint2 is the tool we will be installing which brings back a feel of taskbar to Ubuntu 14.04. After installing, we will add it in “startup applications” so that you don’t have to start it by yourself everytime you boot.

Launch your terminal by pressing Ctrl + Alt + T or whichever way you like. Type in following command and hit “Enter”.

ayushhgoyal@linuxstall:$ sudo apt-get install tint2

Enter your password when prompted.

After displaying installation progress, you will be prompted “Do you want to continue? [Y/n] ” press “y” and hit “Enter”.

You have successfully installed tint2. Now we need to add it to startup applications.

Click “Search” button, first one on Unity bar OR hit “Super” key (the one with Windows sign on a Windows machine).

Screenshot from 2014-07-06 15_29_49

Start typing “Startup app” in search area, items matching the search query will display below the search area. When “Startup Applications” tool is there, click to open it.

Screenshot from 2014-07-06 15_32_19

On “Startup Applications Preferences” window click “Add” to add our application (here tint2) to startup applications.

Screenshot from 2014-07-06 15_35_23

In “Add Startup Dialog” enter name of application of your choice (here “Taskbar”), enter command precisely “tint2” and enter comment of your choice (here “My Taskbar”). Click “Add”.

Screenshot from 2014-07-06 15_35_45

Now you can close the “Startup Applications Preferences” window.

Screenshot from 2014-07-06 15_35_57

Please Logout and Login again for changes to take effect. Restart is not required.

How to install HTML Tidy in Linux

HTML Tidy is a tool for checking and cleaning up HTML source files. It is especially useful for finding and correcting errors in deeply nested HTML, or for making grotesque code legible once more.

Project URL, source code and executable downloads: http://tidy.sourceforge.net/

I installed it on CentOS 4.6 by following the below steps, it should work fine on any Linux distro

Step 1: Go to http://tidy.cvs.sourceforge.net/viewvc/tidy/tidy/ and click on “Download GNU tarball” at the bottom. This will download a file named `tidy.tar.gz`.

Step 2: Untar the file by below command

chankey@pathak:$ tar xvzf tidy.tar.gz

Step 3: Change directory to the generated folder

chankey@pathak:$ cd tidy

Step 4: Run the below commands

chankey@pathak:$ /bin/sh build/gnuauto/setup.sh
chankey@pathak:$ ./configure --prefix=/usr
chankey@pathak:$ make
chankey@pathak:$ make install

Step 5: Tidy has been installed successfully, you can check the version by

chankey@pathak:$ tidy -v

Output: HTML Tidy for Linux/x86 released on 25 March 2009

Also see

How to find Linux distribution name and version?

uname

unameSometimes we need to find out Linux distribution name and version of current installed Linux OS. Here is a tutorial addressing this problem.

There are three methods to find out Linux distribution and version:
1. /etc/*-release
2. lsb_release
3. /proc/version

Method 1: /etc/*-release

Issue following command to find out distro and version of installed Linux-

$ cat /etc/*-release

Sample output:

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=16
DISTRIB_CODENAME=petra
DISTRIB_DESCRIPTION="Linux Mint 16 Petra"
NAME="Ubuntu"
VERSION="13.10, Saucy Salamander"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 13.10"
VERSION_ID="13.10"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

Method 2: lsb_release

lsb in lsb_release stands for Linux Standard Base

$ lsb_release -a

Sample output:

No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 16 Petra
Release: 16
Codename: petra

Method 3: /proc/version

This command returns kernel version and gcc version which was used to build it.

$ cat /proc/version

Sample output:

Linux version 3.11.0-12-generic (buildd@allspice) (gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu7) ) #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013

Another way to find kernel version:

This command returns kernel version of currently installed Linux OS.

$ uname -r

or

$ uname -mrs

Sample output:

Linux 3.11.0-12-generic x86_64

Thank you.

Add auto-complete to “yum”

We really enjoy the auto complete feature in bash but it would be great to have it with “yum”. Debian based Linux Users already have it. Red Hat based distros do not ship with auto-complete enabled in “yum” which would be great if they do. Meanwhile here is a small trick to use mighty auto complete with “yum”, this will work with Red Hat as well as Cent OS and Fedora (all versions).

  • Change to root
 su - 
  • Install the package: bash-completion
 yum install bash-completion 

And you are good to go. You can now type “yum install “ and hit [TAB] to load suggestions just like in bash.

How to install Adobe Flash Player 11.2 on Fedora (17/18), CentOS/RHEL (5.8/6.3)

Here we are going to tell you how to install Adobe Flash Player Plugin 11.2 on Fedora 18/17/16/15/14/13/12, CentOS 6.3/6.2/6.1/6/5.8 and Red Hat (RHEL) 6.3/6.2/6.1/6/5.8. Using YUM repository provided by Adobe it is very to install and update Flash Player Plugin. Finally native 64-bit(x86_64) version of Adobe Flash Player is made available for Linux users.

Change to root user:

sudo -i

Install Adobe YUM Repository RPM package:

For 32-bit x86-
rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

For 64-bit x86_64-
rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

Update the repositories:

yum check-update

Install Adobe Flash Player 11.2 on Fedora (18/17/16/15/14/13/12), CentOS (6.3/6.2/6.1/6) and Red Hat (RHEL) (6.3/6.2/6.1/6):

yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl

Install Adobe Flash Player 11.2 on CentOS 5.8 and Red Hat (RHEL) 5.8:

yum groupinstall "Sound and Video"
yum install flash-plugin nspluginwrapper curl

Top 10 places to learn Linux online

Learn Linux Online

Learn Linux Online

I don’t have to brag on wonderfulness of Linux. As the use of Linux based operating systems in industry is increasing exponentially that it has definitely become a ‘need’ for the IT personnel now. Market needs Linux experts much more than they actually exist. Talking of statistics, growth of demand for good Linux developers is at 31 percent!

Learn Linux Online

Those who want to encash the opportunity, can choose to start learning Linux with few websites which are considered best at what they are doing. Following is the list of such websites:

1. PaulPaulito.com

PaulPaulito has not been there for a long time but looks promising so far. This Netherlands based website is offering training videos in English as well as Spanish and German. The organization running this website is a Linux Professional Institute (LPI) approved training partner. The courses are designed in a way that they help in preparation of LPI certification Exams. It also offers practice exams. This website is not free, costs about 67 USD per month.

2. LPI partners

LPI is a certification organization has its training partners all over the world. The site of LPI itself can be used to look up a training partner around your location.

3. Red Hat

Red Hat has its own training and certification programmes. Most of the courses offered by Red hat are targeted at Red Hat Enterprise Linux, being a Linux vendor has its own advantages. Online courses consists of Red Hat System Administration and Red Hat Linux Troubleshooting, fees starts from $1400.

4. BeginLinux.com

BeginLinux.com provides a variety of courses mainly focused on CentOS Server, Ubuntu Server and Apache Security. Plans start from 95.95$.

5. The Linux Foundation

Variety of online training courses are provided by The Linux Foundation. Classroom programmes are also available. Embedded Linux, the Linux Kernel, Open source Compliance are some courses to name a few of all that are included in offered courses. Advanced tools are used in delivering the course such as live Java-based virtual collaboration and Live audio conference bridge. You can use their search tool to find the course which can fit your need. Prices starting from $2750.

6. Canonical

If you are interested in learning with Ubuntu, Canonical can serve you with huge number of courses listed in their training section.

7. IBM

IBM has its own set of Linux courses. The price for its Linux training classes start at $675.

8. LinuxCertified

LinuxCertified is known to provide onsite training facilities along with distance learning options. You can opt for this at $99.

9. Novell OpenCourseWare

Novell provides free training with no registration overhead. The courses are training modules which help in better understanding of their product just like canonical and IBM.

10. The Virtual Training Company

A wide range of Linux Tutorials are available with The Virtual Training Company. Some content is kept free as well. The tutorials provided are either in Flash or QuickTime format. A user can get a chance to browse though 900 course on the site with a price tag of $30 on it.

These are the few sources which know what they are doing, there exist a lot more than these. We at LinuxStall also try to help you in getting comfortable with Linux. If you wish to add more sources to this list, we have our comment section open.

Linux Distros introduced in 2012

Choice and options are the beauty of Linux, petals just keep on adding to Linux family. Almost every day we have a new distro to try, explore and play with it. 2012 has been a wonderful year to Linux world, out of so many distros released this year following are some promising distros of 2012:

1. SolusOS

Desktop like environments are getting increasingly dominated by mobile-like environments, but not solusOS. SolusOS can be used by beginners and is a fork of GNOME 3 but the look and feel has been kept of our beloved GNOME 2. In words of project team

It works out of the box with great support for all your modern day computing needs including word processing, audio/video playback and editing, file sharing, and more,

If you want to taste the new solusOS then you can watch this video and if it really intrigues you, go have at it here.

2. Linux Lite

Linux Lite is an Ubuntu-based linux distribution and is mainly targeted at new comers, a very good beginners distro. It was launched in October, the current version is 1.0.2. It is offering five years of support and comes with xfce 4.8.
Its code name is “Amethyst” and can be downloaded from sourceforge.

3. Cinnarch

Cinnarch cant go unmentioned, project team says it is a distro that aims to provide

“a modern, elegant and powerful operating system based on one of the best Linux distributions out there, arch Linux, and featuring the popular Cinnamon desktop environment,”

It was first released in May but then it was officially declared beta in late November. Do give it a try- link.

4. Bedrock Linux

Bedrock Linux was created to make the most out of the best features of best Linux distros. Team says,

most of the (often seemingly mutually exclusive) benefits of various other Linux distributions available simultaneously and transparently,

To be precise,

“Bedrock Linux uniquely manipulates the filesytem and PATH to allow software from various other Linux distributions to coexist as though they were all from the same single, cohesive Linux distribution,”

“With Bedrock Linux, for example, one could have an RSS feed reader from Arch Linux’s AUR open a webpage in a Web browser from Ubuntu’s repos while both of them are running in an X11 server from Fedora.”

The motto of Bedrock Linux is to bundle all the best features from different distributions into one single Linux distro. A video will help in better understanding of the product. Download it here.

5. Qubes

Qubes OS is a security-oriented linux distribution which was first launched in September. It is based on Fedora desktop. It is powered by X Window System can run most linux applications. Release 2 is under ‘construction’, it is supposed to support Windows AppVMs. Current vertsion can be downloaded from here.

These were few worth mentioning Linux Distros of 2012 according to us, yes we do have our comment section open.