venerdì 28 giugno 2013

CentOS FTP Service Configuration

install the ftp server
yum install vsftpd


start it for the first time
/etc/init.d/vsftpd start


enable users to use their home directory
/usr/sbin/setsebool -P ftp_home_dir 1


it may still be needed to change the firewall configuration.

lunedì 24 giugno 2013

CentOS Software Packages Management

show installed packages:
yum list [all|installed]
rpm -qa

search for a package into the name and the summary only:
yum search <string1> [...] [stringN]

search for a package in all the fields:
yum search all <string1> [...] [stringN]

search for the package providing a particular file:
yum provides </path/to/file>

get informations about a package:
yum info <package>

install a package from the repository:
yum install <package>

uninstall a package:
rpm -e <package>

show the files installed by a package:
rpm -ql <package>

...
man yum
man rpm

CentOS Services Management

[root@centoshost ~]# chkconfig --list
auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
blk-availability        0:off   1:on    2:on    3:on    4:on    5:on    6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
lvm2-monitor    0:off   1:on    2:on    3:on    4:on    5:on    6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
postfix         0:off   1:off   2:on    3:on    4:on    5:on    6:off
rdisc           0:off   1:off   2:off   3:off   4:off   5:off   6:off
restorecond     0:off   1:off   2:off   3:off   4:off   5:off   6:off
rsyslog         0:off   1:off   2:on    3:on    4:on    5:on    6:off
saslauthd       0:off   1:off   2:off   3:off   4:off   5:off   6:off
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
udev-post       0:off   1:on    2:on    3:on    4:on    5:on    6:off
[root@centoshost ~]#

list a specific service:
chkconfig --list <service_name>

enable/disable a service for runlevels 2, 3, 4 and 5:
chkconfig <service_name> <on|off>

enable/disable a service for some runlevels (not valid for services managed by xinetd):
chkconfig <service_name> <on|off> --levels <runlevels, for example: 35 for runlevels 3 and 5>

show the status of all the services:
service --status-all

start/stop/restart/status for a service:
service <service_name> <start|stop|restart|status>