Linux Inerview Questions

1) Difference between setuid and sticky bit in linux?</p>

Set UID: When a Set UID bit is turned on for a program, your EUID (effective user ID) becomes the same as the program’s owner when you run the program. You also gain all the privileges of the program’s owner. In other words, if user freddie runs a Set UID program owned by user root, freddie has superuser privileges while that program is running. Set UID affects programs only; it’s really not important for data files and directories. If you find a Set UID program, read the WARNING!!!

Warning: Set UID programs are potentially dangerous.Users can gain extra privileges by using files that grant them superuser privileges.

Set GID: The Set GID bit works similarly to Set UID — anyone running the program gains all the privileges of the group. When the Set GID box is checked for a directory, the files in that directory belong to that group regardless of who puts the files in the directory.

Sticky bit: Checking the Sticky box affects directories only. If this box is checked, you can’t remove (or rename) a file in that directory unless you’re the file owner.

2) What is SSH and SSL?

Ans: SSL stands for "Secure Sockets Layer". It commonly uses port 443 to connect your computer to a secure server on the Internet. SSL is most often used for transmitting credit card, tax, banking, or personal information to a business server somewhere. Examples of SSL: you are purchasing a DVD from Amazon.com, you are filing your taxes online, or you are transferring funds between your checking and savings accounts.

SSH stands for "Secure Shell". SSH commonly uses port 22 to connect your computer to another computer on the Internet. It is most often used by network administrators as a remote login / remote control way to manage their business servers. Examples would be: your email administrator needs to reboot the company email server from his home, or your network administrator needs to reset your office password while she is away at a conference.

Both SSL and SSH strive to create confidential connections across the Net. With only a very few exceptions, it is not possible for a regular hacker to break into an SSL or SSH connection...the encryption technology is as reliable as 21st century programming can make it.

When you are trying to transmit financial information or internal business documentation, it is highly advisable that you only do so with an SSL or SSH type of connection.

Both SSL and SSH are special encryption and protocol technologies used to connect two computers. SSL and SSH lock out eavesdroppers by encrypting (ciphering) the connection, and scrambling the transmitted data so it is meaningless to anyone outside of the two computers.

3) What is Daemon for DNS?

Ans: Named

4) Which is the configuration file for apache server?

/etc/httpd/config/httpd.cconf

5) How to check kernel version?

uname -r

6) How to check Linux version ?

uname -a is a linux command that will output useful information about your linux distribution, kernel version, cpu information and more.

cat /etc/linux-release

7) How to check --hardware-platform (arch)

cat /proc/cpuinfo
 How to change password of root ?

from single use mode

9) In Linux which password inscription is used ?

MD5

10) what is boot loader?

Bootloader is a piece of code that runs before any operating system is running.

Bootloader are used to boot other operating systems, usually each operating system has a set of bootloaders specific for it.

Bootloaders usually contain several ways to boot the OS kernel and also contain commands for debugging and/or modifying the kernel environment.

In this talk we will concentrate on Linux bootloaders.

Since it is usually the first software to run after powerup or reset, it is highly processor and board specific.

11) How to Remount file system

mount -o remount,rw

 few more

  • How do you take a single line of input from the user in a shell script?
  • Write a script to convert all DOS style backslashes to UNIX style slashes in a list of files.
  • Write a regular expression (or sed script) to replace all occurrences of the letter ‘f’, followed by any number of characters, followed by the letter ‘a’, followed by one or more numeric characters, followed by the letter ‘n’, and replace what’s found with the string “UNIX”.
  • Write a script to list all the differences between two directories.
  • Write a program in any language you choose, to reverse a file.
  • What are the fields of the password file?
  • What does a plus at the beginning of a line in the password file signify?
  • Using the man pages, find the correct ioctl to send console output to an arbitrary pty.
  • What is an MX record?
  • What is the prom command on a Sun that shows the SCSI devices?
  • What is the factory default SCSI target for /dev/sd0?
  • Where is that value controlled?
  • What happens to a child process that dies and has no parent process to wait for it and what’s bad about this?
  • What’s wrong with sendmail? What would you fix?
  • What command do you run to check file system consistency?
  • What’s wrong with running shutdown on a network?
  • What can be wrong with setuid scripts?
  • What value does spawn return?
  •  Write a script to send mail from three other machines on the network to root at the machine you’re on. Use a ‘here doc’, but include in the mail message the name of the machine the mail is sent from and the disk utilization statistics on each machine?
  • Why can’t root just cd to someone’s home directory and run a program called a.out sitting there by typing “a.out”, and why is this good?
  • What is the difference between UDP and TCP?
  • What is DNS?
  • What does nslookup do? 
  • How do you create a swapfile?
  • How would you check the route table on a workstation/server?
  • How do you find which ypmaster you are bound to? 
  • How do you fix a problem where a printer will cutoff anything over 1MB?
  • What is the largest file system size in solaris? SunOS?
  •  What are the different RAID levels?

</div>

comments powered by Disqus