<?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>linux &#8211; Costigator</title>
	<atom:link href="https://costigator.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://costigator.com</link>
	<description>Tech Passion</description>
	<lastBuildDate>Fri, 03 Mar 2017 22:10:38 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>How to connect to a Linux Server without password</title>
		<link>https://costigator.com/it-software/operating-systems/how-to-connect-to-a-linux-server-without-password/</link>
					<comments>https://costigator.com/it-software/operating-systems/how-to-connect-to-a-linux-server-without-password/#respond</comments>
		
		<dc:creator><![CDATA[Luca]]></dc:creator>
		<pubDate>Fri, 03 Mar 2017 22:10:38 +0000</pubDate>
				<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<guid isPermaLink="false">http://costigator.com/?p=863</guid>

					<description><![CDATA[A secure password is normally long and complex, so it is hard to remember and to type for authentication. Today I want show how to connect to a Linux server using a certificate without entering the password. In this short tutorial I use my MacOS Sierra as client and a Ubuntu 10 as server. It will also work on other Linux / Unix versions. Generate a key pair The first step is to generate a key pair (private and public key) to use for authentication. The private key will remain on your computer in a safe place. The public key [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A secure password is normally long and complex, so it is hard to remember and to type for authentication. Today I want show how to connect to a Linux server using a certificate without entering the password.</p>
<p>In this short tutorial I use my MacOS Sierra as client and a Ubuntu 10 as server. It will also work on other Linux / Unix versions.</p>
<h2>Generate a key pair</h2>
<p>The first step is to generate a key pair (private and public key) to use for authentication. The private key will remain on your computer in a safe place. The public key will be imported on the server. Open a terminal and type:</p>
<pre><code data-language="shell">mbpl:~ lucacosta$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/lucacosta/.ssh/id_rsa): luca
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in luca.
Your public key has been saved in luca.pub.
The key fingerprint is:
SHA256:KoTUeuoGwMvHSEsEGy4KzBe09XKLQ+RVZiUbgVucS3s lucacosta@mbpl
The key's randomart image is:
+---[RSA 2048]----+
|+ .o o .+B+. |
|++ .* o.o=+ |
|*+.o.+ o+.o |
|==.o. +..o E |
|* B oo .S . |
|.= * .. |
| .o . . |
| .. . |
| .. |
+----[SHA256]-----+</code></pre>
<h2>Copy your public key to the server that you want connect</h2>
<p>Replace &lt;user&gt;@&lt;destination_server&gt; with your username and destination server:</p>
<pre><code data-language="shell">mbpl:~ lucacosta$ ssh-copy-id -f -i /Users/lucacosta/luca.pub &lt;user&gt;@&lt;destination_server&gt;
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/lucacosta/luca.pub"
xxxx@xxxxxxxxx's password: 

Number of key(s) added:        1
</code></pre>
<h2>Move your private key in your .ssh folder</h2>
<p>The last thing to do is to move your private key on your computer to a folder named .ssh and rename it with &#8220;id_rsa&#8221;. In my home directory I have two keys named luca and luca.pub (this is the name that you typed when creating the key pair). With the command &#8220;ls&#8221; you get the list of the files like this:</p>
<pre><code data-language="shell">mbpl:~ lucacosta$ ls
Applications			Music
Applications (Parallels)	NoSync
Creative Cloud Files		OneDrive
Desktop				Pictures
Documents			Public
Downloads			Synology
Dropbox				luca
Library				luca.pub
Movies</code></pre>
<p>Now copy your private key (in my case &#8220;luca&#8221;) to the &#8220;.ssh&#8221; folder with the new name &#8220;id_rsa&#8221;:</p>
<pre><code data-language="shell">mbpl:~ lucacosta$ cp luca .ssh/id_rsa
</code></pre>
<h2>Test the connection with the certificate</h2>
<p>Now we can test the connection (if you choosed to set a password for your private key you need to enter it when prompt):</p>
<pre><code data-language="shell">mbpl:~ lucacosta$ ssh xxxxx@xxxxxxxx
Enter passphrase for key '/Users/lucacosta/.ssh/id_rsa': 
Linux xxxxxxxxxxxxxxxxxxxxxx 2.6.32-042stab120.5 #1 SMP Tue Oct 25 22:31:12 MSK 2016 x86_64 GNU/Linux
Ubuntu 10.04.4 LTS

Welcome to Ubuntu!
 * Documentation:  https://help.ubuntu.com/
Last login: Thu Mar  2 20:36:54 2017 from xxxxxxxxxxxxx
xxxxxxx@xxxxxxxxxxx:~# </code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://costigator.com/it-software/operating-systems/how-to-connect-to-a-linux-server-without-password/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux fork bomb and how to prevent it</title>
		<link>https://costigator.com/development/programming-languages/linux-fork-bomb-and-how-to-prevent-it/</link>
					<comments>https://costigator.com/development/programming-languages/linux-fork-bomb-and-how-to-prevent-it/#respond</comments>
		
		<dc:creator><![CDATA[Luca]]></dc:creator>
		<pubDate>Sat, 04 Jun 2016 07:38:23 +0000</pubDate>
				<category><![CDATA[Programming Languages]]></category>
		<category><![CDATA[fork bomb]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">http://costigator.com/?p=799</guid>

					<description><![CDATA[A fork bomb is a piece of code that defines a function and runs it repetitively, until the system has no more computing resources. The system will also become unresponsive and the only solution to get it working again is reboot the system. The code The fork bomb code is (for example) like this one: Explanation First of all you define a function called &#8220;:&#8221;. The Syntax of the function is &#8220;:(){};&#8221;. Now in the function you will call the function itself recursively and send the output again to itself &#8220;:&#124;:&#8221;. The &#8220;&#38;&#8221; runs the function in the background. Now the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A fork bomb is a piece of code that defines a function and runs it repetitively, until the system has no more computing resources. The system will also become unresponsive and the only solution to get it working again is reboot the system.</p>
<h2>The code</h2>
<p>The fork bomb code is (for example) like this one:</p>
<pre><code class="eckosc eckosc_syntax_theme_dark" data-language="shell">:(){:|:&amp;};:</code></pre>
<h2>Explanation</h2>
<p>First of all you define a function called &#8220;:&#8221;. The Syntax of the function is &#8220;:(){};&#8221;. Now in the function you will call the function itself recursively and send the output again to itself &#8220;:|:&#8221;. The &#8220;&amp;&#8221; runs the function in the background. Now the fork bomb is done and you only need to call it with &#8220;:&#8221; at the end.</p>
<h2>Live demonstration</h2>
<p>For a live demonstration I have found a YouTube video:<br />
<iframe title="Linux Fork Bomb &quot;Virus&quot;" width="500" height="281" src="https://www.youtube.com/embed/Q9Mdy7H8Qmc?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<h2>How to prevent it</h2>
<p>Preventing it is quite simple. You need to modify the system resources limits. Login to the server via SSH or open a new terminal window and edit the limits.conf file as root:</p>
<pre><code class="eckosc eckosc_syntax_theme_dark" data-language="shell">sudo vi /etc/security/limits.conf</code></pre>
<p>Set a limit for the processes number for a specific user or a group:</p>
<pre><code class="eckosc eckosc_syntax_theme_dark" data-language="shell">username hard nproc 100<br />
@groupname hard nproc 100</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://costigator.com/development/programming-languages/linux-fork-bomb-and-how-to-prevent-it/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
