UNIX NetWork

Security, NMAPDecember 31, 2005 7:35 am

nmap -sp 192.168.1.1/24

nmap -v -sS -O -p 1-80 123.123.123.123

nmap -sP 192.168.1.0-225

# nmap -v -sS -P0 -A ip

PortSentry

Debian 7:28 am

dpkg-reconfigure xserver-xfree86

/dev/psaux ps/2
——————————————————————————————-
modprobe psmouse
modprobe mousedev
——————————————————————————————-
London Radio http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=260169&file=filename.pls

PhilosophyDecember 13, 2005 4:53 am

linux is for people who hate Windows
and BSD is for people who love UNIX. ;)

NetBSDDecember 11, 2005 5:28 pm

using “sh” as a shell

export CVSROOT=”anoncvs@anoncvs.NetBSD.org:/cvsroot”
export CVS_RSH=ssh
cd /usr
cvs checkout -P pkgsrc

to update pkgsrc

cd to the pkgsrc directory then

#cvs -q update -dP

Irix, SGIDecember 9, 2005 2:48 am

Setting Up a Cable Modem on SGI/IRIX: HOWTO

The world would be a better place if everyone wrote down what they know and put it on the Web. — Philip Greenspun

Please tell me how this procedure worked for you by sending e-mail to james@unifiedmind.com If you can add comments or a link to related information, then do so by clicking “Add a comment” or “Add a link” at the bottom of this page.
The Big Picture

You want to set up an IRIX box to use a cable modem, and your ISP dynamically assigns an IP address when you connect. This document explains how to configure an IRIX system to use a cable modem, and it is the procedure I used to connect my SGI O2, running IRIX 6.5, to RoadRunner’s cable service — my RoadRunner service does not require log in software. If your service requires log in software, see Sean Houghton’s Usenet posting.
Outline

* Things You Need Before You Begin
* Configure DHCP
* Set the Default Gateway and Name Servers
* Troubleshooting

Things You Need Before You Begin

* Root access on your IRIX box
* Means of accessing this procedure when you are offline (procedure requires a reboot before you complete the steps)
* Your ISP’s default gateway and the IP of its primary and secondary name server

To get this information, either call your ISP or connect to it with another system and get the information from that system. For example:

1. Connect your Win 9x system to the Internet using your cable modem
2. Click Start -> Run
3. Type: winipcfg, hit
4. Click “More Info”
5. Write down the primary and secondary DNS servers (click “…” to get the second one)
6. Write down the default gateway and netmask (shouldn’t need the netmask but just in case you do)

Configure DHCP

1. Connect the cable modem to your IRIX box with an ethernet cable (use a patch cable, not a cross-over cable)
2. Reset the modem by unplugging the power connector and plugging it back in
3. Log in to your IRIX box
4. Open a winterm and su to root:

coyote ~ 1% su -
password:

5. Ensure that autoconfig_ipaddress is turned on:

coyote 1# /etc/chkconfig autoconfig_ipaddress on
coyote 2# /etc/chkconfig

Flag State
==== =====

autoconfig_ipaddress on

By setting autoconfig_ipaddress to on, you are telling your system to run proclaim at boot time. For more information on proclaim, read its man page by typing man proclaim at a prompt — here’s an excerpt:

Proclaim is a client that communicates with a DHCP server to obtain configuration parameters, including at least an IP address. The format of DHCP messages is based on the format of bootp messages, described in RFC 951. A detailed protocol specification of DHCP is in RFC 1541, available from the Network Information Center.

The DHCP protocol uses UDP/IP as its transport mechanism. The DHCP server receives service requests at the UDP port indicated in the bootp service description contained in the file /etc/services; see services(4).

Proclaim can be used to setup and configure new systems automatically, and to move systems from one net to another without administrative intervention. It can also be used to automatically verify current configurations at reboot. Only the superuser can employ proclaim. If the primary network interface is changed, proclaim updates the netaddr variable in the NVRAM.

In the absence of the DHCPoptionsToGet keyword, proclaim requests the following configuration parameters from an available DHCP server:
* an IP address
* the lease duration (3 year default)
* the subnet mask
* hostname (users may be allowed to choose their own)
* NIS domainname if the NIS option is installed.
* IP address of the DHCP server; see dhcp_bootp(1M).

As you can see, proclaim will automatically set the IP address, subnet mask, hostname, and IP address of the DHCP server. But, it does NOT set the default gateway or the name servers.

Set the Default Gateway and Name Servers
Beginning from Toolchest:

1. Click System -> System Manager -> Networking and Connectivity -> Set Up and Start Networking -> Next
2. Select the network interface to configure: Ensure that the interface connecting the cable modem is selected, click Next
3. Specify a hostname and IP address:
1. Ensure that Use DHCP Client is NOT checked (proclaim will handle this function)
2. Enter a hostname (ex: coyote) — proclaim will probably prepend it to your ISPs domain (ex: coyote.hot.rr.com)
3. Enter an arbitrary IP address and netmask (proclaim will set these at boot time, but this configurator requires that you enter something)
4. Click Next
4. Confirm your settings: Click OK
5. DO NOT restart your system

Back in the System Manger (window should still be open from earlier):

1. Click Modify Network Settings -> Next
2. Set the state of the primary network interface: Ensure that the primary network interface is enabled, click Next
3. Add a default route to the network routing table: Select “add default route”, and enter the IP address of your ISP’s default gateway, click Next
4. Disable (or enable) IP forwarding: this is up to you (I have mine disabled), click Next
5. Set DNS name server entries: Enter the IP for your ISP’s primary and secondary name servers, click Next
6. Specify host resolution order: Set it how you want it (mine is set as “Files”, “DNS”, “None”), click Next
7. Confirm your settings: Click Next
8. Reboot the system: As the system comes up, watch to see if the IP, hostname, and subnet mask are set and if any errors occur

When the system comes back up, you should be online. Open a terminal and ping www.yahoo.com.
Troubleshooting
First, su to root.

* Reset your modem again (unplug it, plug it back in), and then run proclaim manually:

coyote 1# /usr/etc/proclaim
Configuring ec0 as coyote
add net default: gateway 24.162.136.1
Network daemons: portmap named.
Name services: nsd.
NFS daemons: nfsd biod.
Internet daemons: inetd timed.

* Check to see if you have been assigned and IP, the netmask is correct, and it says “UP:

coyote 2# /usr/etc/ifconfig ec0
ec0: flags=c43
inet 24.162.139.164 netmask 0xfffffc00 broadcast 24.162.139.255

If it doesn’t say up, bring it up:

coyote 3# /usr/etc/ifconfig ec0 up

* Check the config files:

coyote 4# cat /var/adm/proclaim.lease_info_ascii.ec0

HostIPaddress: 24.162.139.164
DHCPserverName:
MessageType: 5
ServerIPaddress: 24.26.193.65
LeaseTimeInSecs: 86400
NetworkMask: 0xfffffc00
DNSdomainName: hot.rr.com

coyote 5# cat /etc/config/static-route.options

$ROUTE $QUIET add net default 24.162.136.1

* Check netstat

coyote /var/adm 6# netstat -rn
Routing tables

Internet:
Destination Gateway Netmask Flags Refs Use Interface
default 24.162.136.1 UGS 6 121 ec0
24.162.136 link#1 0xfffffc00 UC 0 0 ec0
127.0.0.1 127.0.0.1 UH 19 3 lo0
224 link#1 0xf0000000 UCS 0 0 ec0

coyote /var/adm 62# netstat -ian
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
ec0 1500 24.162.136 24.162.139.164 59519 0 56688 0 5022
224.0.0.1
239.7.7.0
224.2.127.255
224.0.0.9
224.2.127.254
08:00:69:0c:38:32
lo0 8304 127 127.0.0.1 29884 0 29884 0 0
224.0.0.1

* Manually add a default route (replace “GATEWAY_IP” with the actual IP of your ISP’s gateway):

coyote 7# /usr/etc/route add default GATEWAY_IP

Try pinging www.yahoo.com again. If it still doesn’t work…

* Consider flushing you network routing tables, and then add the default gateway again:

coyote 8# /usr/etc/route flush
coyote 9# /usr/etc/route add default GATEWAY_IP

Trying pinging www.yahoo.com again. If it still doesn’t work…

* Set the modem’s IP as the default route instead of the ISP’s gateway (replace HOST_IP_ADDRESS with the IP address from cat proclaim.lease_info_ascii.ec0:

NOTE: This does not work for me, but some others have suggested it.

coyote 10# /usr/etc/route add default HOST_IP_ADDRESS

If it still doesn’t work…

* Experiment or use http://groups.google.com to search the comp.sys.sgi.* archives.

DebianDecember 8, 2005 4:11 pm

Paquet à installer : # apt-get install apache2

Pour valider qu’Apache fonctionne correctement, il faut saisir l’adresse suivante dans un navigateur :

http://localhost

La commande suivante permet de démarrer, d’arrêter, de redémarrer ou de recharger le serveur :

# /etc/init.d/apache2 start (ou stop ou restart ou reload)

Installation de MySQL 4
Paquet à installer :

apt-get install mysql-server

La commande suivante permet de démarrer, d’arrêter, de redémarrer ou de recharger le serveur :

# /etc/init.d/mysql start (ou stop ou restart ou reload)

Si aucun mot de passe n’a encore été défini pour MySQL, la commande suivante sous root permet d’entrer dans le mode ligne de commande de MySQL pour valider que tout fonctionne :

# mysql

Saisir « quit » pour sortir du mode de commande de MySQL.

Si un mot de passe a été défini pour l’utilisateur « root » de MySQL, la commande suivante permet de se connecter à MySQL depuis n’importe quel utilisateur Linux :

$ mysql -u root -p

Installation de PHP
Paquets à installer pour PHP avec le support de MySQL, la possibilité de créer des scripts php (/usr/bin/php) et la libraire pour faire fonctionner apache2 avec php4 :

apt-get install php4 php4-mysql php4-cli libapache2-mod-php4

Après avoir installé PHP, vous pouvez redémarrer apache, mais normalement ce n’est pas nécessaire :

/etc/init.d/apache2 restart

Pour vérifier que PHP fonctionne correctement avec apache, il faut créer par exemple le fichier « test.php » dans « /var/www » contenant la commande suivante :

< ? phpinfo(); ?>

Et ensuite depuis un navigateur, il faut saisir l’adresse suivante :

http://localhost/test.php

Activer le module MySQL dans PHP
Par défaut, Le module MySQL n’est pas activé dans PHP. Par exemple, si vous utilisez la fonction « mysql_connect », vous aurez le message d’erreur suivant :

Fatal error : Call to undefined function

Pour activer ce module, il faut décommenter la ligne « extension=mysql.so » du fichier « /etc/php4/apache2/php.ini »

Et redémarrer apache :

# /etc/init.d/apache2 restart

Installation de phpmyadmin
Paquet à installer :

apt-get install phpmyadmin

Pour vérifier que « phpmyadmin » fonctionne, il faut saisir l’adresse suivante dans un navigateur :

http://localhost/phpmyadmin

Une fenêtre de connexion à MySQL doit apparaître et si aucun mot de passe n’a encore été défini dans MySQL, il faut mettre « root » en nom d’utilisateur et ne rien mettre en mot de passe.

Après cette installation, je vous conseille vivement de mettre un mot de passe à l’utilisateur « root » de MySQL en cliquant sur le lien « Modifier le mot de passe ».