Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Thursday, August 29, 2013

Shells in Linux



A shell is a command-line interpreter or shell that provides a traditional user interface for the UNIX operating system and for Unix-like systems. Users direct the operation of the computer by entering commands as text for a command line interpreter to execute or by creating text scripts of one or more such commands. The versatility of the command-line shell is what really allows this, but what makes each shell different and why do people prefer one over another?

 Fig1: Shells in Linux

The most influential UNIX shells have been the Bourne shell and the C shell. The Bourne shell, sh, was written by Stephen Bourne at AT&T as the original UNIX command line interpreter; it introduced the basic features common to all the UNIX shells, including piping, here documents, command substitution, variables, control structures for condition-testing and looping and filename wildcarding. The language, including the use of a reversed keyword to mark the end of a block, was influenced by ALGOL 68. The C shell, csh, was written by Bill Joy while a graduate student at University of California, Berkeley. The language, including the control structures and the expression grammar, was modeled on C. The C shell also introduced a large number of features for interactive work, including the history and editing mechanisms, aliases, directory stacks, tilde notation, cdpath, job control and path hashing.

Users typically interact with a modern UNIX shell using a terminal emulator. Common terminals include xterm and GNOME Terminal. Both shells have been used as coding base and model for many derivative and work-alike shells with extended feature sets.

What Do Shells Do?

The command-line is a very interesting thing. Once considered to be the most advanced user interface, it has gone the way of waistcoats and fountain pens: shunned to the periphery. While you still see much of the purpose and utility in them, they’re usually left aside primarily for enthusiasts to appreciate, mainly because they spend the time to learn the ins and outs of them. Indeed, the command-line in any given operating system will have a lot of quirks because easy OS interprets commands differently. Today, this is mainly an issue between Linux, OS X, and Windows, but before this was a problem with most computers.

 Fig2: Shell types

Shells entered the picture and allowed a more standard extension of the command-line in a way that was much more inconspicuous. Shells added a lot of functionality, such as command and file name completion and more advanced scripting abilities, and helped bring some performance enhancements. They also did a lot to cover some annoying problems. For example, in Unix, you couldn’t back up through symlinks to the directories before you followed them. All in all, they added some features that allowed users to get their jobs done more quickly and efficiently, just like Linux’s plethora of alternative Window Managers.

Why Are There So Many?

The most prominent progenitor of modern shells is the Bourne shell – known as ‘sh’ – which was named after its creator Stephen Bourne who worked at AT&T. It became the default UNIX command-interpreter because of its support for command substitution, piping, variables, condition-testing, and looping, along with other features. This was in an era that programming really went along with using the command-line, a practice that many argue has been diluted today. It did not offer users much leeway in customizations for users, such as aliases, command completion and shell functions.

Fig3: Shell varieties

C shell (‘csh’) was developed Bill Joy at UCB and really shook things up. It added a lot of interactive elements that users could use to control their systems, like aliases (shortcuts for long commands), job management abilities, command history, and more. It was modeled off of the C programming language, an interesting idea because UNIX was written in C. It also meant that users of the Bourne shell had to learn C so they could enter commands in it. In addition, it had tons of bugs which had to be hammered out by users and creators alike over a large period of time. People ended up using the Bourne shell for scripts because it handled non-interactive commands better, but stuck with the C shell for normal use.

Over time, lots of people fixed the bugs in and added features to the C shell, culminating in something called ‘tcsh’. The problem, then, was that in distributed Unix-based computers, csh was still the default, and had some added “non-standard” features added in, creating a very fragmented mess of things (in retrospect). Then, David Korn from AT&T worked on the Korn shell – ‘ksh’ – which tried to mitigate the situation by using the Bourne shell’s language as a basis, but added in all of the new features that everyone was accustomed to. Unfortunately for many, it wasn’t free.

 Fig4: tcsh

Another response to the hectic proprietary csh implementations was the Portable Operating System Interface for UNIX, or POSIX. It was a successful attempt at creating a standard for command interpretation and eventually mirrored a lot of the features that the Korn shell had. Simultaneously, the GNU project was going on and was an attempt at creating a free operating system that was completely Unix-compatible. It developed a shell for its own purpose: the Bourne Again shell, formed by bashing together features from sh, csh, and ksh. The result, as seen in retrospect, was pretty impressive.
Kenneth Almquist created a Bourne shell clone – ‘ash’ – that was POSIX-compatible and would become the default shell in BSD, a different branch/clone of UNIX. Its uniqueness is that it’s really lightweight, so it became extremely popular in embedded-Linux systems. If you have a rooted Android phone that has Busy Box installed, it’s using code from ash. Debian developed a clone based on ash called ‘dash’.
 

Fig5: Ash

One of the most prominent of “new” shells is ‘zsh’, developed by Paul Falstad in 1990. It’s a Bourne-style shell that takes features from bash and previous shells and adds even more features. It has spell-checking, the ability to watch for logins/logouts, some built-in programming features like bytecode, support for scientific notation in syntax, allows for floating-point arithmetic, and then some. Another is the Friendly Interactive Shell, ‘fish’, which focuses on command syntax that’s easy to remember and use.

On the whole, most shells were created as clones of previous shells that added functionality, fixed bugs, and bypassed licensing issues and fees. The notable exceptions are the original Bourne shell and the C shell, and both rc shell and ash which aren’t entirely original but definitely have some niche-utility.

Which Should I Use?

With so many out and about, you’d think that it’s hard to choose which shell to use, but it’s actually not very difficult. Since so many are based off of Bourne shell, basic things will be the same between most shells.

 Fig6: Shell choices

Bash is the most widely used shell out there and is the default for most Linux distributions. It’s really robust and has tons of features, most of which you probably won’t use unless you program, so it’s pretty safe to say you can stick to this one. Because it’s so common, it’s perfect for scripting things that will be used across different platforms. If you want to try something different that’s a little more user-friendly, you can try out fish instead.

If you tinker with embedded-Linux systems a lot, like to put Linux on ridiculous things like your Nintendo DS, or you really like Debian, then ash/dash is probably best suited for you. Again, it works mostly like the others, but since it’s sort of bare-bones and light-weight, you’ll find some more complicated functionality missing.


Fig7: Zsh

If you plan on programming or learning to develop on the command-line, then you’ll have to be a little choosier. Bash is a fine choice, but I know enough people who have switched to Zsh for its extras. I guess it really depends on how complicated your projects will get and what type of functionality you prefer from your shell. Some people still stick to tcsh because they know and use C regularly and it’s easier for them. Odds are that if you’re not sure which shell to choose, you probably don’t program much, so try to choose something that will line up with what you want to learn and do some research on what others in that field use.
You can easily install and remove different shells using the Software Center on Ubuntu or your preferred package manager. Shells are located in the /bin/ directory, and as long as you’re running a modern Linux distribution, it’s easy to change what your default is. Just enter the following command:

  • chsh

You’ll be prompted for your password, and then you can change to a different shell by entering its path.
 

Fig8: Chsh 

In square brackets, you’ll see your current default, and if you want to leave it as-is, just hit Enter.

So guys, which shells you use or prefer? Do comment.

Friday, August 9, 2013

Run-levels in Linux



A run level is a state of init and the whole system that defines what system services are operating. Run levels are identified by numbers. Some system administrators use run levels to define which subsystems are working, e.g., whether X is running, whether the network is operational, and so on. Others have all subsystems always running or start and stop them individually, without changing run levels, since run levels are too coarse for controlling their systems. You need to decide for yourself, but it might be easiest to follow the way your Linux distribution does things. The following table defines how most Linux Distributions define the different run levels. However, run-levels 2 through 5 can be modified to suit your own tastes. 

0
Halt the system.
1
Single-user mode (for special administration).
2
Local Multiuser with Networking but without network service (like NFS)
3
Full Multiuser with Networking
4
Not Used
5
Full Multiuser with Networking and X Windows(GUI)
6
Reboot.
Table: Run-Levels in Linux

When a Linux system boots, it enters its default run level and runs the startup scripts associated with that run level. You can also switch between run levels – for example, there’s a run level designed for recovery and maintenance operations.


Fig1: Readme File

Traditionally, Linux used System V-style init scripts – while new init systems will eventually obsolete traditional run levels, they haven’t yet. For example, Ubuntu’s Upstart system still uses traditional System V-style scripts. "Runlevel" defines the state of the machine after boot. Different runlevels are typically assigned to:
  • Single-user mode
  • Multi-user mode without network services started
  • Multi-user mode with network services started
  • System shutdown
  • System reboot

 What is a Run level?

When a Linux system boots, it launches the init processes. init is responsible for launching the other processes on the system. For example, when you start your Linux computer, the kernel starts init, and init executes the startup scripts to initialize your hardware, bring up networking, and start your graphical desktop.
However, there isn’t just one single set of startup scripts init executes. There are multiple run levels with their own startup scripts – for example, one run level may bring up networking and launch the graphical desktop, while another run level may leave networking disabled and skip the graphical desktop. This means you can drop from “graphical desktop mode” to “text console mode without networking” with a single command, without manually starting and stopping different services.
More specifically, init runs the scripts located in a specific directory that corresponds to the run level. For example, when you enter run level 3 on Ubuntu, init runs the scripts located in the /etc/rc3.d directory.


Fig2:rc3d File

At least, this is how it works with a traditional System V init system – Linux distributions are beginning to replace the old System V init system. While Ubuntu’s Upstart currently maintains compatibility with SysV init scripts, this is likely to change in the future.

Run levels:

Some run levels are standard between Linux distributions, while some runlevels vary from distribution to distribution.
The following runlevels are standard:
  • 0 – Halt (Shuts down the system.)
  • 1 – Single User Mode (The system boots into super user mode without starting      daemons or networking. Ideal for booting into a recovery or diagnostics environment.)
  • 6 – Reboot
Run levels 2-5 vary depending on distribution. For example, on Ubuntu and Debian, run levels 2-5 are the same and provide a full multi-user mode with networking and graphical login. On Fedora and Red Hat, runlevel 2 provides multi-user mode without networking (console login only), runlevel 3 provides multi-user mode with networking (console login only), runlevel 4 is unused, and runlevel 5 provides multi-user mode with networking and graphical login.

Switching to a Different Runlevel:

To switch to a different runlevel while the system is already running, use the following command:

            sudo telinit #

Replace # with the number of the runlevel you want to switch to. Omit sudo and run the command as root if you’re running a distribution that doesn’t use sudo.

 Fig3:Terminal window

Booting Directly to a Specific Runlevel:

You can select a runlevel to boot into from the boot loader – Grub, for example. At the start of the boot process, press a key to access Grub, select your boot entry, and press e to edit it.
 

Fig4:Login window

You can add single to the end of the Linux line to enter the single-user runlevel (runlevel 1). (Press Ctrl+x to boot after.) This is the same as the recovery mode option in Grub.

 Fig5:Mode verify

Traditionally, you could specify a number as a kernel parameter and you’d boot to that runlevel – for example, using 3 instead of single to boot to runlevel 3. However, this doesn’t appear to work on the latest versions of Ubuntu – Upstart doesn’t seem to allow it. Similarly, how you change the default runlevel will depend on your distribution.
While Ubuntu’s Upstart daemon still emulates the SystemV init system, much of this information will change in the future. For example, Upstart is event-based – it can stop and start services when events occur (for example, a service could start when a hardware device is connected to the system and stop when the device is removed.) Fedora also has its own successor to init, systemd.

Saturday, August 3, 2013

What is Picture Password in windows 8

Hi friends, recently I had some new experiences with Windows 8 which I would like to share with you all. It's about the picture password- a new type of password recognition method to allow the user to use the program according to its authorities provided by the administrator.
                                                              
So the picture password can be used in Windows 8 for login purpose by the different users of  the same computer. A Picture password can look like the pattern making method of password which can be generally seen now a day in many of the android phones.


But it’s not same in Windows 8 like you are seeing above. For the pattern making method image is fixed i.e. it will be a matrix display of 3x3 or any AxB. But in picture password you have a choice to select any of the images for your password procedure. And here it’s your choice to do anything on the image like tapping somewhere with cursor or dragging a cursor in any specific manner as you like and can remember as a password and repeat the process for confirmation. After the confirmation, while login next time you have to repeat the same steps you did as to create the password.

Here are the steps to create PICTURE PASSWORD:-


· Open the settings of windows 8, by taking your cursor to right corner of the screen and to the last row of the new emerged window is SETTINGS.

    ·Click to the last option "Change PC settings".


  • ·Choose the option "User".


  • On clicking "User", on right side you will see an option "Create a Picture Password"


  • Enter the current Password for making further changes. (Only if you have created a password ever on your pc)


  • Now choose a specific picture to keep it as a password, option appearing on the left side of the screen.


  • Perform any three operations called as gestures such as
        i)  Tapping on the picture's specific part
       ii) Or dragging any lines, circle or anything of your choice.

    Perform any of three operations; remember the sequence of operations and the position of your cursor while performing it.

    Note: Don’t worry in between if you forget your 1st or 2nd gesture while creating password, you can again start it over from 1st step.

     For example here,


    Step 1: I made a tap on the thumb.




Step 2: I dragged a line over the alphabet 'i' of "like".



Step 3: Making round circle over the alphabet 'o' of "Do".





Selecting an image containing texts would make you remember of making the gestures properly. Otherwise you can choose any image of your choice.

·Repeat the above three gestures exactly you made it for the first time.
·After confirmation you can use this picture password either your text password while login.

Hope, you will have fun using picture password of windows 8.

If you have any queries related to this, please let  me know.

Thank You.