<?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>yum &#8211; VeriTeknik</title>
	<atom:link href="https://www.veriteknik.net.tr/en/tag/yum/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.veriteknik.net.tr/en/</link>
	<description>VeriTeknik Bilişim &#124; VeriTeknik Bilişim</description>
	<lastBuildDate>Mon, 16 Apr 2012 22:20:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Web Hosting Security premier</title>
		<link>https://www.veriteknik.net.tr/en/web-hosting-security-premier/</link>
					<comments>https://www.veriteknik.net.tr/en/web-hosting-security-premier/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Mon, 16 Apr 2012 22:20:07 +0000</pubDate>
				<category><![CDATA[Web Hosting Security]]></category>
		<category><![CDATA[directadmin]]></category>
		<category><![CDATA[repoforge]]></category>
		<category><![CDATA[rpmforge]]></category>
		<category><![CDATA[telnet]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[yum]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=323</guid>

					<description><![CDATA[<p>IMPORTANT NOTE: Never assume the directory structures exist in your system as written in the document. Never blindly follow security instructions &#8212; read, review, compare, apply as it fits your system., Update your server as necessary As its nature, Linux is a multi-developer operating system and you might see an update on any package everyday, an updater like [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/web-hosting-security-premier/">Web Hosting Security premier</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>IMPORTANT NOTE:</strong></span> Never assume the directory structures exist in your system as written in the document. Never blindly follow security instructions &#8212; read, review, compare, apply as it fits your system.,</p>
<h3>Update your server as necessary</h3>
<p>As its nature, Linux is a multi-developer operating system and you might see an update on any package everyday, an updater like YUM if you don&#8217;t change it&#8217;s default behavior hosts the most recent stable versions of each package that you install on your server.</p>
<p>Compared to other operating systems, updating Linux is easy as writing a command to terminal, the rest will be automated by YUM. Yum can be extended by independent software repositories like Repoforge. RPMforge is a collaboration of Dag and other packagers. They provide over 5000 packages for CentOS, including wine, vlc, mplayer, xmms-mp3, and other popular media tools. It is not part of Red Hat or CentOS but is designed to work with those distributions.</p>
<p>To install Rpmforge, run;</p>
<blockquote><p> rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.rf.src.rpm</p></blockquote>
<p>If you get an error with the command, check the web site for a recent version. If you are using a control panel like Directadmin you better exclude the packages below from yum as they are maintained by the control panel updater;</p>
<blockquote><p>exclude=apache* httpd* mod_* mysql* MySQL* da_* *ftp* exim* sendmail* php* bind-chroot*</p></blockquote>
<p>and the last thing you should do is to type</p>
<blockquote><p>yum upgrade</p></blockquote>
<p>We suggest you to run the update at least every once a month.</p>
<h3>Disable Telnet</h3>
<hr style="width: 100%;" width="100%" />
<p>Nowadays, Telnet is mostly given its role to SSH; more secure remote shell client, because Telnet is sending the passwords in readable clear text. Also SSH have many abilities that you can use such as private-keys that you can use to log in to the server without writing down a password. Public key is mostly used when you need root access even you don&#8217;t know the root password (root password might be changed by the system administrator or by your client which you install the system for).</p>
<p>Connect to the server and edit<strong> /etc/xinetd.d/telnet</strong> by typing;</p>
<blockquote><p>vi /etc/xinetd.d/telnet</p></blockquote>
<p>if exists <strong>disable = no</strong> change to <strong>disable = yes</strong></p>
<p>save &amp; exit (SHIFT + ZZ)</p>
<h3>Restrict Access to applications that can directly connect to the Internet</h3>
<hr />
<p>Even an attacker leak into your server, it is better to give him no chance to download his applications to the server, don&#8217;t give run permission to following applications except root user by typing;</p>
<blockquote><p>chmod 700 /usr/bin/wget<br />
chmod 700 /usr/bin/telnet<br />
chmod 700 /usr/local/bin/lynx<br />
chmod 700 /usr/bin/links<br />
chmod 700 /usr/bin/bcc<br />
chmod 700 /usr/bin/byacc<br />
chmod 700 /usr/bin/cc<br />
chmod 700 /usr/bin/gcc<br />
chmod 700 /usr/bin/perlcc<br />
chmod 700 /usr/bin/yacc<br />
chmod 0700 /usr/bin/curl<br />
chmod 700 /usr/bin/lwp-*<br />
chmod 700 /usr/bin/*ncftp*</p></blockquote>
<p>Also please note that, if you are taking backups of your domains/dbs to the same server, be aware that a directory created without explicit permission will be readable by all users, to make the directory readable only by root, type;</p>
<blockquote><p>chmod 600 /backups</p></blockquote>
<h3>Restrict OS level function calling to PHP</h3>
<hr />
<p>In a shared hosting environment, even a customer of yours may try to explore your server. If you don&#8217;t have any reason to call the functions below, restrict them;</p>
<p>edit /etc/php.ini (or whereever it is, for directadmin you can check /usr/local/lib/php.ini) and find the line disable_functions and replace with the below line:</p>
<blockquote><p>disable_functions = apache_get_modules,apache_get_version,apache_getenv,apache_note, apache_setenv,disk_free_space,diskfreespace,dl, highlight_file,ini_alter,ini_restore,openlog,passthru,phpinfo, proc_nice,shell_exec,show_source,symlink,system, exec,popen,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_ put,fpassthru</p></blockquote>
<h3> Block executing commands on the /tmp Partition</h3>
<hr />
<p>Several script languages like PHP, holds temporary files like session,upload and cache on the /tmp partition on Linux systems. İf the attacker has an access to this folder then those scripts can be run from this point so with this way, all system files can be reached or accessed by root. To block running of files which are in the /tmp partition, it must not be given run permission while mounting /tmp partition.</p>
<p>To do this process, you have to choose /tmp partition as seperate partition while installaing the system. Enter this command in the command line to check this setting:</p>
<blockquote><p>df -h # or<br />
mount</p></blockquote>
<p>Enter this command:</p>
<blockquote>[root@xxx ~]# df -h<br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/mapper/VolGroup00-LogVol00 2.9G  820M  1.9G  30% /<br />
<strong>/dev/mapper/VolGroup00-LogVol02 2.9G  288M  2.4G  11% /tmp</strong><br />
/dev/mapper/VolGroup00-LogVol04 7.8G  3.8G  3.7G  51% /var<br />
/dev/mapper/VolGroup00-LogVol05 44G   35G  6.6G  85% /hsphere<br />
/dev/mapper/VolGroup00-LogVol03 4.8G  908M  3.6G  20% /usr<br />
/dev/sda1              99M   36M   58M  39% /boot<br />
tmpfs                 2.0G     0  2.0G   0% /dev/shm</p></blockquote>
<p>If you can not see a seperate  /tmp partition like in the example, create a new 3 GB /tmp partition by applying steps below. If there is a /tmp partition then follow with the step 2:</p>
<p><strong>Step 1:</strong></p>
<blockquote><p>cd /dev/<br />
dd if=/dev/zero of=Tmp bs=1024 count=3000000<br />
mkfs -t ext3 /dev/Tmp<br />
cd /<br />
cp -aR  /tmp  /tmp_backup<br />
mount  -o  loop,noexec,nosuid,rw  /dev/Tmp  /tmp<br />
cp -aR /tmp_backup/* /tmp/<br />
chmod 0777 /tmp<br />
chmod +t  /tmp</p></blockquote>
<p>Add information of the newly created partition into the /etc/fstab in order to make it available after next boot.</p>
<blockquote><p>/dev/Tmp          /tmp          ext3          loop,rw,nosuid,noexec     0 0</p></blockquote>
<p>If you already have  /tmp partition, please apply the below steps.</p>
<p><strong>Step 2:<br />
</strong></p>
<p>change &#8220;defaults&#8221; in the line starting with /tmp in /etc/fstab to restrict running applications such as</p>
<blockquote><p>/dev/VolGroup00/LogVol02 /tmp                    ext3    <strong>defaults </strong>1 2</p></blockquote>
<p>to</p>
<blockquote><p>/dev/VolGroup00/LogVol02 /tmp                    ext3     <strong>rw,nosuid,noexec</strong> 1 2</p></blockquote>
<p>Change defaults region as <strong>rw,nosuid,noexec </strong>then save and exit. Remount /tmp partition in order to make changes available immediately by typing;</p>
<blockquote><p>mount -oremount loop,rw,nosuid,noexec /tmp</p></blockquote>
<p>..</p>
<p>note: Some parts of this document inspired from the documentation of dynamicnet.net</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/web-hosting-security-premier/">Web Hosting Security premier</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/web-hosting-security-premier/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">323</post-id>	</item>
		<item>
		<title>Using the Python API for Yum</title>
		<link>https://www.veriteknik.net.tr/en/using-the-python-api-for-yum/</link>
					<comments>https://www.veriteknik.net.tr/en/using-the-python-api-for-yum/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Sun, 04 Mar 2012 11:12:32 +0000</pubDate>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[Programmin]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[yum]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=220</guid>

					<description><![CDATA[<p>Here&#8217;s something very basic yet poorly documented. That&#8217;s why it looks like almost everybody&#8217;s trying to hack their way into this module, the yum module for Python. First of all don&#8217;t forget that this module is only available if you&#8217;re using a Red Hat branch of distribution (fedora, centos etc.) For other distributions, such as [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/using-the-python-api-for-yum/">Using the Python API for Yum</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Here&#8217;s something very basic yet poorly documented. That&#8217;s why it looks like almost everybody&#8217;s trying to hack their way into this module, the yum module for Python.</p>
<p>First of all don&#8217;t forget that this module is only available if you&#8217;re using a Red Hat branch of distribution (fedora, centos etc.) For other distributions, such as Debian, there are other api&#8217;s, such as apt itself.</p>
<p>Below you&#8217;ll find some basic ways of getting configuration settings of the current yum.</p>
<pre class="brush: python; gutter: true; first-line: 1">import yum
yb = yum.YumBase()
print yb.conf.logfile # this will obviously printout the logfile's path
for i in yb.conf.reposdir : print i # and this will printout the directories and files for the repositories
print yb.conf.skip_broken # usually false. when set to true, your yum commands will take action of is the --skip-broken parameters was given to the yum itself.
print yb.conf.errorlevel # this is the level of errors you'd like to get as an output. it's between 0-10 and 0 is only critical ones, while 10 is more like a debug feature. Usually it is set to default 2, but since you'll be running in a script, after your script gets stable, its a good idea to set this to 0 and then distribute it.
print yb.conf.config_file_path # obvious again, the file path for your yum's config file.</pre>
<p>&nbsp;</p>
<p>for more configuration options, you can always see like this;</p>
<pre class="brush: python; gutter: true; first-line: 1">dir(yb.conf)</pre>
<p>and don&#8217;t forget this perfect module, to reverse engineer some function if you don&#8217;t know what arguments it gets and if it&#8217;s poorly documented (ex: it doesn&#8217;t have a valid __doc__ attribute) :</p>
<pre class="brush: python; gutter: true; first-line: 1">import inspect
inspect.getargspec(somefunction)</pre>
<p>And about the arch method. What yum knows about our architecture.</p>
<pre class="brush: python; gutter: true; first-line: 1">import yum
yb = yum.YumBase()
print yb.arch.compatarches # these are the compatible architectures with our system.
# below are the arch types that yum thinks we are usig (hopefully true!)
print yb.arch.canonarch
print yb.arch.basearch
# With the function below, you can get a list of architectures which are compatible with each other.
# Let's say you're using an x86_64 arch, then u can use packages from these ones,
yb.arch.get_arch_list('x86_64')
['x86_64', 'athlon', 'i686', 'i586', 'i486', 'i386', 'noarch']</pre>
<p>If you&#8217;d like to get the currently installed packages on your system, rpm is the module you&#8217;d like to load.</p>
<pre class="brush: python; gutter: true; first-line: 1">import rpm
bold = "\033[1m"
reset = "\033[0;0m"
trans = rpm.TransactionSet()
for header in trans.dbMatch() : print "%s%s%s-%s:%s-%s.%s%s%s" % (bold,header['name'],reset,header['epochnum'],header['version'],header['release'],bold,header['arch'],reset)</pre>
<p>Note that this script outputs various parts in bold. You can use this in any script you&#8217;d like.</p>
<p>Yet here&#8217;s a nice method to install new packages.</p>
<pre class="brush: python; gutter: true; first-line: 1">import yum
yb=yum.YumBase()
searchlist=['name']
arg=['gedit']
matches = yb.searchGenerator(searchlist,arg)
for (package, matched_value) in matches :
    if package.name == 'gedit' : yb.install(package)
    yb.buildTransaction()
    yb.processTransaction()</pre>
<p>&nbsp;</p>
<p>Experiment, enjoy!</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/using-the-python-api-for-yum/">Using the Python API for Yum</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/using-the-python-api-for-yum/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">220</post-id>	</item>
		<item>
		<title>How to update Linux with Yum</title>
		<link>https://www.veriteknik.net.tr/en/how-to-update-linux-with-yum/</link>
					<comments>https://www.veriteknik.net.tr/en/how-to-update-linux-with-yum/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Tue, 26 Apr 2011 11:55:38 +0000</pubDate>
				<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[yum]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=115</guid>

					<description><![CDATA[<p>Updating RedHat &#38; CentOS with Yum If you are using RedHat &#38; its clones like CentOS or CloudLinux etc. you can use Yum or up2date to upgrade your current system. Please note that is you have a RedHat Enterprise Linux Subscription we offer you to use the command up2date, to upgrade your server with yum [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/how-to-update-linux-with-yum/">How to update Linux with Yum</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>Updating RedHat &amp; CentOS with Yum</strong></p>
<p>If you are using RedHat &amp; its clones like CentOS or CloudLinux etc. you can use Yum or up2date to upgrade your current system.</p>
<p>Please note that is you have a RedHat Enterprise Linux Subscription we offer you to use the command <strong>up2date</strong>, to upgrade your server with yum write the command from shell:</p>
<blockquote>
<div>yum upgrade</div>
</blockquote>
<p>If it asks for the keys, you can press &#8220;Y&#8221; to accept the keys and continue to install the upgrades, to install an application or library with yum type:</p>
<blockquote>
<div>yum install <strong>packagename</strong></div>
</blockquote>
<p>If you don&#8217;t know the package name containing the application you want to use, you can use the list function of yum.</p>
<p>For example to list packages related to <strong>dig </strong>similiar to Windows <strong>nslookup </strong>type the following command:</p>
<blockquote>
<div>yum list dig*</div>
</blockquote>
<p>Yum will find the packages names starting with dig, this function is so useful when finding <strong>apache </strong>modules (mod-*) and <strong>php </strong>modules (php-*) but this time it will return with an error as it cannot find any related packages names starting with <strong>dig*</strong>:</p>
<blockquote>
<div>#Error: No matching Packages to list</div>
</blockquote>
<p>Because some applications reside in a set of packages in Linux distros. Here comes the &#8220;<strong>whatprovides</strong>&#8221; in stage. If you used the command in Linux before but you don&#8217;t know the package containing the command you can find it easily with yum:</p>
<blockquote>
<div>yum whatprovides */dig</div>
</blockquote>
<p>and the output of yum is:</p>
<blockquote>
<div>#30:<strong>bind-utils</strong>-9.3.6-4.P1.el5_4.2.x86_64 : Utilities for querying DNS name servers.<br />
#Repo        : base<br />
#Matched from:<br />
#Filename    : /usr/bin/dig</div>
</blockquote>
<p>Yum tell us the package we were searching for is <strong>bind-utils</strong>. When you install bind-utils you will have a bunch of useful utulities related to <strong>named</strong>. After this step the only thing you need to do is:</p>
<blockquote>
<div>yum install bind-utils</div>
</blockquote>
<p>and yum will install the package with all prerequisities.</p>
<p><span style="color: #ff0000;"><strong>IMPORTANT NOTE:</strong></span> This document is prepared for CentOS 5.6 and ment to work with other versions and distros.Never assume the directory structures exist in your system as written in the document. Never blindly follow security instructions &#8212; read, review, compare, apply as it fits your system.</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/how-to-update-linux-with-yum/">How to update Linux with Yum</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/how-to-update-linux-with-yum/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">115</post-id>	</item>
	</channel>
</rss>
