<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rasulov Kanan on Medium]]></title>
        <description><![CDATA[Stories by Rasulov Kanan on Medium]]></description>
        <link>https://medium.com/@kananrasulov005?source=rss-bc8134451133------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*V_AuQurn2l0rHDFx</url>
            <title>Stories by Rasulov Kanan on Medium</title>
            <link>https://medium.com/@kananrasulov005?source=rss-bc8134451133------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 01:42:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kananrasulov005/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Installing and Using Zabbix on UBUNTU]]></title>
            <link>https://medium.com/@kananrasulov005/installing-and-using-zabbix-on-ubuntu-7a005cf99606?source=rss-bc8134451133------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a005cf99606</guid>
            <dc:creator><![CDATA[Rasulov Kanan]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 06:41:10 GMT</pubDate>
            <atom:updated>2023-11-14T06:41:10.146Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Installing and Using Zabbix on UBUNTU</strong></p><p>Before installing Zabbix on UBUNTU let’s update ubuntu machine:</p><p><strong>sudo apt update</strong></p><p>If you have error like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOAxrPj-6zfTqtiLue40bQ.png" /></figure><p>Go to <strong>software and updates</strong> application and select all boxes and define server as<strong> main server</strong>. After doing this ubuntu will can find files to update itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*j9_jNxS99dojFz8tsuichQ.png" /></figure><p>Click Close and then Reload. Now try again command : <strong>sudo apt update</strong></p><p>For installing zabbix you must have :</p><p><strong>MySQL database</strong></p><p><strong>Web server Apache</strong></p><p><strong>PHP must be installed</strong></p><p>For installing and starting mysql server run:</p><p><strong>sudo apt install mysql-server</strong></p><p><strong>sudo systemctl start mysql</strong></p><p><strong>sudo systemctl enable mysql</strong></p><p>For install apache2 server run this command:</p><p><strong>sudo apt install apache2</strong></p><p>For install PHP write this command to terminal:</p><p><strong>sudo apt install php php-{cgi,common,mbstring,net-socket,gd,xml-util,mysql,bcmath,imap,snmp}</strong></p><p><strong>sudo apt install libapache2-mod-php</strong></p><p>Now install zabbix. Go to link <a href="https://www.zabbix.com/ru/download?zabbix=6.0&amp;os_distribution=ubuntu&amp;os_version=22.04&amp;components=server_frontend_agent&amp;db=mysql&amp;ws=apache">https://www.zabbix.com/ru/download?zabbix=6.0&amp;os_distribution=ubuntu&amp;os_version=22.04&amp;components=server_frontend_agent&amp;db=mysql&amp;ws=apache</a> select this options then you will see commands for install zabbix at below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AR4DmWxudh2nMfENCv-nYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MsH1Hxdx00nptN4ZRNFf_w.png" /></figure><p>Let’s run these commands:</p><p>Install zabbix repository:</p><p><strong>wget </strong><a href="https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu22.04_all.deb"><strong>https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu22.04_all.deb</strong></a></p><p><strong>sudo dpkg -i zabbix-release_6.0–4+ubuntu22.04_all.deb</strong></p><p><strong>sudo apt update</strong></p><p>Install zabbix server:</p><p><strong>sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent</strong></p><p>Now connect to mysql server. Run this command enter your password and then enter querries below:</p><p><strong>Sudo mysql -u root -p</strong> then enter password</p><p>Write querries one by one:</p><p><strong>create database zabbix character set utf8mb4 collate utf8mb4_bin;</strong></p><p><strong>create user zabbix@localhost identified by ‘Admin#123’;</strong></p><p><strong>grant all privileges on zabbix.* to zabbix@localhost;</strong></p><p><strong>set global log_bin_trust_function_creators = 1;</strong></p><p><strong>quit;</strong></p><p>Now run command:</p><p><strong>zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql — default-character-set=utf8mb4 -uzabbix -p zabbix</strong></p><p>Then enter password “Admin”. It will take time.</p><p>Now go to mysql again and disable<strong> log_bin_trust_function_creators</strong> with this command:</p><p><strong>Sudo mysql -u root -p </strong>then enter your password</p><p>Querry:</p><p><strong>set global log_bin_trust_function_creators = 0;</strong></p><p><strong>quit;</strong></p><p>Configure database for zabbix server:</p><p><strong>sudo gedit /etc/zabbix/zabbix_server.conf</strong></p><p>Then find DBPassword line and define password as “<strong>Admin#123</strong>”</p><p>Start Zabbix server and agent processes by running these commands:</p><p><strong>systemctl restart zabbix-server zabbix-agent apache2</strong></p><p><strong>systemctl enable zabbix-server zabbix-agent apache2</strong></p><p>After doing these we can enter the zabbix site <a href="http://hostname/zabbix">http://hostname/zabbix</a> . You can learn your hostname by running this command:</p><p><strong>hostname</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xkjgl46amFvDKm97KArrqQ.png" /></figure><p>After entering site click on <strong>Next Step</strong> twice till reach this page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLU5BTJLGTV57rN3kiraGA.png" /></figure><p>Write password to Password input place “<strong>Admin#123</strong>” then click next.</p><p>Here define zabbix servername as “<strong>ub2202</strong>” and then click next twice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*0Sp_JPO5fT7Y7J4jgR0New.png" /></figure><p>We successfully installed Zabbix frontend. Let’s log in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*PRHu7oN6ACIqM8He0wO-Mw.png" /></figure><p>Click Finish. Now you see login page. Enter credentials username “<strong>Admin</strong>” , password “<strong>zabbix</strong>” and click <strong>Sign in</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*aD5aLF6KDnRt_uiCdAvDgg.png" /></figure><p>Now our next challenge is configuration zabbix that when internet connection is disconnect it sends mail to us.</p><p>For this we have to install sSMTP. For install it run these commands:</p><p><strong>sudo apt-get install ssmtp</strong></p><p><strong>sudo nano /etc/ssmtp/ssmtp.conf</strong></p><p>Then configure and add these lines at file:</p><p><strong>root=&lt;your_mail&gt;</strong></p><p><strong>mailhub=smtp.gmail.com:587</strong></p><p><strong>hostname=&lt;your_hostname&gt;</strong></p><p><strong>FromLineOverride=YES</strong></p><p><strong>AuthUser=&lt;your_gmail&gt;</strong></p><p><strong>AuthPass=&lt;app_passwor&gt;</strong> I will show how you can get it.</p><p><strong>UseTLS=YES</strong></p><p><strong>UseSTARTTLS=YES</strong></p><p>For getting app password go to<strong> Manage your google account</strong> then click<strong> security section</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MB5Xq2XYCQd8hVitvyKARg.png" /></figure><p>After entering to security section click 2-step Verification. It will require backup method with security keys. Select one of them and complete process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OoEWemw9xoh93h1Q3402JA.png" /></figure><p>In this page scroll down you will see app passwords, click on it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*6GKffFzkF6ofPhfypqdNuA.png" /></figure><p>Here write App name as “<strong>Zabbix</strong>” then click generate. You will see password consisting of 16 letter it is your app password.</p><p>Now go to zabbix again. For sending email to our gmail click on user then profile. Then click on media.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0XXf0LJKAsbo6p7OVG2Uzw.png" /></figure><p>In this page click on add and then define settings like this. Write your gmail instead of mine then click update;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*c1CyEufpZ2SizK9d8bN74A.png" /></figure><p>Now go to Media types for define our settings to zabbix that how will it send mail to us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/179/1*h5TDkbbO0rRtj5LYX6s_tQ.png" /></figure><p>In this page you will see email as Disable for making it enable click on red <strong>Disabled</strong> word. Then for adding information about our mail click on Blue <strong>Email</strong> word.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3dYbjaXD-D16eBp1nTZyDg.png" /></figure><p>In this page write your gmail instead of “<a href="/service/mailto:kananrasulov005@gmail.com">kananrasulov005@gmail.com</a>” and write your ip address instead of “192.168.1.72”. At the password field write <strong>app password</strong>. Other information is same. Then click update.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dd5-OQ62cMhRPcRle8aTfA.png" /></figure><p>Now you can check email by clicking blue Test word in front of enabled Email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sz1fERpqgfyzCog_Yw514A.png" /></figure><p>Write your administrator gmail here and click test. Sending email is successful. Let’s check our gmail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*OQvfOhVuRoUj6uSq0LJ54A.png" /></figure><p>We can see that gmail was sent successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h9rZlxCKqy-GhAMrFVSUsQ.png" /></figure><p>Now we want zabbix to send mail to our email when internet is down for this we have to add ICMP teplate to host. For doing this go to this section:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/177/1*MJWzXExr6-H4TUWGe1CyFA.png" /></figure><p>Then select your host. After entering here add template by writing ICMP to template place:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*46zN44DheZ1l18Ht08ihNw.png" /></figure><p>It says “no matches found” because I have already added it. You will click ICMP after write ICMP then click Update button below.</p><p>Now Zabbix have to send email to us when internet connection is down. Let’s check it.</p><p>For this make internet connection down and try to send ping to “8.8.8.8” buy running these commands.</p><p><strong>sudo nmcli networking off</strong></p><p><strong>ping 8.8.8.8</strong></p><p>You will see error like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*p-QaBYPzpEJYkXpYYHR0dA.png" /></figure><p>Now up internet connection again by running this: <strong>sudo nmcli networking up</strong></p><p>Let’s check our gmail</p><p>Mails that was sent by zabbix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*P0qjQS3SC02dZBuoLTX_uA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a005cf99606" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Ganglia on UBUNTU for monitoring]]></title>
            <link>https://medium.com/@kananrasulov005/installing-ganglia-on-ubuntu-for-monitoring-877083d45b1d?source=rss-bc8134451133------2</link>
            <guid isPermaLink="false">https://medium.com/p/877083d45b1d</guid>
            <dc:creator><![CDATA[Rasulov Kanan]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 06:29:21 GMT</pubDate>
            <atom:updated>2023-11-14T06:29:21.677Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Installing Ganglia on UBUNTU for monitoring</strong></p><p>Firstly make sure that both UBUNTU are updated. Run this command:</p><p><strong>sudo apt update</strong></p><p>If you have error like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vr-vl192tUzlPjZeOosG5w.png" /></figure><p>Go to <strong>software and updates</strong> application and select all boxes and define server as<strong> main server</strong>. After doing this ubuntu will can find files to update itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*j9_jNxS99dojFz8tsuichQ.png" /></figure><p>Click Close and then Reload. Now try again command : <strong>sudo apt update</strong></p><p>We need apache server for open ganglia on it. For install it run this command:</p><p><strong>sudo apt-get install apache2</strong></p><p>After installing apache start server by running this command:</p><p><strong>sudo systemctl start apache2.service</strong></p><p><strong>sudo systemctl enable apache2.service</strong></p><p>Now we need some php modules and properties. Let’s install them. Run these command:</p><p><strong>sudo apt-get install software-properties-common</strong></p><p><strong>sudo add-apt-repository ppa:ondrej/php</strong></p><p>After run these update system with command: <strong>sudo apt update</strong> and then continue</p><p><strong>sudo apt-get install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-gmp php7.2-curl</strong></p><p><strong>sudo apt-get install php7.2-intl php7.2-mbstring php7.2-xmlrpc php7.2-mysql php7.2-gd</strong></p><p><strong>sudo apt-get install php7.2-xml php7.2-cli php7.2-zip</strong></p><p>Now we have to edit php file. For doing this I will use gedit tool if you don’t have you can install it by running this command:<strong> sudo apt install gedit</strong></p><p>After install gedit go to php file and add these lines to file:</p><p><strong>sudo gedit /etc/php/7.2/apache2/php.ini</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/1*MScRXLxSBeAjk_9dOwr9gQ.png" /></figure><p>Then save file by clicking save at the top of page then close window.</p><p>At the end restart apache server with this comman:</p><p><strong>sudo systemctl restart apache2.service</strong></p><p>At the next step we have to install ganglia. As always let’s update machine then start:</p><p><strong>sudo apt update</strong></p><p><strong>sudo apt-get install ganglia-monitor rrdtool gmetad ganglia-webfrontend</strong></p><p>Then start ganglia service:</p><p><strong>sudo systemctl start ganglia-monitor.service</strong></p><p><strong>sudo systemctl enable ganglia-monitor.service</strong></p><p>You can check status of ganglia service to be sure that it is active by running this command:</p><p><strong>sudo systemctl status ganglia-monitor.service</strong></p><p>Now we have to define name and localhost in gmond.conf file. Run command:</p><p><strong>sudo gedit /etc/ganglia/gmond.conf</strong></p><p>Then define name as “<strong>my cluster</strong>” and mcast_join as “<strong>localhost</strong>” as image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*bOoQC-C9bgmKt8DKm-A_JQ.png" /></figure><p>Then save changes and close window.</p><p>Now copy configuration file:</p><p><strong>sudo cp /etc/ganglia-webfrontend/apache.conf /etc/apache2/sites-enabled/ganglia.conf</strong></p><p>At the end restart all services:</p><p><strong>sudo systemctl restart ganglia-monitor</strong></p><p><strong>sudo systemctl restart gmetad</strong></p><p><strong>sudo systemctl restart apache2</strong></p><p>Finally we can monitor our ubuntu on this site <a href="http://localhost/ganglia">http://localhost/ganglia</a> .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hYN-griyhTSN8QbR6rXpBw.png" /></figure><p>Our next task monitor also another ubuntu on this site For this we have to install ganglia as client account on other ubuntu.</p><p>Firstly instally ganglia by running command:</p><p><strong>sudo apt update </strong>it is normally for us</p><p><strong>sudo apt-get install ganglia-monitor</strong></p><p>Then go to gmond.conf file by running “<strong>sudo gedit /etc/ganglia/gmond.conf</strong>” and delete mcast_join write host instead of it and define its value as “<strong>ganglia-localhost</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*kGllf65fGJtnVSoIg2mDfg.png" /></figure><p>Save changes and close app.</p><p>Now start service again by using these commands:</p><p><strong>sudo systemctl restart ganglia-monitor.service</strong></p><p><strong>sudo systemctl start ganglia-monitor.service</strong></p><p>Now we can monitor two ubuntu on the site in first ubuntu <a href="http://localhost/ganglia">http://localhost/ganglia</a> .</p><p>Here we choose node then look its situation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xewO7hpiYAU2S4c4UH094Q.png" /></figure><p>Here is information about second ubuntu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bGv0H8I9YIJiQDTsLdNXVA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=877083d45b1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install and using Git on UBUNTU]]></title>
            <link>https://medium.com/@kananrasulov005/install-and-using-git-on-ubuntu-084644a9230f?source=rss-bc8134451133------2</link>
            <guid isPermaLink="false">https://medium.com/p/084644a9230f</guid>
            <dc:creator><![CDATA[Rasulov Kanan]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 06:24:07 GMT</pubDate>
            <atom:updated>2023-11-14T06:24:07.564Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Installing GIT on UBUNTU</strong></p><p>Let’s start to install GIT. For this open terminal and update system with command:</p><p><strong>sudo apt update</strong></p><p>If you have error like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOAxrPj-6zfTqtiLue40bQ.png" /></figure><p>Go to <strong>software and updates</strong> application and select all boxes and define server as<strong> main server</strong>. After doing this ubuntu will can find files to update itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*j9_jNxS99dojFz8tsuichQ.png" /></figure><p>Click Close and then Reload. Now try again command : <strong>sudo apt update</strong></p><p>Then for install git run this command:</p><p><strong>sudo apt install git</strong></p><p>For looking git version you can run command: <strong>git — version</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*nLnZNBt9W_TV-DivhboSdw.png" /></figure><p>It means that git already installed to our ubuntu.</p><p>Now we have to configure our username and email etc. to git. For doing this you have to run this command:</p><p><strong>git config — global user.name “&lt;your_username&gt;”</strong></p><p><strong>git config — global user.email “&lt;your_email&gt;”</strong></p><p>Then for see global config run:</p><p><strong>git config — list</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*TvXkk0ZoLZJ6lTjnRDGDJA.png" /></figure><p>Get installation is successfully.</p><p>Now let’s integrate our git account with GitHub to push and pull a repository from git and to git.</p><p>For this go to link <a href="https://github.com/">https://github.com</a> on firefox and log in. if you don’t have account you can create new account.</p><p>After log in successfully you can add new repository clicking + icon at the top-right:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PvOrRe2-WOiy286K5195yQ.png" /></figure><p>Then define your repository name Description. Then click checkbox for create default README file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKgVrNlI9NNG2cZoJK2r0g.png" /></figure><p>Then click create repository button at the bottom.</p><p>After doing these I can see test repository in my account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ryahbw3c-kwBpdz4D6AL3Q.png" /></figure><p>Now let’s create directory for clone repository from github.</p><p><strong>mkdir workspace</strong></p><p>Then copy your project code from github:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vbSp71wNjs7ha7RUMjcd_g.png" /></figure><p>After copy HTTPS url enter to workspace directory with command “<strong>cd workspace</strong>” and run this command:</p><p><strong>git clone </strong><a href="https://github.com/kananrasulov/test.git"><strong>https://github.com/kananrasulov/test.git</strong></a></p><p>Cloning is successful. We can see files which is in repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*TheNr7QwtryQMfqgdkXeFA.png" /></figure><p>Now Let’s create new file in test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*qWIkck7sqeatFiruSbdYmw.png" /></figure><p>Write simple script to inside of file:</p><p><strong>gedit kanan.py</strong></p><p>If you don’t have gedit editor you can install it with running this command:</p><p><strong>sudo apt install gedit</strong></p><p>I wrote simple script that calculates factorial of a number:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*0aw9BhfXexDhxmym4b12Wg.png" /></figure><p>Then save and exit.</p><p>For seeing status of git run command: <strong>git status</strong>. We can see that kanan.py file is untracked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*iCvQ7rRdLuF8ww3eDD63Ag.png" /></figure><p>Let’s add kanan.py to git. For add it to your git run command:</p><p><strong>git add kanan.py</strong></p><p>After add kanan.py file check git status. So we see that kanan.py file is ready to be commited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*phOv-cb5zH_NGM8YfzUwAg.png" /></figure><p>Now we have to commit this file to git. To do this run command:</p><p><strong>git commit -m “python code”</strong></p><p>Look git status again and you will see that there is nothing to be committed. It means that now we can push it to our GitHub. For doing this run command:</p><p><strong>git push origin main</strong></p><p>Here main is branches name . You can see it from here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*xT5AlTTCk9osTpXT-l2-ww.png" /></figure><p>When I run command above it gives error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8k0579t_QF-bt8lQloEkxA.png" /></figure><p>It says support for password authentication was removed on August 13.</p><p>For fixing error we have to create token on our GitHub account.</p><p>Go to GitHub site click on your profile photo and got to settings.</p><p>Then go to bottom and click <strong>developer settings</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*mStwCLgFr1cI-UWnHtyiew.png" /></figure><p>Then click on <strong>personal access tokens</strong> then click <strong>Tokens (classic)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*mTj365JlSiqXKH_zVDML0A.png" /></figure><p>Now click <strong>generate new token</strong> then click <strong>Generate new token (classic)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*lJvlvC1DOBHG-q55wLhR0g.png" /></figure><p>In this page write note for token define expiration date and select all boxes. At the end click green <strong>Generate token</strong> button at the bottom of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_5Y4epQLk8NqwiDtvHGYQ.png" /></figure><p>Now we have token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*DVvuoTIvqWi42u43YA8Kzg.png" /></figure><p>Now can push kanan.py file by using this token. For this run this command:</p><p><strong>git remote set-url origin </strong><a href="https://%3cyour_token%3e@github.com/%3cyour_username%3e/%3crepository%3e"><strong>https://&lt;your_token&gt;@github.com/&lt;your_username&gt;/&lt;repository&gt;</strong></a><strong> git push origin main</strong></p><p>Pushing process is successfully because Now I can see kanan.py file in my GitHub repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H82L4KpbgI7JB_-g8Pj8Uw.png" /></figure><p><strong>Mission completed.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=084644a9230f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing FTP server on UBUNTU]]></title>
            <link>https://medium.com/@kananrasulov005/installing-ftp-server-on-ubuntu-db8318d5507a?source=rss-bc8134451133------2</link>
            <guid isPermaLink="false">https://medium.com/p/db8318d5507a</guid>
            <dc:creator><![CDATA[Rasulov Kanan]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 06:11:49 GMT</pubDate>
            <atom:updated>2023-11-14T06:11:49.335Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Installing FTP server on UBUNTU</strong></p><p>Before start doing task let’s update our ubuntu to be sure that everything is updated.</p><p><strong>sudo apt update</strong></p><p>If you have error like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOAxrPj-6zfTqtiLue40bQ.png" /></figure><p>Go to <strong>software and updates</strong> application and select all boxes and define server as<strong> main server</strong>. After doing this ubuntu will can find files to update itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*j9_jNxS99dojFz8tsuichQ.png" /></figure><p>Click Close and then Reload. Now try again command : <strong>sudo apt update</strong></p><p>For installing FTP server run this command:</p><p><strong>sudo apt install vsftpd</strong></p><p>After installing FTP server let’s see its status with command:</p><p><strong>sudo service vsftpd status</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qH3hzazQmKIalAMHjOERjg.png" /></figure><p>I can see that FTP service is running now let’s configure it. Run this command.</p><p><strong>sudo nano /etc/vsftpd.conf</strong></p><p>Enable <strong>write_enable=YES</strong> line by deleting<strong> #</strong> symbol. It will enable file upload to FTP server.</p><p>For enhaces security of FTP server by restrict local users to their home directories find and enable this line:</p><p><strong>chroot_local_user=YES</strong></p><p>After doing these go to bottom of the file and add these lines:</p><p><strong>user_subtoken=$USER</strong></p><p><strong>local_root=/home/$USER</strong></p><p>With these two lines above you can ensure that when a user log in the FTP server routes to the directory that is meant to be accessed by user.</p><p><strong>pasv_min_port=10000</strong></p><p><strong>pasv_max_port=10100</strong></p><p>With these two lines above you can use ports above if there is firewall issue between client and server and ports 20 and 21 can’t be accessed.</p><p>Save file and exit:<strong> Ctrl+S</strong> then <strong>Ctrl+X</strong></p><p>Now we have to configure ports. For this write this command to terminal:</p><p><strong>sudo ufw allow from any to any port 20,21,10000:10100 proto tcp</strong></p><p>After doing this ports are open and ready to accept trafic.</p><p>Let’s now create a user who will have FTP access on the machine. They will access a specific folder under their home directory. For this run this command and define user credentials.</p><p><strong>sudo adduser &lt;new_user&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*kshYcRyGhAYJz9DzuHy9-A.png" /></figure><p>Now we have to create ftp folder for new user.</p><p><strong>sudo mkdir /home/rasulov/ftp</strong></p><p>Then run this command and configure ownership:</p><p><strong>sudo chown nobody:nogroup /home/rasulov/ftp</strong></p><p>Remove root FTP folder writable permission by running this command :</p><p><strong>sudo chmod a-w /home/rasulov/ftp</strong></p><p>Now create opload directory for new user:</p><p><strong>sudo mkdir /home/rasulov/ftp/upload</strong></p><p>Create Upload folder ownership for new user:</p><p><strong>sudo chown rasulov:rasulov /home/rasulov/ftp/upload</strong></p><p>Now let’s create demo file inside the upload folder:</p><p><strong>echo “My FTP Server” | sudo tee /home/rasulov/ftp/upload/demo.txt</strong></p><p>Let’s check if the demo file has been created from the folder itself:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*IR2bVUEusB8QT4pP9oMLSQ.png" /></figure><p>Click Other Locations and then Computer.</p><p>Then move to path <strong>/home/rasulov/ftp/upload</strong>. I can see that demo.txt file is exist in folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*QKkWFBfEB1uEcmEfZGYcWA.png" /></figure><p>You can check permissions for FTP by running this command:</p><p><strong>sudo ls -la /home/rasulov/ftp</strong></p><p>There is also summary of some command in this picture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*7at-iY7R8X4kt2bfQUB6dw.png" /></figure><p>Add the created user to the FTP user list file so that it allows the user to log in and access the FTP server:</p><p><strong>echo “rasulov” | sudo tee -a /etc/vsftpd.userlist</strong></p><p>Restart FTP server and apply changes:</p><p><strong>sudo systemctl restart vsftpd</strong></p><p>Now go to configure file and add this line for making sure the FTP server only allow access of users whao are in its local database and not anyone else.</p><p><strong>sudo nano /etc/vsftpd.conf</strong></p><p>Now go to bottom of file and add these lines:</p><p><strong>userlist_enable=YES</strong></p><p><strong>userlist_file=/etc/vsftpd.userlist</strong></p><p><strong>userlist_deny=NO</strong></p><p>Then save and exit: Ctrl+S then Ctrl+X</p><p>Now let’s try to connect ftp port from FileZilla.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*-gZOEAIQPC4E1hub0kyz9A.png" /></figure><p>Our Ip address id 192.168.1.64</p><p>For installing FileZilla go to link <a href="https://filezilla-project.org/download.php?type=client">https://filezilla-project.org/download.php?type=client</a> and click download FileZilla Client:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2mAZ0gYRO-o5OG1mY838zA.png" /></figure><p>After installing open application and write Host, Username and Password then click “Sürətli bağlan” then click “Yaxşı”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P21hex9x0GyWuerQ4rUtGw.png" /></figure><p>We can see upload folder now click it. Finally we can see demo.txt file. It means ftp connection is successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*t5JG3Wb3SuoX8iC_v6U-Xg.png" /></figure><p>Let’s now see how we can secure the connection</p><p>Configure SSL using openssl run this command:</p><p><strong>sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem</strong></p><p>After run this command define some credentials:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*earx3hm1Bh8YVwj1QSSJ_w.png" /></figure><p>Now go to ftp configuration file again and do these changes:</p><p><strong>sudo nano /etc/vsftp.conf</strong></p><p>Find private key and ssl lines and replace them with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*Zg_HcSCBg9kK0tg5M1PQ6w.png" /></figure><p>Then save changes and exit.</p><p>Open config file again and add these lines to bottom of the file. These will deny access to Anonymous connection over SSL and force users to transfer data and log in using SSL only:</p><p><strong>sudo nano /etc/vsftpd.conf</strong></p><p>Now add these lines:</p><p><strong>allow_anon_ssl=NO</strong></p><p><strong>force_local_data_ssl=YES</strong></p><p><strong>force_local_logins_ssl=YES</strong></p><p>Save changes and exit.</p><p>Restart FTP service to apply changes:</p><p><strong>sudo systemctl restart vsftpd</strong></p><p>Now try to connect again with FileZilla:</p><p>After enter credentials we can access the FTP server over TLS which is secure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdLIC2OKMTZP2RtaPSEeSQ.png" /></figure><p>We can see files with ftp connection securely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*Mjfk6LEWIEXyX6t5wcaKhA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db8318d5507a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>