<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>All Amazing Articles &#187; Networks</title>
	<atom:link href="http://www.allticles.com/category/computers/networks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.allticles.com</link>
	<description>Allticles.com. An ever growing website consists of top quality article colections such as Computer, Technology, Science, Finance, Entertainments, etc.</description>
	<lastBuildDate>Sun, 25 Oct 2009 00:09:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Common SSH Commands &#8211; Linux Shell Commands</title>
		<link>http://www.allticles.com/common-ssh-commands-linux-shell-commands/</link>
		<comments>http://www.allticles.com/common-ssh-commands-linux-shell-commands/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 06:17:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[SSH Commands]]></category>

		<guid isPermaLink="false">http://www.allticles.com/?p=2772</guid>
		<description><![CDATA[We&#8217;ve put together some of the more frequently used SSH commands or linux shell commands, and organized them by name so you can easily find a command, their description and how to use it. This guide will continue to be updated and should not be considered a complete list of SSH commands or linux shell [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">We&#8217;ve put together some of the more frequently used SSH commands or linux shell commands, and organized them by name so you can easily find a command, their description and how to use it. This guide will continue to be updated and should not be considered a complete list of SSH commands or linux shell commands, but commands, we found, often used. If you would like to add to this guide, please email us and let us know.</p>
<p style="text-align: justify;"><strong>Common SSH Commands or Linux Shell Commands,</strong><br />
<strong>ls </strong>: list files/directories in a directory, comparable to dir in windows/dos.<br />
<em>ls -al</em> : shows all files (including ones that start with a period), directories, and details attributes for each file.</p>
<p style="text-align: justify;"><span id="more-2772"></span></p>
<p style="text-align: justify;"><strong>cd </strong>: change directory · · cd /usr/local/apache : go to /usr/local/apache/ directory<br />
<em>cd ~ </em>: go to your home directory<br />
<em>cd -</em> : go to the last directory you were in<br />
<em>cd .. </em>: go up a directory cat : print file contents to the screen</p>
<p style="text-align: justify;"><em>cat filename.txt </em>: cat the contents of filename.txt to your screen</p>
<p style="text-align: justify;"><strong>chmod:</strong> changes file access permissions<br />
The set of 3 go in this order from left to right:<br />
USER &#8211; GROUP &#8211; EVERONE</p>
<p style="text-align: justify;"><!-- COPYRIGHT MIDDLE ART --></p>
<div class="whitetext" style="text-align: justify;">Article provided by WebHostGear.com</div>
<p style="text-align: justify;"><!-- END COPYRIGHT MIDDLE ART --><script src="http://a.wavepointmedia.net/adx.js" type="text/javascript"></script> <script type="text/javascript"><!--
&lt;!
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);</p>
<p>   document.write ("&lt;" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("http://a.wavepointmedia.net/adjs.php?n=" + phpAds_random);
   document.write ("&amp;amp;what=zone:14&amp;amp;target=_blank");
   document.write ("&amp;amp;exclude=" + document.phpAds_used);
   if (document.referrer)
      document.write ("&amp;amp;referer=" + escape(document.referrer));
   document.write ("'&gt;&lt;" + "/script&gt;");
// &gt;
// --></script><script src="http://a.wavepointmedia.net/adjs.php?n=711337200&amp;what=zone:14&amp;target=_blank&amp;exclude=," type="text/javascript"></script></p>
<p style="text-align: justify;"><noscript>&amp;amp;amp;amp;lt;a href=&#8217;http://a.wavepointmedia.net/adclick.php?n=a263378f&#8217; target=&#8217;_blank&#8217;&amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;img src=&#8217;http://a.wavepointmedia.net/adview.php?what=zone:14&amp;amp;amp;amp;amp;amp;n=a263378f&#8217; border=&#8217;0&#8242; alt=&#8221;&amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt;</noscript>0 = &#8212;  No permission<br />
1 = &#8211;X  Execute only<br />
2 = -W-  Write only<br />
3 = -WX  Write and execute<br />
4 = R&#8211;  Read only<br />
5 = R-X  Read and execute<br />
6 = RW-  Read and write<br />
7 = RWX  Read, write and execute</p>
<p style="text-align: justify;">Usage:<br />
chmod numberpermissions filename</p>
<p style="text-align: justify;"><span class="green">chmod 000</span> : No one can access<br />
<span class="green">chmod 644</span>: Usually for HTML pages<br />
<span class="green">chmod 755</span>: Usually for CGI scripts</p>
<p style="text-align: justify;"><strong>chown</strong>: changes file ownership permissions<br />
The set of 2 go in this order from left to right:<br />
USER &#8211; GROUP</p>
<p style="text-align: justify;"><span class="green">chown root myfile.txt</span> : Changes the owner of the file to root<br />
<span class="green">chown root.root myfile.txt</span> : Changes the owner and group of the file to root</p>
<p style="text-align: justify;"><strong>tail</strong> : like cat, but only reads the end of the file<br />
<em>tail /var/log/messages </em>: see the last 20 (by default) lines of /var/log/messages<br />
<em>tail -f /var/log/messages </em>: watch the file continuously, while it&#8217;s being updated<br />
<em>tail -200 /var/log/messages </em>: print the last 200 lines of the file to the screen</p>
<p style="text-align: justify;"><strong>more</strong><em> </em>: like cat, but opens the file one screen at a time rather than all at once<br />
<em>more /etc/userdomains </em>: browse through the userdomains file. hit <em>Space</em>to go to the next page, <em>q</em> to quit</p>
<p style="text-align: justify;"><strong>pico</strong> : friendly, easy to use file editor<br />
<em>pico /home/burst/public_html/index.html </em>: edit the index page for the user&#8217;s website.</p>
<p style="text-align: justify;"><strong>File Editing with VI ssh commands</strong><br />
<strong>vi</strong> : another editor, tons of features, harder to use at first than pico<br />
<em>vi /home/burst/public_html/index.html </em>: edit the index page for the user&#8217;s website.<br />
Whie in the vi program you can use the following useful commands, you will need to hit SHIFT + : to go into command mode</p>
<p style="text-align: justify;"><span class="green">:q! </span>: This force quits the file without saving and exits vi<br />
<span class="green">:w</span> : This writes the file to disk, saves it<br />
<span class="green">:wq</span> : This saves the file to disk and exists vi<br />
<span class="green">:LINENUMBER</span> : EG :25 : Takes you to line 25 within the file<br />
<span class="green">:$ </span>: Takes you to the last line of the file<br />
<span class="green">:0</span> : Takes you to the first line of the file</p>
<p style="text-align: justify;"><strong>grep</strong> : looks for patterns in files<br />
<em>grep root /etc/passwd </em>: shows all matches of root in /etc/passwd<br />
<em>grep -v root /etc/passwd </em>: shows all lines that do not match root</p>
<p style="text-align: justify;"><strong>ln</strong> : create&#8217;s &#8220;links&#8221; between files and directories<br />
<em>ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf </em>: Now you can edit /etc/httpd.conf rather than the original. changes will affect the orginal, however you can delete the link and it will not delete the original.</p>
<p style="text-align: justify;"><strong>last</strong> : shows who logged in and when<br />
<em>last -20 </em>: shows only the last 20 logins<br />
<em>last -20 -a </em>: shows last 20 logins, with the hostname in the last field</p>
<p style="text-align: justify;"><strong>w</strong> : shows who is currently logged in and where they are logged in from.<br />
<span class="green">who</span> : This also shows who is on the server in an shell.</p>
<p style="text-align: justify;"><strong>netstat</strong> : shows all current network connections.<br />
<em>netstat -an </em>: shows all connections to the server, the source and destination ips and ports.<br />
<em>netstat -rn </em>: shows routing table for all ips bound to the server.</p>
<p style="text-align: justify;"><strong>top</strong> : shows live system processes in a nice table, memory information, uptime and other useful info. This is excellent for managing your system processes, resources and ensure everything is working fine and your server isn&#8217;t bogged down.<br />
<em>top</em> then type <em>Shift + M</em> to sort by memory usage or <em>Shift + P </em>to sort by CPU usage</p>
<p style="text-align: justify;"><strong>ps: </strong>ps is short for process status, which is similar to the <em>top</em> command. It&#8217;s used to show currently running processes and their PID.<br />
A process ID is a unique number that identifies a process, with that you can kill or terminate a running program on your server (see kill command).<br />
<em>ps U username</em> <em>:</em> shows processes for a certain user<br />
<em>ps aux</em> : shows all system processes<br />
<em>ps aux &#8211;forest</em> : shows all system processes like the above but organizes in a hierarchy that&#8217;s very useful!</p>
<p style="text-align: justify;"><strong>touch</strong> : create an empty file<br />
<em>touch /home/burst/public_html/404.html </em>: create an empty file called 404.html in the directory /home/burst/public_html/</p>
<p style="text-align: justify;"><strong>file </strong>: attempts to guess what type of file a file is by looking at it&#8217;s content.<br />
<em>file * </em>: prints out a list of all files/directories in a directory</p>
<p style="text-align: justify;"><strong>du </strong>: shows disk usage.<br />
<em>du -sh </em>: shows a summary, in human-readble form, of total disk space used in the current directory, including subdirectories.<br />
<em>du -sh * </em>: same thing, but for each file and directory. helpful when finding large files taking up space.</p>
<p style="text-align: justify;"><strong>wc : </strong>word count<br />
<em>wc -l filename.txt </em>: tells how many lines are in filename.txt</p>
<p style="text-align: justify;"><strong>cp </strong>: copy a file<br />
<em>cp filename filename.backup </em>: copies filename to filename.backup<br />
<em>cp -a /home/burst/new_design/* /home/burst/public_html/ </em>: copies all files, retaining permissions form one directory to another.<br />
<span class="green">cp -av * ../newdir</span> : Copies all files and directories recurrsively in the current directory INTO newdir</p>
<p style="text-align: justify;"><strong>mv</strong> : Move a file command<br />
<span class="green">mv oldfilename newfilename </span>: Move a file or directory from oldfilename to newfilename</p>
<p style="text-align: justify;"><strong>rm </strong>: delete a file<br />
<em>rm filename.txt </em>: deletes filename.txt, will more than likely ask if you really want to delete it<br />
<em>rm -f filename.txt </em>: deletes filename.txt, will not ask for confirmation before deleting.<br />
<em>rm -rf tmp/</em> : recursively deletes the directory tmp, and all files in it, including subdirectories. BE VERY CAREFULL WITH THIS COMMAND!!!<br />
<strong><br />
TAR</strong>: Creating and Extracting .tar.gz and .tar files<br />
<span class="green">tar -zxvf file.tar.gz</span> : Extracts the file<br />
<span class="green">tar -xvf file.tar</span> : Extracts the file<br />
<span class="green">tar -cf archive.tar contents/</span> : Takes everything from contents/ and puts it into archive.tar<br />
<span class="green">gzip -d filename.gz</span> : Decompress the file, extract it</p>
<p style="text-align: justify;"><strong>ZIP Files</strong>:  Extracting .zip files shell command<br />
<span class="green">unzip file.zip</span></p>
<p style="text-align: justify;"><strong>Firewall - iptables commands<br />
</strong><span class="green">iptables -I INPUT -s IPADDRESSHERE -j DROP</span> : This command stops any connections from the IP address<br />
<span class="green">iptables -L </span>: List all rules in iptables<br />
<span class="green">iptables -F</span> : Flushes all iptables rules (clears the firewall)<br />
<span class="green">iptables &#8211;save</span> : Saves the currenty ruleset in memory to disk<br />
<span class="green">service iptables restart</span> : Restarts iptables</p>
<p style="text-align: justify;"><strong>Apache Shell Commands</strong><br />
<span class="green">httpd -v</span> : Outputs the build date and version of the Apache server.<br />
<span class="green">httpd -l</span> : Lists compiled in Apache modules<br />
<span class="green">httpd status</span> : Only works if mod_status is enabled and shows a page of active connections<br />
<span class="green">service httpd restart</span> : Restarted Apache web server</p>
<p style="text-align: justify;"><strong>MySQL Shell Commands</strong><br />
<span class="green">mysqladmin processlist</span> : Shows active mysql connections and queries<br />
<span class="green">mysqladmin drop databasenamehere</span> : Drops/deletes the selected database<br />
<span class="green">mysqladmin create databasenamehere</span> : Creates a mysql database</p>
<p style="text-align: justify;">Restore MySQL Database Shell Command<br />
<span class="green">mysql -u username -p password databasename &lt; databasefile.sql</span> : Restores a MySQL database from databasefile.sql</p>
<p style="text-align: justify;">Backup MySQL Database Shell Command<br />
<span class="green">mysqldump -u username -p password databasename &gt; databasefile.sql </span>: Backup MySQL database to databasefile.sql</p>
<p style="text-align: justify;"><strong>kill: </strong>terminate a system process<br />
<em>kill -9 PID</em> EG: <em>kill -9 431<br />
kill PID </em>EG: <em>kill 10550</em><br />
Use <em>top</em> or <em>ps ux </em>to get system PIDs (Process IDs)</p>
<p style="text-align: justify;">EG:</p>
<table style="text-align: justify;" border="0">
<tbody>
<tr>
<td>PID</td>
<td>TTY</td>
<td>TIME</td>
<td>COMMAND</td>
</tr>
<tr>
<td>10550</td>
<td>pts/3</td>
<td>0:01</td>
<td>/bin/csh</td>
</tr>
<tr>
<td>10574</td>
<td>pts/4</td>
<td>0:02</td>
<td>/bin/csh</td>
</tr>
<tr>
<td>10590</td>
<td>pts/4</td>
<td>0:09</td>
<td>APP</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">Each line represents one process, with a process being loosely defined as a running instance of a program. The column headed PID (process ID) shows the assigned process numbers of the processes. The heading COMMAND shows the location of the executed process.</p>
<p style="text-align: justify;"><strong>Putting commands together</strong><br />
Often you will find you need to use different commands on the same line. Here are some examples. Note that the | character is called a pipe, it takes date from one program and pipes it to another.<br />
<em>&gt;</em> means create a new file, overwriting any content already there.<br />
<em>&gt;&gt;</em> means tp append data to a file, creating a newone if it doesn not already exist.<br />
<em>&lt;</em> send input from a file back into a command.</p>
<p style="text-align: justify;"><em>grep User /usr/local/apache/conf/httpd.conf |more<br />
</em>This will dump all lines that match User from the httpd.conf, then print the results to your screen one page at a time.</p>
<p style="text-align: justify;"><em>last -a &gt; /root/lastlogins.tmp</em><br />
This will print all the current login history to a file called lastlogins.tmp in /root/</p>
<p style="text-align: justify;"><em>tail -10000 /var/log/exim_mainlog |grep domain.com |more<br />
</em>This will grab the last 10,000 lines from /var/log/exim_mainlog, find all occurances of domain.com (the period represents &#8216;anything&#8217;,<br />
&#8211; comment it out with a so it will be interpretted literally), then send it to your screen page by page.</p>
<p style="text-align: justify;"><em>netstat -an |grep :80 |wc -l<br />
</em>Show how many active connections there are to apache (httpd runs on port 80)</p>
<p style="text-align: justify;"><em>mysqladmin processlist |wc -l<br />
</em>Show how many current open connections there are to mysql</p>
<p><em>Source: http://www.webhostgear.com/</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.allticles.com/common-ssh-commands-linux-shell-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Commands ( Part II )</title>
		<link>http://www.allticles.com/ssh-commands-part-ii/</link>
		<comments>http://www.allticles.com/ssh-commands-part-ii/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 06:14:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[SSH Commands]]></category>

		<guid isPermaLink="false">http://www.allticles.com/?p=2770</guid>
		<description><![CDATA[Red IP Addresses/Sites Do Not Work Off Primary Shared IP (cPanel/WHM)
If you go to &#8220;Show or Delete Current IP Addresses&#8221; in WHM and you see red IP addresses, the ipaliases service has failed or been forced to stop. This happens sometimes and their isn&#8217;t a feature in WHM to restart it. You need to restart [...]]]></description>
			<content:encoded><![CDATA[<h2>Red IP Addresses/Sites Do Not Work Off Primary Shared IP (cPanel/WHM)</h2>
<p>If you go to &#8220;Show or Delete Current IP Addresses&#8221; in WHM and you see red IP addresses, the ipaliases service has failed or been forced to stop. This happens sometimes and their isn&#8217;t a feature in WHM to restart it. You need to restart it via SSH:</p>
<p class="style1">service  ipaliases restart</p>
<p>OR</p>
<p class="style1">/etc/init.d/ipaliases restart</p>
<h2>Easy way to find php.ini path</h2>
<p>The easiest way to find the php.ini file (the file where all the general php settings are stored), short of not knowing it off the top of your head; you can use a combination of commands.</p>
<p>Do note execute these commands yet! You can use the command:</p>
<p class="style1">php -i</p>
<p>This prints out all the php information as seen via a web browser when the phpinfo(); command is used. Within all this information is the path to the php.ini file. So we&#8217;re simply going to grep the information. You can use this command to find the path to the php.ini file:</p>
<p><span id="more-2770"></span></p>
<p class="style1">php -i | grep php.ini</p>
<p>It will return something like this:</p>
<p class="style1">Configuration File (php.ini) Path =&gt; /usr/local/lib/php.ini</p>
<p>That&#8217;s your file!</p>
<h2>Ping</h2>
<p>The popular ping command is used to check if a connection can be established with a server. It also measures the response times amongst a few other details. To run a ping use:</p>
<p class="style1">ping &lt;ipaddress or domain&gt;</p>
<h2>Tracing</h2>
<p>You can run a trace on any host providing you can connect to it. A trace, pings each hop of the connection and displays the information until it reaches the last node in the connection, generally your server. Traces are generally used to test for network issues.</p>
<p class="style1">traceroute &lt;ipaddress or domain&gt;</p>
<h2>WHOIS</h2>
<p>The internet is built on IP addresses. However to make it easier to access a server, the domain name implemented. To record who owns what domain name all information is stored in a large database generally referred to as the WHOIS database. You can run your own search by typing whois.</p>
<p class="style1">whois google.com</p>
<p>WHOIS look ups can also be done on IP addresses to see who they are registered to for things like reporting spam or abuse. Simply use the same command but replace it with the IP address to query instead.</p>
<p>Some providers offer are more refined database of their own that they store customer information in. For example:</p>
<p>rwhois://rwhois.layeredtech.com:4321</p>
<p>This is one example of a referral server and you can query it and find our more information generally even reseller names and details.</p>
<p class="style1">eg. whois -h rwhois.layeredtech.com -p 4321 &lt;ipaddress&gt;</p>
<h2>RDNS lookup (host)</h2>
<p>To check what an IP resolves to (reverse DNS entry) use the host command.</p>
<p class="style1">host 72.14.207.99</p>
<h2>Send Message In SSH</h2>
<p>You can send messages or broadcast notices to other SSH users  by using the wall command.</p>
<p class="style1">eg. wall &lt;message here&gt;</p>
<p class="style1">
<h2>Find Service</h2>
<p>You can you the where is command if you are unsure of paths:</p>
<p>eh. <span class="style1">whereis mysql</span></p>
<h2>Create FTP Account For New Location</h2>
<p><span class="style1">adduser &lt;username&gt;<br />
passwd &lt;username&gt;</span></p>
<p>On request enter the password and re-enter the password on request.</p>
<p class="style1">chmod -R 755 /home/&lt;username&gt;</p>
<p>As required, change ownership to:</p>
<p class="style1">chown -R   &lt;username&gt;.&lt;username&gt; /home/&lt;username&gt;</p>
<h2>Create FTP Account For Duplicate Location (eg. second user same path)</h2>
<p>Scenario: site1 already exists and user33 needs  access to site1 files.</p>
<p><span class="style1">adduser user33<br />
passwd user33 </span></p>
<p>On request enter the password and re-enter the password on request.</p>
<p class="style1">nano /etc/passwd</p>
<p>Change user33 path from /home/user33 to /home/site1</p>
<p class="style1">nano /etc/group</p>
<p>Change user33 to site1 group (eg. site1:x:501:user33)</p>
<h2>Delete Users</h2>
<p>One of these commands will delete a specified user:</p>
<p class="style1">userdel</p>
<p>OR</p>
<p class="style1">deluser</p>
<p>OR</p>
<p>rmuser</p>
<h2>Installing Nano (Text Editor) In SSH</h2>
<p class="style1">wget download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/Fedora/RPMS/compat-openldap-2.1.30-2.i386.rpm<br />
rpm &#8211;install compat-openldap-2.1.30-2.i386.rpm<br />
wget ftp://rpmfind.net/linux/redhat/9/en/os/i386/RedHat/RPMS/pine-4.44-18.i386.rpm<br />
rpm -Uhv ftp://mirror.switch.ch/mirror/scientificlinux/40rolling/i386/SL/RPMS/compat-libcom_err-1.0-5.i386.rpm<br />
rpm &#8211;install pine-4.44-18.i386.rpm</p>
<p>If you&#8217;re still use to using the pico command, you can add use the following to create a link. This means so when you type pico it will link to the new command nano without you noticing.</p>
<p>cd /usr/bin<br />
ln nano pico</p>
<h2>Find Current Browsing Path</h2>
<p>In SSH, its easy to find what path you are currently browsing. Some operating systems tell you in the prompt, for example:</p>
<p class="style1">root@server1 [/usr/local/apache/bin]# | cd /typing/command/</p>
<p>Others often don&#8217;t though. So if you&#8217;ve forgotten the path you&#8217;re browsing or you&#8217;d like to be able to copy and paste it, you can display it by typing:</p>
<p class="style1">pwd</p>
<p>The path should appear in a new line and go back to the prompt.</p>
<h2>Backing up Database (Incomplete)</h2>
<p>There are two easy ways:</p>
<ul>
<li>use mysqldump</li>
<li>copy the data files from the mysql data directory</li>
</ul>
<p>Mysqldump:</p>
<p>Using similar parameters for repairing a database:</p>
<p class="style1">mysqldump</p>
<p>Add <span class="style1">-B </span> for the database<br />
Add <span class="style1">-u </span> to login as a user and <span class="style1">-p</span> if a password is required<br />
If you want to backup all databases, use <span class="style1">-A</span> instead of <span class="style1">-B</span> (A meaning all).</p>
<p>Running this command will &#8220;dump&#8221; the SQL from the database. We want to harvest this and put it in a file. As described earlier in symbols we can use the <span class="style1">&gt;</span> symbol to store it in a file:</p>
<p class="style1">/pathtomysql/bin/mysqldump -B mytestdatabase -u myusernamehere -p &gt;  mytestdatabase_backup.sql</p>
<p>After running that it will ask for the password, when correct it will back up everything into the sql file. The <span class="style2">sql file will stored at whatever the </span></p>
<p><span class="style2">MYSQL data files:</span></p>
<p class="style2">xx</p>
<h2>Restoring a Database (Incomplete)</h2>
<p>There are three easy ways:</p>
<ul>
<li>use a reverse of mysqldump</li>
<li>use source in mysql</li>
<li>copy the data files from the mysql data directory</li>
</ul>
<p>Mysqldump:</p>
<p>a) <span class="style1">cd  pathtomysql/bin/<br />
./mysqldump -B mytestdatabase -u myusernamehere -p &lt;  mytestdatabase_backup.sql</span></p>
<p>b) <span class="style1">/pathtomysql/bin/mysqldump -B mytestdatabase -u myusernamehere -p &lt;  mytestdatabase_backup.sql</span></p>
<p>c) <span class="style1">mysqldump -B mytestdatabase -u myusernamehere -p &lt;  mytestdatabase_backup.sql</span></p>
<p>* Note the inverted symbol from <span class="style1">&gt;</span> to <span class="style1">&lt;</span></p>
<p>Via mysql:</p>
<p>Change directory to the path to where the sql file is stored. (eg. mytestdatabase_backup.sql)</p>
<p>Eg. <span class="style1">cd /home/user4/backups </span></p>
<p>Type:</p>
<p>a) <span class="style1">cd  pathtomysql/bin/<br />
./mysql</span></p>
<p>b) <span class="style1">/pathtomysql/bin/mysql</span></p>
<p>c) <span class="style1">mysql</span></p>
<p>It will load up the mysql prompt. If its protected by a password, use <span class="style1">-u </span> and <span class="style1">-p</span> as required.</p>
<p>eg.   <span class="style1">mysql -u  and -p</span></p>
<p>After you load up mys<span class="style2">ql you ca </span></p>
<h2>Check ports for processes</h2>
<p>If you want to check what process is running on the server on a certain port you can use the lsof command. You can check everything by typing:</p>
<p class="style1">lsof</p>
<p>You can also check just a single port and protocol, using port 80 as an example:</p>
<p class="style1">lsof -i tcp:80</p>
<p>This will check port 80 on TCP protocol. Here&#8217;s an example output:</p>
<p class="style1">root@server [/]# lsof -i tcp:80<br />
COMMAND   PID   USER   FD   TYPE DEVICE SIZE NODE NAME<br />
httpd    3313   root   19u  IPv4   8033       TCP *:http (LISTEN)<br />
httpd   25553 nobody   19u  IPv4   8033       TCP *:http (LISTEN)<br />
httpd   25554 nobody   19u  IPv4   8033       TCP *:http (LISTEN)<br />
httpd   25555 nobody   19u  IPv4   8033       TCP *:http (LISTEN)<br />
httpd   25556 nobody   19u  IPv4   8033       TCP *:http (LISTEN)<br />
httpd   25557 nobody   19u  IPv4   8033       TCP *:http (LISTEN)<br />
httpd   25789 nobody   19u  IPv4   8033       TCP *:http (LISTEN)<br />
httpd   26410 nobody   19u  IPv4   8033       TCP *:http (LISTEN)<br />
httpd   27622 nobody   19u  IPv4   8033       TCP *:http (LISTEN)<br />
httpd   27625 nobody   19u  IPv4   8033       TCP *:http (LISTEN)<br />
httpd   28113 nobody   19u  IPv4   8033       TCP *:http (LISTEN)</p>
<h2>Check Kernel Version</h2>
<p>The Kernel is the core of the operating system and for security needs to kept updated. You can check what version is installed on your server with the following command:</p>
<p class="style1">uname -r</p>
<p>Just note however that the vendor doesn&#8217;t release the most up to date version of the Kernel and runs a bit behind. But in general you can check Kernel information at <a href="http://www.kernel.org/" target="_blank">www.kernel.org</a>.</p>
<h2>Check for vulnerable / exploitable / hackable  phpBB forums</h2>
<p>A while back someone found an exploit in a phpBB forum in the bbcode.php file that allowed hackers full access to the server. Popular control panels such as cPanel use to come with phpBB build in and unless server administrators manually updated the scripts by running a forced cPanel update then the latest version of phpBB wasn&#8217;t updated.</p>
<p>Even then, server administrators need to make sure that the dangerous exploit is remove completely on their server and that customers keep their forums up to date. But how do you do that?</p>
<p>There is a very simple way:</p>
<p class="style1">find /home/ -name &#8220;bbcode.php&#8221; -exec grep &#8216;t&lt;]\*)#is&#8217; {} \; -print</p>
<p>This command is compliance of <a href="http://www.hostgeekz.com/" target="_blank">hostgeekz.com</a>. This will display an output showing the code and under that the path. I would suggest you disable the forums and force them to update it on their own.</p>
<p><strong>How to disable the phpBB forum?</strong></p>
<p>After running the above command, here is a sample of some output:</p>
<p class="style1">$ret = preg_replace(&#8221;#(^|[\n ])([\w]+?://[^ \"\n\r\t&lt;]*)#is&#8221;, &#8220;\\1&lt;a href=\&#8221;\\2\&#8221; target=\&#8221;_blank\&#8221;&gt;\\2&lt;/a&gt;&#8221;, $ret);<br />
/home/zxy/public_html/nets/pnuke/includes/bbcode.php<br />
$ret = preg_replace(&#8221;#(^|[\n ])([\w]+?://[^ \"\n\r\t&lt;]*)#is&#8221;, &#8220;\\1&lt;a href=\&#8221;\\2\&#8221; target=\&#8221;_blank\&#8221;&gt;\\2&lt;/a&gt;&#8221;, $ret);<br />
/home/zxy/public_html/forum/includes/bbcode.php<br />
$ret = preg_replace(&#8221;#(^|[\n ])([\w]+?://[^ \"\n\r\t&lt;]*)#is&#8221;, &#8220;\\1&lt;a href=\&#8221;\\2\&#8221; target=\&#8221;_blank\&#8221;&gt;\\2&lt;/a&gt;&#8221;, $ret);<br />
/home/zxy/public_html/phatbeatboxer/forum/includes/bbcode.php<br />
$ret = preg_replace(&#8221;#(^|[\n ])([\w]+?://[^ \"\n\r\t&lt;]*)#is&#8221;, &#8220;\\1&lt;a href=\&#8221;\\2\&#8221; target=\&#8221;_blank\&#8221;&gt;\\2&lt;/a&gt;&#8221;, $ret);<br />
/home/zxy/public_html/trk/nuke/includes/bbcode.php<br />
$ret = preg_replace(&#8221;#(^|[\n ])([\w]+?://[^ \"\n\r\t&lt;]*)#is&#8221;, &#8220;\\1&lt;a href=\&#8221;\\2\&#8221; target=\&#8221;_blank\&#8221;&gt;\\2&lt;/a&gt;&#8221;, $ret);<br />
/home/zxy/public_html/nyc/phpbb2/includes/bbcode.php<br />
$ret = preg_replace(&#8221;#(^|[\n ])([\w]+?://[^ \"\n\r\t&lt;]*)#is&#8221;, &#8220;\\1&lt;a href=\&#8221;\\2\&#8221; target=\&#8221;_blank\&#8221;&gt;\\2&lt;/a&gt;&#8221;, $ret);<br />
/home/zxy/public_html/teamfuelinjected/forum/includes/bbcode.php<br />
$ret = preg_replace(&#8221;#(^|[\n ])([\w]+?://[^ \"\n\r\t&lt;]*)#is&#8221;, &#8220;\\1&lt;a href=\&#8221;\\2\&#8221; target=\&#8221;_blank\&#8221;&gt;\\2&lt;/a&gt;&#8221;, $ret);<br />
/home/zxy/public_html/navy/includes/bbcode.php<br />
$ret = preg_replace(&#8221;#(^|[\n ])([\w]+?://[^ \"\n\r\t&lt;]*)#is&#8221;, &#8220;\\1&lt;a href=\&#8221;\\2\&#8221; target=\&#8221;_blank\&#8221;&gt;\\2&lt;/a&gt;&#8221;, $ret);<br />
/home/zxy/public_html/phpnuke/includes/bbcode.php</p>
<p>So you can see the following file could be exploited:</p>
<p class="style1">/home/zxy/public_html/forum/includes/bbcode.php</p>
<p>We need to find the configuration file and add a line of code to that. The configuration is located in the root of the forum install, so for example the configuration file would be at www.zxy.com/forum/config.php &#8211; so we know our config.php path is /home/zxy/public_html/forum/includes/config.php</p>
<p>So simply type:</p>
<p class="style1">nano /home/zxy/public_html/forum/includes/config.php</p>
<p>OR</p>
<p class="style1">/home/zxy/public_html/forum/includes/conf*</p>
<p>Then add the following line under the <span class="style1">&lt;?PHP</span> tag:</p>
<p class="style1">die(&#8221;Forums Disabled &#8211; Contact Support Immediately!&#8221;);</p>
<p>Then save with Ctrl + O. Congratulation, the forum is disabled.</p>
<h2>Flush Exim Queue</h2>
<p>If you&#8217;ve got 2000 emails queued to be sent which you know are all spam, you can quickly clear the queue by typing:</p>
<p class="style1">exim -qff</p>
<p>You can also use it in debugging mode:</p>
<p class="style1">exim -qff -d9</p>
<h2>Access Denied Error from phpMyAdmin via WHM (cPanel)</h2>
<p>When you try and load phpMyAdmin from cPanel&#8217;s Web Host Manage (WHM) a message saying access denied appears. There is a very simple solution to this.</p>
<p>From web host manager, under SQL Services click MySQL Root Password. Enter in a password and save it.</p>
<p>Try loading up phpMyAdmin again from web host manager and it should be fine. No SSH commands, no configuration files &#8211; type and click.</p>
<h2>Locate files owned by nobody and delete</h2>
<p>This is extremely useful for locating files that have been uploaded using an exploit and are still owned by the nobody user. Note this isn&#8217;t the solution to cleaning up an exploit, just a tool to assist in the clean up.</p>
<p>The below command will search all user document root for files owned by nobody and display them on the screen. This is one of the most likely location of uploaded nobody files but its possible for files to be outside this directory. You&#8217;ll need to adjust the scope of the command where necessary.</p>
<p class="style1">find /home/*/public_html -user nobody -print</p>
<p>The below command will search and delete all files in the users document root that are owned by the nobody user. It&#8217;s recommended you just do a find first, then if it&#8217;s clear run the below command:</p>
<p class="style1">find /home/*/public_html -user nobody -print | xargs rm</p>
<p>To delete folders owned by nobody user too, use:</p>
<p class="style1">find /home/user/public_html -user nobody -print | xargs rm -Rf</p>
<h2>Update, Fix, Correct or Sync Server Time and Date</h2>
<p>Servers use NTP (Network Time Protocol) to sync their times. This process can be automated with NTPD. You can check the status with:</p>
<p class="style1">/usr/sbin/ntpd status</p>
<p>If it is stopped and you want to start it, check the configuration first at:</p>
<p class="style1">/etc/ntp.conf</p>
<p>You can edit this with:</p>
<p class="style1">nano /etc/ntp.conf</p>
<p>Afterwards you can start it with:</p>
<p class="style1">/usr/sbin/ntpd start</p>
<p>Stop with:</p>
<p class="style1">/usr/sbin/ntpd stop</p>
<p>You can update your time immediately with:</p>
<p class="style1">ntpdate &lt;server_here&gt;</p>
<p>The below command and server will work fine:</p>
<p class="style1">ntpdate pool.ntp.org</p>
<p><em>Source: http://www.sshcmds.com/</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.allticles.com/ssh-commands-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Commands ( Part I )</title>
		<link>http://www.allticles.com/ssh-commands-part-i/</link>
		<comments>http://www.allticles.com/ssh-commands-part-i/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 06:07:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networks]]></category>

		<guid isPermaLink="false">http://www.allticles.com/?p=2768</guid>
		<description><![CDATA[What&#8217;s The Deal?
SSH Commands started off as a dump for linux commands by the author, having a bad memory and sometimes went through long periods of time without having to work in servers so the information was pushed out. The commands used in SSH normally don&#8217;t allow for much error so its good to have [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><strong>What&#8217;s The Deal?</strong></p>
<p style="text-align: justify;"><strong>SSH Commands</strong> started off as a dump for linux commands by the author, having a bad memory and sometimes went through long periods of time without having to work in servers so the information was pushed out. The commands used in <strong>SSH</strong> normally don&#8217;t allow for much error so its good to have them on reference some where. From there <strong>SSH Commands</strong> was born.</p>
<p style="text-align: justify;">Our aim now is to be a place beginners can turn to when they need help with basic <strong>SSH Commands</strong>, or that little reminder free of charge.</p>
<p style="text-align: justify;"><strong>What is SSH?</strong></p>
<p style="text-align: justify;"><strong>SSH is secure shell</strong>, a tool used to connect and talk to linux servers. These commands aren&#8217;t <strong>SSH commands</strong> as such, but more so commands that can be used in SSH whilst talking to the <strong>linux server</strong>.</p>
<p class="style4" style="text-align: justify;">Most of these commands presented are based around a Red Hat/CentOS operating systems. We don&#8217;t warrant the accuracy or compatibility of the information provided here, instead provide information as a possible channel for new users, resolution seekers and more research.</p>
<p class="style4" style="text-align: justify;"><span id="more-2768"></span></p>
<p style="text-align: justify;"><strong>Guides</strong></p>
<p style="text-align: justify;">Below are the SSH guides we have on site at the moment. If you have a suggestion please let us know and we&#8217;ll try and add it.</p>
<h2 style="text-align: justify;">SSH Client &#8211; Connecting to SSH</h2>
<p style="text-align: justify;">Like most connects, you need a client and a server. The server will be the SSH daemon on the server, already installed on most occasions. However for someone stepping into the task, they generally just need the SSH client.</p>
<p style="text-align: justify;">The most popular SSH client for connecting to a linux server is PuTTY. You can download this small, portable program for free at from <a href="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/download.html" target="_blank">http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html</a></p>
<h2 style="text-align: justify;">Getting General Command Help From Within SSH</h2>
<p style="text-align: justify;">With you are connected in with SSH, in most cases you can find help on a command by typing:</p>
<p class="style1" style="text-align: justify;">&lt;command&gt; &#8211;help</p>
<p style="text-align: justify;">eg. <span class="style1">cd &#8211;help</span></p>
<p style="text-align: justify;">If that doesn&#8217;t work, you can also try:</p>
<p class="style1" style="text-align: justify;">man &lt;command&gt;</p>
<p style="text-align: justify;">eg. <span class="style1">man iptables</span></p>
<p style="text-align: justify;">Man stands for manual, like a help manual.</p>
<h2 style="text-align: justify;">Shell Text Editor (nano)</h2>
<p style="text-align: justify;">The best Linux text editor for SSH is nano (also known as pico but was renamed). You can create, edit and manipulate files of all types as long as they are text based in this program. It is small and easy to use and install.</p>
<p style="text-align: justify;">nano</p>
<p style="text-align: justify;">eg. nano httpd.conf</p>
<h2 style="text-align: justify;">Browsing Directories and Paths Commands in SSH</h2>
<p style="text-align: justify;">Command: <span class="style1">cd</span></p>
<p style="text-align: justify;">Stands for change directory</p>
<p style="text-align: justify;">It is slightly different to ms-dos but still similar. You must remember that / is the top of your disk. You can use this relatively or not.</p>
<p style="text-align: justify;">eg. <span class="style1">cd home</span></p>
<p style="text-align: justify;">This command would only work if you were already at the top of the disk (in /). If you weren&#8217;t it would fail. If your current path is /var/log and you wanted to browse the the home directory, you would use:</p>
<p style="text-align: justify;">eg. <span class="style1">cd /home</span></p>
<p style="text-align: justify;">Adding the <span class="style1">/</span> at the front of the path makes it relative to the top of the disk.</p>
<p style="text-align: justify;"><span class="style1">./</span> refers to the current directory. You may require to use it in certain commands to show the current directory</p>
<p style="text-align: justify;"><span class="style1">../</span> refers to the directory above the current directory.</p>
<p style="text-align: justify;">For example, if the current directory path is /home/user4/public_html/downloads/programs/</p>
<p style="text-align: justify;"><span class="style1">./</span> would refer to the programs folder</p>
<p style="text-align: justify;"><span class="style1">../</span> would refer to the downloads folder</p>
<p style="text-align: justify;"><span class="style1">../../</span> would refer to the public_html folder</p>
<p style="text-align: justify;"><span class="style1">../../../</span> would refer to the user4 folder</p>
<p style="text-align: justify;">and so on.</p>
<h2 style="text-align: justify;">Listing Directory Content</h2>
<p style="text-align: justify;">To list the files and folders inside a directory you can use the ls command.</p>
<p style="text-align: justify;">eg. <span class="style1">ls</span></p>
<p style="text-align: justify;">For better display, you can use:</p>
<p style="text-align: justify;">eg. <span class="style1">ls -l</span></p>
<p style="text-align: justify;">On some servers, if its setup you can simply type two L&#8217;s and it will work like ls -l</p>
<p style="text-align: justify;">eg. <span class="style1">ll</span></p>
<p style="text-align: justify;">For more advanced directory listing options type:</p>
<p style="text-align: justify;">eg: <span class="style1">ls &#8211;help</span></p>
<p style="text-align: justify;">If you would like to run a filter over the results you can add a pipe, followed by the grep command and then your criteria..</p>
<p style="text-align: justify;">eg. <span class="style1">ll | grep   index</span></p>
<p style="text-align: justify;">OR</p>
<p style="text-align: justify;">eg. <span class="style1">ll | grep .php</span></p>
<p style="text-align: justify;">Don&#8217;t forget if <span class="style1">ll</span> doesn&#8217;t work, use the <span class="style1">ls</span> or <span class="style1">ls -al</span> commands. <em>Wildcards are not needed.</em> The grep command searches for pattens in things. This is merly one example of its uses.</p>
<h2 style="text-align: justify;">Making Files and Directories</h2>
<p style="text-align: justify;">There are lots of ways to create a file on the fly.</p>
<p style="text-align: justify;">Best way is to use a text editor like nano:</p>
<p class="style1" style="text-align: justify;">nano filename.conf</p>
<p style="text-align: justify;">OR to put something quickly in a file use:</p>
<p class="style1" style="text-align: justify;">echo &#8220;my content&#8221; &gt; test.txt</p>
<p style="text-align: justify;">This will create an empty file. Touch updates when a file was last updated but in this case will also create it if it doesn&#8217;t exist:</p>
<p class="style1" style="text-align: justify;">touch test.txt</p>
<p style="text-align: justify;">Make a directory, you can use:</p>
<p class="style1" style="text-align: justify;">mkdir &lt;dir name&gt;</p>
<h2 style="text-align: justify;">Deleting</h2>
<p style="text-align: justify;">Command: <span class="style1">rm</span></p>
<p style="text-align: justify;">Delete the folder and everything under it:</p>
<p class="style1" style="text-align: justify;">rm -r &lt;dir&gt;</p>
<p style="text-align: justify;">To delete everything without prompting for delete add a <span class="style1">-f</span> in there too:</p>
<p class="style1" style="text-align: justify;">rm -rf &lt;dir&gt;</p>
<p style="text-align: justify;">Delete a file:</p>
<p class="style1" style="text-align: justify;">rm &lt;filename&gt;</p>
<p style="text-align: justify;">Delete file without prompt:</p>
<p class="style1" style="text-align: justify;">rm -f &lt;filename&gt;</p>
<p style="text-align: justify;">So to delete everything under the &#8220;downloads&#8221; directory you could:</p>
<p style="text-align: justify;">Example 1:</p>
<p class="style1" style="text-align: justify;">cd /home/user1/public_html/<br />
rm -rf download</p>
<p style="text-align: justify;">This would delete the download directory, without prompt and everything under it.</p>
<p style="text-align: justify;">Example 2:</p>
<p class="style1" style="text-align: justify;">cd /home/user1/public_html/download<br />
rm -rf ./*</p>
<h2 style="text-align: justify;">Mounting</h2>
<p style="text-align: justify;">If you have a second HDD (hard disk drive) installed, such as for back up purposes you can mount it at /backup.</p>
<p class="style1" style="text-align: justify;">mount</p>
<p style="text-align: justify;">eg. <span class="style1">mount /dev/hdc2 /backups</span></p>
<p style="text-align: justify;">* Note: Need to create /backups (as in the directory) before you mount it.</p>
<h2 style="text-align: justify;">Check Binded IP addresses</h2>
<p class="style1" style="text-align: justify;">ifconfig</p>
<p style="text-align: justify;">Under eth0 you&#8217;ll see something like:</p>
<p class="style1" style="text-align: justify;">inet addr:xx.79.162.45  Bcast:xx.79.162.45  Mask:255.255.255.248</p>
<p style="text-align: justify;">Gives you the IP details. The &#8220;lo&#8221; one is the loopback adapter, allows it to talk to itself. Insane hey?</p>
<h2 style="text-align: justify;">Useful symbols including wildcards</h2>
<p style="text-align: justify;">One powerful feature is the use of the &lt; and &gt; symbols. They allow you to write information to and from a file.</p>
<p style="text-align: justify;">eg. <span class="style1">echo &#8220;my data&#8221; &gt; test.conf</span></p>
<p style="text-align: justify;">The above command will replace all the file content with &#8220;my data&#8221;. If you want   add to the bottom of the file:</p>
<p style="text-align: justify;">eg. <span class="style1">echo &#8220;my data&#8221; &gt;&gt; test.conf</span></p>
<p style="text-align: justify;">It also works the other way too. For example if you have an sql back up in backup.sql, you can import it:</p>
<p style="text-align: justify;">eg. <span class="style1">mysqldump -B [database name] -u [username] -p &lt; backup.sql </span></p>
<p style="text-align: justify;">The * symbol refers to everything. For example to delete everything in the current folder use:</p>
<p class="style1" style="text-align: justify;">rm -rf ./*</p>
<h2 style="text-align: justify;">What is fsck?</h2>
<p style="text-align: justify;">Stands for &#8220;File system check&#8221; &#8211; It checks the disk for corrupt sectors and attempts to repair. Can be used when errors like &#8220;seg fault&#8221; appear and other situations.</p>
<h2 style="text-align: justify;">File System Permissions</h2>
<p style="text-align: justify;">Permissions in the file system are broken down into:</p>
<ul style="text-align: justify;">
<li>File permissions</li>
<li>Group permissions</li>
</ul>
<p style="text-align: justify;">Permissions can be assigned to files and directories.</p>
<p style="text-align: justify;">File permissions can be adjusted with the CHMOD tool (stands for change mode). Permissions are broken up to Read, Write, Execute. These permissions can then be assigned to root (master user), the group, and everyone (general public like web guests).</p>
<p style="text-align: justify;">Permissions are represented by a number (CHMOD Numbers).</p>
<table style="text-align: justify;" border="0" cellspacing="0" cellpadding="0" width="250">
<tbody>
<tr>
<td width="52"><strong>Digit</strong></td>
<td width="42"><strong>rwx</strong></td>
<td width="132"><strong>Result</strong></td>
</tr>
<tr>
<td>0</td>
<td>&#8212;</td>
<td>no access</td>
</tr>
<tr>
<td>1</td>
<td>&#8211;x</td>
<td>execute</td>
</tr>
<tr>
<td>2</td>
<td>-w-</td>
<td>write</td>
</tr>
<tr>
<td>3</td>
<td>-wx</td>
<td>write and execute</td>
</tr>
<tr>
<td>4</td>
<td>r&#8211;</td>
<td>read</td>
</tr>
<tr>
<td>5</td>
<td>r-x</td>
<td>read and execute</td>
</tr>
<tr>
<td>6</td>
<td>rw-</td>
<td>read and write</td>
</tr>
<tr>
<td>7</td>
<td>rwx</td>
<td>read write execute</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">Remembering that permissions are assigned to three groups (root, group and everyone) each group is assigned a number. For example, 777 refers to full access for everyone. Numbers 775 or 755 are the general permissions assigned to web directories and pages.</p>
<p style="text-align: justify;">To change the CHMOD permissions:</p>
<p class="style1" style="text-align: justify;">chmod</p>
<p style="text-align: justify;">eg. <span class="style1">chmod 755 index.html</span></p>
<p style="text-align: justify;">or for a directory:</p>
<p style="text-align: justify;">eg. <span class="style1">chmod 755 public_html</span></p>
<p style="text-align: justify;">To mass change permissions, which you must be VERY careful of, you can use the -r parameter because it changes everything.</p>
<p style="text-align: justify;">eg. <span class="style1">chmod -r 755  public_html</span></p>
<p style="text-align: justify;">Everything under public_html will now have the permission of 755 (root full access, group read and execute, public read and execute).</p>
<p style="text-align: justify;">There is an excellent tutorial showing more in depth information on mode and group permissions located at <a href="http://www.library.yale.edu/%7Elso/workstation/docs/permissions/" target="_blank">http://www.library.yale.edu/~lso/workstation/docs/permissions/</a></p>
<h2 style="text-align: justify;">Common Paths and File Locations</h2>
<p style="text-align: justify;">MYSQL Config &#8211; <span class="style1">/etc/my.cnf</span><br />
MYSQL -<span class="style1"> /usr/local/mysql/ </span></p>
<p style="text-align: justify;">SSH Config &#8211; <span class="style1">/etc/ssh/</span> (generally the conf file with sshd in it)</p>
<p style="text-align: justify;">Apache (or httpd) &#8211; <span class="style1">/usr/local/apache/</span> OR <span class="style1">/etc/httpd</span><br />
Apache Conf file &#8211; <span class="style1">/usr/local/apache/conf/httpd.conf</span><br />
Apache Daemon &#8211; <span class="style1">/usr/local/apache/bin/apachectl</span></p>
<p style="text-align: justify;">Logs &#8211; <span class="style1">/var/log/ </span></p>
<p style="text-align: justify;">User Data &#8211; <span class="style1">/home/ </span></p>
<h2 style="text-align: justify;">Restarting Services (Apache, Mysql, etc)</h2>
<p style="text-align: justify;">If setup, you can generally use the &#8220;service&#8221; command. eg:</p>
<p class="style1" style="text-align: justify;">service httpd restart</p>
<p style="text-align: justify;">It&#8217;s a shortcut method to accessing daemons.</p>
<p style="text-align: justify;">HTTPD &#8211; <span class="style1">service httpd restart</span> OR <span class="style1">service apache restart</span><br />
MYSQL &#8211; <span class="style1">service mysql restart</span></p>
<p style="text-align: justify;"><strong>Running Scripts/Programs</strong></p>
<p style="text-align: justify;">You can do so in two ways:</p>
<p style="text-align: justify;">Change directory to the correct path then execute:</p>
<p class="style1" style="text-align: justify;">cd /scripts<br />
./scriptname</p>
<p style="text-align: justify;">OR</p>
<p class="style1" style="text-align: justify;">/scripts/scriptname</p>
<p style="text-align: justify;">For sh scripts, you need to put sh in front of it:</p>
<p class="style1" style="text-align: justify;">cd /scripts<br />
sh scriptname</p>
<p style="text-align: justify;">OR</p>
<p class="style1" style="text-align: justify;">sh /scripts/scriptname</p>
<h2 style="text-align: justify;">Repairing Databases</h2>
<p class="style1" style="text-align: justify;">pathtomysql/bin/mysqlcheck -B  &#8211;repair</p>
<p style="text-align: justify;">Generally the path to mysql is <span class="style1">/usr/local/mysql/</span> but not always.</p>
<p style="text-align: justify;">If you get an access denied error, you need to login first. If you have root access you can just add a <span class="style1">-p</span> on the end.</p>
<p class="style1" style="text-align: justify;">pathtomysql/bin/mysqlcheck -B  -p &#8211;repair</p>
<p style="text-align: justify;">Do not enter your password in the command. It will prompt you to login after you press enter. If you need to login with a user account (not root) add an <span class="style1">-u</span> for user.</p>
<p class="style1" style="text-align: justify;">pathtomysql/bin/mysqlcheck -B  -u  -p &#8211;repair</p>
<p style="text-align: justify;">The <span class="style1">-B</span> parameter means select a single database or two or three. If you want to repair all of them, use <span class="style1">-A</span> instead (root required):</p>
<p class="style1" style="text-align: justify;">pathtomysql/bin/mysqlcheck -A  -p &#8211;repair</p>
<p style="text-align: justify;">Remember the different ways of accessing the program:</p>
<p style="text-align: justify;">a) <span class="style1">cd  pathtomysql/bin/<br />
./mysqlcheck  -A  -p &#8211;repair</span></p>
<p style="text-align: justify;">b) <span class="style1">/pathtomysql/bin/mysqlcheck -A  -p &#8211;repair</span></p>
<p style="text-align: justify;">c) <span class="style1">mysqlcheck -A  -p &#8211;repair</span></p>
<p style="text-align: justify;">Sometimes servers are setup (sbin) so you don&#8217;t have to type all the full paths or change to them.</p>
<p style="text-align: justify;"><em>Source: http://www.sshcmds.com/</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.allticles.com/ssh-commands-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Share Files And Create VPN(Virtual Private Network) Between Two Computers Easily</title>
		<link>http://www.allticles.com/how-to-share-files-and-create-vpnvirtual-private-network-between-two-computers-easily/</link>
		<comments>http://www.allticles.com/how-to-share-files-and-create-vpnvirtual-private-network-between-two-computers-easily/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 00:39:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://www.allticles.com/?p=1748</guid>
		<description><![CDATA[If you are looking for a free and easy way to create a VPN(Virtual Private Network) connection to another computer, share files, remote control or share screens between computers? Gbridge helps you to manage your multiple PCs, and collaborate works with close friends. In addition, you will be able to use it when you want [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">If you are looking for a free and easy way to create a VPN(Virtual Private Network) connection to another computer, share files, remote control or share screens between computers? Gbridge helps you to manage your multiple PCs, and collaborate works with close friends. In addition, you will be able to use it when you want to privately exchange large media files with your friends. <a href="http://www.gbridge.com/" target="_blank">Gbridge</a> is a free tool which you can use to sync folders, share files, control another computer, share your desktop, or chat. It connects two computers directly and securely.</p>
<p style="text-align: justify;">After downloading Gbridge’s Windows client, installing is relatively straightforward. Once you are done with the installation, you’ll be asked for your Gmail/Google account information, and to give a host name in the login screen as below.</p>
<p><img src="http://www.addictivetips.com/wp-content/uploads/2008/10/login.png" alt="login" width="373" height="210" /></p>
<p style="text-align: justify;"><span id="more-1748"></span>When everything’s set up, you’re ready to go, but you might want to set up Gbridge on any other computers you own to create a virtual network amongst your PC’s. You can install and auto-start Gbridge on multiple computers, using the same Gmail logon, and it will keep all those computers connected and ready to trade or stream files.</p>
<p><img src="http://www.addictivetips.com/wp-content/uploads/2008/10/31.png" alt="3" width="480" height="406" /></p>
<p style="text-align: justify;">Gbridge Client Window will look like this. The easiest way to use Gbridge is to create <strong>SecureShares</strong> Hit the big button for <strong>SecureShares</strong> at the top on the Gbridge client that’s doing the sharing, choose a folder, and choose the people who can access it and set a password by clicking on <strong>Create SecureShare</strong> as show below.</p>
<p><img src="http://www.addictivetips.com/wp-content/uploads/2008/10/4.png" alt="4" width="480" height="404" /></p>
<p>From here you would choose the people who can access it and set a password.</p>
<p><img src="http://www.addictivetips.com/wp-content/uploads/2008/10/5.png" alt="5" width="312" height="484" /></p>
<p style="text-align: justify;">So if your friends want to quickly connect to your computer, just ask them to install the Gbridge client software and you can now send large files, instantly play MP3’s off each other’s computer, share your desktops, and even create photo slideshows from your folders and let others watch. Those files are shared through a browser link (as show below) that only works for Gbridge-connected systems.</p>
<p><img src="http://www.addictivetips.com/wp-content/uploads/2008/10/2.png" alt="2" width="480" height="115" /></p>
<p style="text-align: justify;">Gbridge try multiple ways to connect, based on what works and which method is giving the highest performance. As a last resort, it can use GTalk to create a connection on top of the service. Overall, it’s a great program with a lot of features and no restrictions! You can share very large files without a problem, share your desktop, and stream music and video to your computer from another.</p>
<p><em>Source: http://www.addictivetips.com/</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.allticles.com/how-to-share-files-and-create-vpnvirtual-private-network-between-two-computers-easily/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

