service rsync
{
disable = yes
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
instances = 4 : Limit 4 concurrent instances of myserver
cps = 10 30 : (Prevent DOS Attacks) Limit 10 connections per second or sleep for 30 seconds.
max_load = 3.0 : Reject new requests if the one minute load system avg exceeds 3.0.
access_times = 8:00-16:00 : Restrict service Usage by time
only_from += 192.162.2.0 : (only accept traffic from)
no_access = badguy.evil.org : (explicitly block a server (everyone except))
}
{
...
server=/usr/sbin/ssh
redirect=192.168.1.26 22
}
(from xinet config file)
{
...
flags = ...NAMEINARGS This directive tells xinetd to look in the server_args line.
server=/usr/sbin/tcpd Calls tcpd to intercept telnet traffic, and to fire up telnetd daemon
server_args = /usr/sbin/in.telnetd
}
service ftpd
{
...
user = root
server = /usr/sbin/chroot Invokes a chroot jail as the service
server_args = /var/cage /usr/sbin/myservice -a -b /var/cage is the root directory for this service. Just be sure to include all relevant libraries and files in the new "/".
...
}
Creating a CSR request jake@somewhere ssl]# openssl req -new -key domainname.key -out domainname.csr umask 77 ; \ /usr/bin/openssl genrsa -des3 1024 > tux.key Generating RSA private key, 1024 bit long modulus ....................++++++ ...++++++ e is 65537 (0x10001) Enter pass phrase: Verifying - Enter pass phrase: umask 77 ; \ /usr/bin/openssl req -new -key tux.key -out tux.csr Enter pass phrase for tux.key: You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [GB]:US State or Province Name (full name) [Berkshire]:New York Locality Name (eg, city) [Newbury]:New York Organization Name (eg, company) [My Company Ltd]:Tux Limited Organizational Unit Name (eg, section) []:Enterprise Technology Common Name (eg, your name or your server's hostname) []:tux Email Address []:john@somewhere.com Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:abc321 An optional company name []: Decrypting a private key [jake@somewhere ssl]# openssl rsa -in tux.key Enter pass phrase for tux.key: writing RSA key -----BEGIN RSA PRIVATE KEY----- MIICXgIBAAKBgQC1ocwAeS7fJdCAWIB/kdkkxN/PBApf5p4smbzx9t2mKDanA04S JHaLyPbs/3ZWs1U5HL0w7GXbNL5XncFcPvhd5IniagdkDOwwiu9NK+lQ/qjV4ntI k3/iPNOjlWayjdVgb4z/P8SRAz9fg+RnulmaNTGPr6twGQ40y7rYcorbZQIDAQAB AoGBALWReod2nP6BpL7IuhvMxs9U547gsSZROgnH3fPcHpL9XDT0vtSwErmGOiGM 9tWRDD69lfsUNnY9cZHQp/z5DfnOOrNeEFp4cy7dXZNlRBCWtHpLIAedRRtRXM+H gQxBh/mhHPFEHaaURdQsRxErVxfu1kfIxmc6Gs1eDSW8EtL5AkEA5+nLJ8IwtS55 Xtu6unTkwk5WwesjLICdoIimYCxpnoDZUexuKczFjKwySesq56dn+S4B/pPcifSm StoBT9t4DwJBAMh/GtPP/Lw+svEqEZ2KwEzO2CCb06qsXOXpL+lFLhxyLIDAg3O8 77XEMv5c3/BOemRIzQV6pBICxxLi34YvYUsCQQDfJPrgF56sRrprxnrmO+F9AMnD rw9aG6sPs0x7D2DVLV9tz1O0jp6qm2mL7GaNHWwSu+0ZWoaCi0+SiC9o+mCLAkBD EyrBc9KEk6E/xygvgWzGBWkOt7L/ZTyK+hE6RBeiEpxK0pznimzTbXj12dJdTZPq muRkEdxz3hQFgHrxJEazAkEAxQ6dCMI6J/Yr0+Ly+IB4M86PLkxLHCH0jjzK8lLd gUAUqRm6jzFhfwHkdZJinT7vuNrbGTIgFJJ02z/H0gvfzw== -----END RSA PRIVATE KEY-----
Saving the key failed: /hello/.ssh/. [root@localhost hello]# ssh-keygen -t dsa [root@localhost hello]# ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/root/.ssh/id_dsa): /hello/id_dsa Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /hello/id_dsa. Your public key has been saved in /hello/id_dsa.pub. The key fingerprint is: ca:21:90:3f:25:5d:51:60:49:96:83:ba:9f:8d:e9:6a root@localhost.localdomain [root@localhost hello]# cd /hello/id_dsa
~ssh/authorized_keys: command="/usr/local/bin/apachectl restart" ssh-dss AAABBGHQsrrf(rest of key
HostbasedAuthentication yes IgnoreUserKnownHosts no
Host remoteserver
HostName remoteserver
HostbasedAuthentication yes
/root/.gnupg [root@localhost .gnupg]# ls -la total 20 drwx------ 2 root root 4096 Jan 26 14:30 . drwxr-x--- 22 root root 4096 Jan 26 14:28 .. -rw------- 1 root root 7695 Jan 26 14:28 gpg.conf -rw------- 1 root root 0 Jan 26 14:30 pubring.gpg (public key) -rw------- 1 root root 600 Jan 26 14:29 random_seed -rw------- 1 root root 0 Jan 26 14:30 secring.gpg (secret key)
1. The merchant generates a private/public key pair.
2. The merchant must then prove their identity to a CA and provide their public key to the CA.
3. The CA then creates a one-way hash of the following information:
* The CA's identity.
* The merchant's identity.
* The merchant's public key.
* Period of validity.
4. The one-way has is then encrypted with the CA's private key creating a detached digital signature.
5. The digital certificate is made up of the combined information above and the detached digital signature.
6. The CA then issues this to the merchant.