<?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>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; linux server</title> <atom:link href="http://www.ghacks.net/tag/linux-server/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 17:32:23 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Migrate users from one Linux machine to another</title><link>http://www.ghacks.net/2010/02/10/migrate-users-from-one-linux-machine-to-another/</link> <comments>http://www.ghacks.net/2010/02/10/migrate-users-from-one-linux-machine-to-another/#comments</comments> <pubDate>Wed, 10 Feb 2010 17:36:36 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[copy user data]]></category> <category><![CDATA[linux server]]></category> <category><![CDATA[migrating users]]></category> <category><![CDATA[recovering users]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=22960</guid> <description><![CDATA[Have you ever had a need to migrate current running Linux users from installation to another? That would be a simple task if the user count was low. But  what happens when the user count is in the hundreds? What do you do then? If you&#8217;re not using LDAP, you know you will have to [...]]]></description> <content:encoded><![CDATA[<p>Have you ever had a need to migrate current running Linux users from installation to another? That would be a simple task if the user count was low. But  what happens when the user count is in the hundreds? What do you do then? If you&#8217;re not using LDAP, you know you will have to migrate the users&#8217; data, passwords, etc from the old machine to the new. Believe it or not, this is just a matter of a few commands &#8211; not necessarily simple commands, but it&#8217;s not as complex as you would think.</p><p>In this article I am going to show you how to make this migration so your Linux users do not loose their data and their passwords are all retained.</p><p><span
id="more-22960"></span><strong>What we migrating</strong></p><p>The list is fairly simple:</p><ul><li><strong>/etc/passwd </strong>- Contains information about the user.</li><li><strong>/etc/shadow </strong>- Contains the encrypted passwords.</li><li><strong>/etc/group </strong>- Contains group information.</li><li><strong>/etc/gshadow </strong>- Contains group encrypted passwords.</li><li><strong>/var/spool/mail </strong>- Contains users email (the location will depend upon the mail server you use).</li><li><strong>/home/ </strong>- Contains users data.</li></ul><p>Unfortunately these files can not simply be copied from one machine to another &#8211; that would be too easy.  Just make sure you enter the following commands correctly.</p><p><strong>Source machine</strong></p><p>These are the commands you will need to run on the machine you are migrating users FROM. I will assume you are doing this on a system that uses a root user (such as Fedora), so all commands will be done as root:</p><p><em>mkdir ~/MOVE</em></p><p>The above command creates a directory to house all of the files to be moved.</p><p><em>export UGIDLIMIT=500</em></p><p>The above command sets the UID filter limit to 500. NOTE: This value will be dictated by your distribution. If you use Red Hat Enterprise Linux, CentOS, or Fedora this value is shown in the command above. If you use Debian or Ubuntu that limit is 1000 (not 500).</p><p><em>awk -v LIMIT=$UGIDLIMIT -F: &#8216;($3&gt;=LIMIT) &amp;&amp; ($3!=65534)&#8217; /etc/passwd &gt; ~/MOVE/passwd.mig</em></p><p>The above command copies only user accounts from <strong>/etc/passwd</strong> (using <em>awk </em>allows us to ignore system accounts.)</p><p><em>awk -v LIMIT=$UGIDLIMIT -F: &#8216;($3&gt;=LIMIT) &amp;&amp; ($3!=65534)&#8217; /etc/group &gt; ~/MOVE/group.mi</em>g</p><p>The above command copies the <strong>/etc/group </strong>file.</p><p><em>awk -v LIMIT=$UGIDLIMIT -F: &#8216;($3&gt;=LIMIT) &amp;&amp; ($3!=65534) {print $1}&#8217; /etc/passwd | tee &#8211; |egrep -f &#8211; /etc/shadow &gt; ~/MOVE/shadow.mig</em></p><p>The above command copies the <strong>/etc/shadow</strong> file.</p><p><em>cp /etc/gshadow ~/MOVE/gshadow.mig</em></p><p>The above command copies the <strong>/etc/gshadow</strong> file.</p><p><em>tar -zcvpf ~/MOVE/home.tar.gz /home</em></p><p>The above command archives <strong>/home.</strong></p><p><em>tar -zcvpf ~/MOVE/mail.tar.gz /var/spool/mail</em></p><p>The above command archives the mail directory. NOTE: If you are using Sendmail this is the correct directory. If you are using Postfix that directory most likely will be <strong>/etc/postfix</strong>.</p><p>Now it&#8217;s time to move everything in <strong>~/MOVE </strong>over to the new server. You can do this using the <em>scp </em>command like so:</p><p><em>scp -r ~/MOVE/* USER@IP_OF_NEW_SERVER:/home/USER/</em></p><p>Where USER is the username you will use to send the file and IP_OF_NEW_SERVER is the address of the new server. NOTE: If this server is not on line yet you can always copy these files onto a thumb drive and move them that way.</p><p><strong>Target machine</strong></p><p>Now we&#8217;re working on the new server. Follow these commands (run as the root user):</p><p><em>mkdir ~/newsusers.bak</em></p><p>The above command will create a new directory that will house the backup of the current users.</p><p><em>cp /etc/passwd /etc/shadow /etc/group /etc/gshadow ~/newsusers.bak</em></p><p>The above command will copy the necessary files to the new backup directory.</p><p><em>cd /PATH/TO/DIRECTORY<br
/> cat passwd.mig &gt;&gt; /etc/passwd<br
/> cat group.mig &gt;&gt; /etc/group<br
/> cat shadow.mig &gt;&gt; /etc/shadow<br
/> /bin/cp gshadow.mig /etc/gshadow</em></p><p>The above commands will restore all password files onto the new system. NOTE: Where /PATH/TO/DIRECTORY is the location where you copied the files onto the new system.</p><p>cd /<br
/> tar -zxvf <em>/PATH/TO/DIRECTORY/</em>home.tar.gz</p><p>The above commands will first change you to the <strong>/ </strong>directory and then unpack the archived <strong>/home</strong> directory. NOTE: Where <em>/PATH/TO/DIRECTORY </em>is the location where you copied the files onto the new system.</p><p><em>cd /<br
/> tar -zxvf <em>/PATH/TO/DIRECTORY/</em>mail.tar.gz</em></p><p>The above commands will first change you to the <strong>/ </strong>directory and then unpack the archived<strong>/var/spool/mail </strong>directory. NOTE: Where /PATH/TO/DIRECTORY is the location where you copied the files onto the new system.</p><p>You can now reboot your system with the users in place.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/02/10/migrate-users-from-one-linux-machine-to-another/feed/</wfw:commentRss> <slash:comments>11</slash:comments> </item> <item><title>Automatically Send MySQL Database Backup To Gmail</title><link>http://www.ghacks.net/2009/07/13/automatically-send-mysql-database-backup-to-gmail/</link> <comments>http://www.ghacks.net/2009/07/13/automatically-send-mysql-database-backup-to-gmail/#comments</comments> <pubDate>Mon, 13 Jul 2009 13:14:26 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[Online Services]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[database backup database]]></category> <category><![CDATA[gmail]]></category> <category><![CDATA[linux server]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[mysql backup]]></category> <category><![CDATA[mysql database backup]]></category> <category><![CDATA[server]]></category> <category><![CDATA[sql backup]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=14370</guid> <description><![CDATA[Webmasters have to make sure that their websites and files are getting backed up regularly to be prepared when something unforeseen happens. This unforeseen event can be a hacker attack, a database crash, a fire in the data center of the hoster or human error. Whatever the cause is it can have a severe impact [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://www.ghacks.net/wp-content/uploads/2009/07/mysql.gif" alt="mysql" title="mysql" width="128" height="85" class="alignleft size-full wp-image-14371" />Webmasters have to make sure that their websites and files are getting backed up regularly to be prepared when something unforeseen happens. This unforeseen event can be a hacker attack, a database crash, a fire in the data center of the hoster or human error. Whatever the cause is it can have a severe impact on the service and business if backups are not available to restore the website or service.</p><p>Many web hosting companies offer backup space and create backups regularly. Some on the other hand ask for additional payments or do not offer this backup service at all. It then is up to the webmaster or server administrator to ensure that the data gets backed up regularly so that it can be restored when needed.</p><p><span
id="more-14370"></span>One option that is becoming increasingly popular is to backup data and send it to an offsite storage space. <a
href="http://www.backup2mail.com/">Backup2Mail</a> is such a script. It can initiate automatic MySQL database backups on Linux servers using cron jobs and transfer these backups to a Gmail account. The only restriction is that the size of the zipped database should not exceed the maximum attachment limit of Gmail which is currently 25 Megabytes.</p><p>The developer provides instructions on how to setup the MySQL database backup and Gmail transfer on his website. It basically means that the user needs to edit an index.php file to provide the script with the MySQL information and GMail data. The only thing left after this step is to create a cron job so that the script is executed regularly on the server. Backups will from then on be created automatically on the web server and send to the Gmail account.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/07/13/automatically-send-mysql-database-backup-to-gmail/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Set up a reliable ftp server with proftpd</title><link>http://www.ghacks.net/2009/04/23/set-up-a-reliable-ftp-server-with-proftpd/</link> <comments>http://www.ghacks.net/2009/04/23/set-up-a-reliable-ftp-server-with-proftpd/#comments</comments> <pubDate>Thu, 23 Apr 2009 17:42:18 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Networks]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[anonymous ftp]]></category> <category><![CDATA[ftp]]></category> <category><![CDATA[linux server]]></category> <category><![CDATA[proftpd]]></category> <guid
isPermaLink="false">http://www.ghacks.net/2009/04/23/set-up-a-reliable-ftp-server-with-proftpd/</guid> <description><![CDATA[If you have a need for an ftp server, and you have a Linux machine on your network, then you need look no further than proftpd. The proftpd project came about to fill the need for a secure and reliable ftp server for the Linux operating system. Proftpd uses a single configuration file, so it&#8217;s [...]]]></description> <content:encoded><![CDATA[<p>If you have a need for an ftp server, and you have a Linux machine on your network, then you need look no further than <a
title="proftpd" href="http://www.proftpd.org/" target="_blank">proftpd</a>. The proftpd project came about to fill the need for a secure and reliable ftp server for the Linux operating system. Proftpd uses a single configuration file, so it&#8217;s simple to set up. This ftp server was also based on an admiration for Apache, so there are many similarities between the two. For instance, where Apache uses .htaccess, proftpd uses .ftpaccess for per-directory configuration.Proftpd also support anonymous ftp access and can be run as a stand alone server or using inetd control.</p><p>The aim of this article is to show you how to quickly set up an ftp server for user access and anonymous access on your Linux server.</p><p><span
id="more-12303"></span><strong>Installing</strong></p><p>Installing proftpd is simple. If you are in a gui environment, open up your Add/Remove Software utility, do a search for proftpd, select the resulting proftpd entry, and apply the changes. If you are not in a gui environment you can issue a command similar to:</p><p><em>sudo apt-get install proftpd</em></p><p>or</p><p><em>yum install proftpd</em></p><p>To install the tool.</p><p><strong>Configuration</strong></p><p>The configuration file for proftpd is <strong>/etc/proftpd.conf</strong>. The first portion of the configuration file is dedicated to the main configuration options. If you are setting up a basic ftp server the only thing you may want to edit in this section is the ServerAdmin email address. In this same section you can switch the server from a stand-alone server (default) to an inetd-based by uncommenting the type you want and commenting out the type you don&#8217;t want.</p><p>Interestingly enough, once installed, by default you will have user-level ftp access by just starting the proftpd daemon. To do this issue the command:</p><p><strong>/etc/rc.d/init.d/proftpd start</strong></p><p>or</p><p><strong>/etc/init.d/proftpd start</strong></p><p>depending upon your distribution.</p><p>When your users log into their ftp account they will default to their home directory and can not navigate above their ~/ directory.</p><p><strong>Anonymous access</strong></p><p>Now if you want to add anonymous ftp access you have to visit another section of the <strong>/etc/proftpd.conf</strong> file. If you scroll down to around line 104 of this file you will see the opening anonymous tag &#8220;&lt;Anonymous&gt;&#8221;. Everything between this tag and the closing tag, &#8220;&lt;/Anonymous&gt;&#8221; refers to anonymous configuration.</p><p>By default all of the anonymous configuration is commented out. To create a simple anonymous ftp server setup you will want to uncomment out the following lines:</p><p><code>&lt; Anonymous &gt;<br
/> User                          ftp<br
/> Group                         ftp<br
/> AccessGrantMsg                "Anonymous login ok, restrictions apply."<br
/> UserAlias                     anonymous ftp<br
/> MaxClients                    10 "Sorry, max %m users -- try again later"<br
/> DefaultChdir                  /pub<br
/> &lt; /Anonymous &gt;</code></p><p>NOTE: There will be no spaces in the opening and closing tags.</p><p>Once you uncomment out them, restart the proftpd server and anonymous access will have been granted to users. When anonymous users log in to the server they will be confined to the <strong>/var/ftp</strong> directory (although to the user it will appear as &#8220;/&#8221;). Anonymous users will have access to two directories: <strong>pub</strong> and <strong>uploads</strong>. The <strong>pub</strong> directory is where anonymous users can download files and the <strong>uploads</strong> directory is where anonymous users can upload files.</p><p><strong>Final Thoughts</strong></p><p>Proftpd is one of the easiest ftp servers to get up and running. It is safe, reliable, and allows simple configuration for anonymous access. If you are looking for an ftp server that requires little hardware, can be deployed quickly, and will &#8220;just work&#8221; then proftpd is the logical choice.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/04/23/set-up-a-reliable-ftp-server-with-proftpd/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> </channel> </rss>
