Posts

Showing posts with the label UNIX

Year 2038 problem

Image
The  year 2038 problem  may cause some computer software to fail at some point near the year 2038. The problem affects all software and systems that both store system time as a signed 32-bit integer, and interpret this number as the number of seconds since 00:00:00 UTC on Thursday, 1 January 1970. [1]  The furthest time that can be represented this way is 03:14:07 UTC on Tuesday, 19 January 2038. [2]  Times beyond this moment will "wrap around" and be stored internally as a negative number, which these systems will interpret as a date in 1901 rather than 2038. This is caused by integer overflow. The counter "runs out" of usable digits, "increments" the sign bit instead, and reports a maximally negative number (continuing to count  up , toward zero). This is likely to cause problems for users of these systems due to erroneous calculations. Further, while most programs will only be affected in or very close to...

Solaris10 UNIX: How to Configure DNS Client / name server

How do you set DNS namserver under Sun Solaris UNIX system? The resolver is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). The resolver configuration file contains information that is read by the resolver routines the first time they are invoked by a process. The file is designed to be human readable and contains a list of keywords with values that provide various types of resolver information. Internet address (in dot notation) of a name server that the resolver should query. Up to MAXNS (currently 3, see  ) name servers may be listed, one per keyword. If there are multiple servers, the resolver library queries them in the order listed. To configure Solaris nameserver edit or modify /etc/resolv.conf file. DNS Client Setup First Create the file called /etc/resolv.conf - which includes the primary and secondary DNS server IP address for Solaris system, it can be your own DNS server or your ISPs DNS server: # touch /etc/...

Solaris IPMP (IP Network Multipathing)

Image
The  IP network multipathing  or  IPMP  is a facility provided by Solaris to provide fault-tolerance and load spreading for network interface cards (NICs). With IPMP, two or more NICs are dedicated for each network to which the host connects. Each interface is assigned a static "test" IP address, which is used to assess the operational state of the interface. Each virtual IP address is assigned to an interface, though there may be more interfaces than virtual IP addresses, some of the interfaces being purely for standby purposes. When the failure of an interface is detected its virtual IP addresses are swapped to an operational interface in the group. The IPMP load spreading feature increases the machine's bandwidth by spreading the outbound load between all the cards in the same IPMP group. in.mpathd  is the daemon in the Solaris OS responsible for IPMP functionality. Purpose of IP network Multipathing: In a highly available server con...

Breaking Out Of A sudo Shell

Breaking Out Of A sudo Shell I’ve been meaning to write this up for a while, but had a post go by on one of the SecurityFocus mailing lists that motivated me to get it done. The post asked, “How do you restrict sudo so a user can not delete the whole hard drive?”. The short answer is, it is extremely difficult. Sudo is a security tool used within the UNIX and Linux world. It permits the Administrator to restrict access to high-level commands. It differs from the su command in that su immediately gives the user root level access. Sudo permits the Administrator to fine-tune which root commands can actually be accessed. In addition, sudo creates an audit trail of all executed commands. The problem with sudo is that it has no visibility when a tool permits a command shell to be spawned. This means a user can misbehave on the system while generating an audit trail, which makes it appear they have done nothing wrong. Try it yourself I’m going to walk you through an example so you can exper...

Unix Commands Part 8

System Status at , chmod , chgrp , chown , crontab , date , df , du , env , finger , ps , ruptime , shutdwon , stty , who . At command. at command along with crontab command is used to schedule jobs. at options time [ddate] [+increment] is syntax of at command. for example if I have a script named usersloggedin which contains. #!/bin/ksh who | wc -l echo "are total number of people logged in at this time." and I want to run this script at 8:00 AM. So I will first type at 8:00 %lt;enter> usersloggedin %lt;enter> I will get following output at 8:00 AM 30 are total number of people logged in at this time. Options: -f file will execute commands in a file. -m will send mail to user after job is completed. -l will report all jobs that are scheduled and their jobnumbers. -r jobnumber will remove specified jobs that were previously scheduled. Chmod command. chmod command is used to change permissions on a file. for example if I have a text file with calender in it ca...

Unix Commands Part 7

Storage commands compress uncompress , cpio , dump , pack , tar , mt . Compress command. Compress command compresses a file and returns the original file with .z extension, to uncompress this filename .Z file use uncompress filename command. syntax for compress command is compress options files Options -bn limit the number of bits in coding to n. -c write to standard output (do not change files). -f compress conditionally, do not prompt before overwriting files. -v Print the resulting percentage of reduction for files. Uncompress command. Uncompress file uncompresses a file and return it to its original form. syntax is uncompress filename.Z this uncompresses the compressed file to its original name. Options -c write to standard output without changing files Cpio command. cpio command is useful to backup the file systems. It copy file archives in from or out to tape or disk, or to another location on the local machine. Its syntax is cpio flags [options] It has three flags, -i, -...

Unix Commands Part 6

Communications cu , ftp , login , rlogin , talk , telnet , vacation and write . Cu command. cu command is used for communications over a modem or direct line with another Unix system. Syntax is cu options destination Options -b n process lines using n-bit characters (7 or 8). -c name Search UUCP's device file and select local area network that matches name. -d Prints diagnostics. -e sends even parity data to remote system -l line communicate on this device (line=/dev/tty001, etc) -n prompts for a telephone number. -s n set transmission rate to n(e.g 1200,2400,9600, BPS) Destination telno is the telephone number of the modem to connect to. system is call the system known to uucp. aadr is an address specific to LAN. Ftp command (protocol). ftp command is used to execute ftp protocol using which files are transferred over two systems. Syntax is ftp options hostname options -d enable debugging. -g disable filename globbing. -i turn off interactive prompts. -v verbose on...

Unix Commands Part 5

Shell and programming Shell programming , bourne shell , ksh , csh , echo , line , sleep , test , cc compiler . Shell programming concepts and commands. Shell programming is integral part of Unix operating systems. Shell is command line userinterface to Unix operating system, User have an option of picking an interface on Unix such as ksh, csh, or default sh., these are called shells(interface). Shell programming is used to automate many tasks. Shell programming is not a programming language in the truest sense of word since it is not compiled but rather an interpreted language. Unix was written in C language and thus c language is integral part of unix and available on all versions. Shells, like ksh and csh are popular shells on unix although there are 5 or 6 different shells available but I will only be discussing ksh and csh as well as sh. Common features among all shells are job control, for example if I am running a processes which is searching the whole system for .Z files and o...