sobota 11. februára 2012

Post install settings 3

1.Locate
Basically, you have two ways how to search files through filesystem.
You can use command "find" or "locate".
Find: - this is live search as you know and scans. You can be 100% sure about results, because they are current.
Locate: - first you have to build a database of files stored in filesystem and then this command searches within this indexed database. So search results are instant but database don't have to be up to date, accordingly your results will not get entire results.
 
To update local database use:
/usr/libexec/locate.updatedb

Depends on amount of files, this process can take a lot of time.
You can run this script periodically via "cron" etc. after midnight (on server). 


Can happen, you don't need to index some filesystems, directories or so. Than look into /etc/locate.rc. This is config file for above script. You can configure for example:
SEARCHPATHS="/" - this causes to start indexing all files beyond "/" (root path).
PRUNEPATHS="/tmp" - this exclude paths from indexing
With above, you can make indexing more effective and faster.

I use "locate" very often to localize commands to check full path etc. It makes your work (scripting) easier because of speed. Be sure your database is up to date.


2. Set password
After minimal install, your root password is blank. It's better to use password for further purposes and basic security. (Generally all varies whether you use computer alone or it's shared or it's server.)
Very simple:
passwd - prompts you to type your new password
passwd [user] - same, but for another user

3. Connectivity
Your system don't have connectivity to network after base installation, even you have router on the end side with DHCP.
Basically, you can set network parameters statically or dynamically.
You need to know the name of your NIC. One way is to use "ifconfig" command to figure it out. 
For example I can see: ale0
"ale0" is mentioned name of NIC. To check little bit more use:
dmesg | grep ale0
result: ale0: <Atheros AR8121/AR8113/AR8114 PCIe Ethernet>
Don't forget to change interface to yours.

1.Static configuration
ifconfig ale0 inet [IP] netmask [mask]
ifconfig ale0 up
route add default [IP] 
(if you don't know what some parameter mean or you want to know more, check man ifconfig)
If you want preserve network parameters after system start, you have to edit "/etc/rc.conf" file:
ifconfig_ale0="inet [IP] netmask [mask]"
defaultrouter="[IP]"
Your DNS servers put into "/etc/resolv.conf"
etc.: nameserver [IP]

2.Dynamic configuration
dhclient ale0
To check assigned parameters do "ifconfig" + you can take a look into "/var/db/dhclient.leases.[interf]".
You can affect some parameters of dhcp via "/etc/dhclient.conf". Check the man for this config.
Put follows into rc.conf to preserve dhcp after next boot:
ifconfig_ale0="DHCP"
or ifconfig_ale0="SYNCDHCP" - booting will continue after dhcp assignment. 


After your interface is set, try to ping internal IP, public IP and public name (google.com).


For more informations check handbook / handbook.







Žiadne komentáre:

Zverejnenie komentára