How to verify matching private key with a certificate
The private key contains a series of numbers. Two of those numbers form the “public key”, the others are part of your “private key”. The “public key” bits are also embedded in your Certificate (we get them from your CSR). To check that the public key in your cert matches the public portion of your private key, you need to view the cert and the key and compare the numbers. To view the Certificate and the key run the commands: […]
Read MoreService/Daemon Management
restarting/stopping/starting a service On any init.d based linux distro you can restart a service with the following… /etc/init.d/serviceName restart You may replace ‘restart’ with ’stop’ or ’start’ (and in some cases ’status’). Forcefully stopping a service killall processName Killing on instance of a service kill pid The pid can be gathered by either top or ps Disabling/adding/listing services chkconfig –list displays all the services and if they are set to run in different runlevels use the –del daemonName to remove […]
Read MoreUser Management
useradd useradd userName then run “passwd userName” to set the new users pw passwd passwd username will ask for the new pw twice
Read MoreFile Permissions
Listing Permissions ls -al will display all files in a list with their owners and permissions -rw-r–r– 1 irq13 irq13 1006 Jan 24 10:16 .bashrc Now to break down the above example… -rw-r–r– is the permissions area. The first – would be d if the item is directory, otherwise it will be -. The second 3 dashes indicate read/write/execute for the owner, the second is r/w/x for the group and third is r/w/x for everyone else. The next number is […]
Read MoreAdditional command operators
ps | grep ssh — only display lines that contain ssh ; used to “stack commands” or issue multiple commands on 1 line. cd ..; ls & puts a command in the background. Will let you know when the command is finished > write what is displayed on the screen from a given command to a text file ls -alh /root > /root/myRoot.txt >> appends screen output to an existing file
Read MoreBasic commands
* whoami : displays current user * top : displays the top cpu/memory eaters and system load.. like task manager on windows * ps : displays all processes running.. ps aux is the most useful way to run it * wall “some text” : sends a broadcast message to all logged on users * man program : displays the ‘man page’ or manual for a given program. Use space bar to page down and q to exit * program -h […]
Read MoreFile System
/ : root of the file system contains all devices and directory’s /root : the root users home directory /home : all other users home dirs reside in here /boot : All the kernels and boot specific info /tmp : temporary files are stored here, is commonly world writable so keep an eye on it /dev : on linux even hardware devices are part of the file system, they are stored here. /bin : executables that should be safe for […]
Read MoreHow To Find What Version of PEAR Is Installed in your Linux Apache Server
if you want to know what version of PEAR you have, or simply just want to know if you have PEAR installed, simply run the following command in your linux box shell prompt: pear list Once you execute the command above, you should see something like this: Installed packages =================== Package Version State Archive_Tar 1.1 stable Console_Getopt 1.2 stable DB 1.7.6 stable HTML_Template_IT 1.1 stable HTTP 1.3.6 stable Mail 1.1.8 stable Net_SMTP 1.2.7 stable Net_Socket 1.0.6 stable Net_UserAgent_Detect 2.0.1 stable […]
Read MoreHow to track which site is using the apache processes.
For apache 1.3, edit your /etc/httpd/conf/httpd.conf and add ExtendedStatus On <Location /httpd-status> SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 </Location> just after the code that says “ServerSignature On”. Save, exit, then restart apache. You can access the stats page by going to http://1.2.3.4/httpd-status where 1.2.3.4 is your server’s IP. If you’re running apache 2.x , then it’s already in the file: /etc/httpd/conf/extra/httpd.conf Change the “Allow from” lines to include your IP. Under cPanel servers […]
Read More