<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Parsa Roshani</title>
    <description>The latest articles on DEV Community by Parsa Roshani (@parsaroshani).</description>
    <link>https://dev.to/parsaroshani</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3314108%2Fd5884098-f095-4e45-a2fe-caa281af5961.jpeg</url>
      <title>DEV Community: Parsa Roshani</title>
      <link>https://dev.to/parsaroshani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/parsaroshani"/>
    <language>en</language>
    <item>
      <title>Setting Up iTerm2, Zsh, Oh My Zsh, Starship Theme, Fonts, and Plugins on macOS</title>
      <dc:creator>Parsa Roshani</dc:creator>
      <pubDate>Wed, 02 Jul 2025 12:37:41 +0000</pubDate>
      <link>https://dev.to/parsaroshani/setting-up-iterm2-zsh-oh-my-zsh-starship-theme-fonts-and-plugins-on-macos-2h4e</link>
      <guid>https://dev.to/parsaroshani/setting-up-iterm2-zsh-oh-my-zsh-starship-theme-fonts-and-plugins-on-macos-2h4e</guid>
      <description>&lt;h2&gt;
  
  
  Having a powerful and aesthetically pleasing terminal environment can significantly improve your productivity as a developer. In this post, I will walk you through setting up &lt;strong&gt;iTerm2&lt;/strong&gt;, &lt;strong&gt;Zsh&lt;/strong&gt;, &lt;strong&gt;Oh My Zsh&lt;/strong&gt;, &lt;strong&gt;Starship Theme&lt;/strong&gt;, &lt;strong&gt;custom fonts&lt;/strong&gt;, and essential plugins like &lt;strong&gt;autosuggestions&lt;/strong&gt;, &lt;strong&gt;syntax highlighting&lt;/strong&gt;, and &lt;strong&gt;git&lt;/strong&gt;.
&lt;/h2&gt;




&lt;h3&gt;
  
  
  Step 1: Install iTerm2
&lt;/h3&gt;

&lt;p&gt;iTerm2 is a feature-rich terminal emulator for macOS.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download iTerm2 from &lt;a href="https://iterm2.com/" rel="noopener noreferrer"&gt;iterm2.com&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Install it by dragging the app to your Applications folder.&lt;/li&gt;
&lt;li&gt;Open iTerm2 and set it as your default terminal:

&lt;ul&gt;
&lt;li&gt;Go to &lt;code&gt;Preferences &amp;gt; Profiles &amp;gt; General&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set "Command" to &lt;code&gt;/bin/zsh&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Step 2: Install Zsh
&lt;/h3&gt;

&lt;p&gt;Zsh is a powerful shell with many features beyond Bash.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Terminal (or iTerm2).&lt;/li&gt;
&lt;li&gt;Install Zsh using Homebrew:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   brew &lt;span class="nb"&gt;install &lt;/span&gt;zsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Make Zsh your default shell:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   chsh &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;which zsh&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 3: Install Oh My Zsh
&lt;/h3&gt;

&lt;p&gt;Oh My Zsh is a framework for managing Zsh configuration.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Oh My Zsh with the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 4: Install Starship Theme
&lt;/h3&gt;

&lt;p&gt;Starship is a cross-shell prompt written in Rust.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Starship:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   brew &lt;span class="nb"&gt;install &lt;/span&gt;starship
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Edit your Zsh configuration file (&lt;code&gt;~/.zshrc&lt;/code&gt;) to use Starship:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'eval "$(starship init zsh)"'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Restart your terminal to see the changes.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Step 5: Install Fonts
&lt;/h3&gt;

&lt;p&gt;For a better terminal experience, you need fonts that support &lt;strong&gt;powerline&lt;/strong&gt; and icons.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download fonts from &lt;a href="https://www.nerdfonts.com/" rel="noopener noreferrer"&gt;Nerd Fonts&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Install a font like &lt;strong&gt;Fira Code Nerd Font&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Double-click the downloaded &lt;code&gt;.ttf&lt;/code&gt; file to install it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Set the font in iTerm2:

&lt;ul&gt;
&lt;li&gt;Go to &lt;code&gt;Preferences &amp;gt; Profiles &amp;gt; Text&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Select your installed Nerd Font.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Step 6: Install Essential Plugins
&lt;/h3&gt;

&lt;p&gt;You can enhance your productivity with plugins like &lt;strong&gt;autosuggestions&lt;/strong&gt;, &lt;strong&gt;syntax highlighting&lt;/strong&gt;, and &lt;strong&gt;git&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Autosuggestions Plugin
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Install the plugin:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git clone https://github.com/zsh-users/zsh-autosuggestions &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ZSH_CUSTOM&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="p"&gt;~/.oh-my-zsh/custom&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/plugins/zsh-autosuggestions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Enable the plugin in your &lt;code&gt;~/.zshrc&lt;/code&gt; file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;plugins&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;zsh-autosuggestions&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Syntax Highlighting Plugin
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Install the plugin:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git clone https://github.com/zsh-users/zsh-syntax-highlighting.git &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ZSH_CUSTOM&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="p"&gt;~/.oh-my-zsh/custom&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/plugins/zsh-syntax-highlighting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Enable the plugin in your &lt;code&gt;~/.zshrc&lt;/code&gt; file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;plugins&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;zsh-syntax-highlighting&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Ensure this line comes &lt;strong&gt;last&lt;/strong&gt; in your &lt;code&gt;.zshrc&lt;/code&gt; file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ZSH_CUSTOM&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="p"&gt;~/.oh-my-zsh/custom&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Git Plugin
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Git is included with Oh My Zsh, but you need to enable it:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;plugins&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;git&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Other Useful Plugins
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;zsh-completions&lt;/strong&gt;: Additional completion definitions for Zsh.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   brew &lt;span class="nb"&gt;install &lt;/span&gt;zsh-completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;zsh-history-substring-search&lt;/strong&gt;: Search your command history with substrings.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git clone https://github.com/zsh-users/zsh-history-substring-search &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ZSH_CUSTOM&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="p"&gt;~/.oh-my-zsh/custom&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/plugins/zsh-history-substring-search
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 7: Apply Changes
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Restart your terminal or reload the Zsh configuration:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;source&lt;/span&gt; ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 8: Customize Starship
&lt;/h3&gt;

&lt;p&gt;You can customize your Starship prompt by creating a configuration file.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the file &lt;code&gt;~/.config/starship.toml&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.config &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;touch&lt;/span&gt; ~/.config/starship.toml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add the following to &lt;code&gt;~/.config/starship.toml&lt;/code&gt; for a minimal look:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;   &lt;span class="nn"&gt;[character]&lt;/span&gt;
   &lt;span class="py"&gt;success_symbol&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"[✔️](bold green)"&lt;/span&gt;
   &lt;span class="py"&gt;error_symbol&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"[✘](bold red)"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;With iTerm2, Zsh, Oh My Zsh, Starship, and plugins installed, your terminal is now optimized for productivity and aesthetics. Feel free to explore additional plugins and themes to suit your workflow.&lt;/p&gt;




</description>
      <category>ohmyzsh</category>
      <category>macos</category>
      <category>starship</category>
      <category>iterm</category>
    </item>
    <item>
      <title>How to Install PHP, MariaDB, and phpMyAdmin on macOS</title>
      <dc:creator>Parsa Roshani</dc:creator>
      <pubDate>Wed, 02 Jul 2025 12:21:27 +0000</pubDate>
      <link>https://dev.to/parsaroshani/how-to-install-php-mariadb-and-phpmyadmin-on-macos-e92</link>
      <guid>https://dev.to/parsaroshani/how-to-install-php-mariadb-and-phpmyadmin-on-macos-e92</guid>
      <description>&lt;h2&gt;
  
  
  Setting up a local development environment on macOS can be quite straightforward. In this tutorial, we’ll walk through the steps to install PHP, MariaDB, and phpMyAdmin.
&lt;/h2&gt;




&lt;h3&gt;
  
  
  Step 1: Install Homebrew
&lt;/h3&gt;

&lt;p&gt;Homebrew is a package manager for macOS that simplifies the installation of software.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Terminal.&lt;/li&gt;
&lt;li&gt;Run the following command to install Homebrew:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   /bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;After installation, update Homebrew:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   brew update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 2: Install PHP
&lt;/h3&gt;

&lt;p&gt;Once Homebrew is installed, you can easily install PHP.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   brew &lt;span class="nb"&gt;install &lt;/span&gt;php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Verify the PHP installation:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   php &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 3: Install MariaDB
&lt;/h3&gt;

&lt;p&gt;MariaDB is a popular database server used as an alternative to MySQL.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install MariaDB:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   brew &lt;span class="nb"&gt;install &lt;/span&gt;mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start the MariaDB service:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   brew services start mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Secure your MariaDB installation:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 4: Install phpMyAdmin
&lt;/h3&gt;

&lt;p&gt;phpMyAdmin is a web interface for managing databases.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install phpMyAdmin:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   brew &lt;span class="nb"&gt;install &lt;/span&gt;phpmyadmin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Configure Apache (or another web server) to serve phpMyAdmin:

&lt;ul&gt;
&lt;li&gt;Locate the phpMyAdmin directory, typically &lt;code&gt;/usr/local/share/phpmyadmin&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add a virtual host configuration in Apache to point to this directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Restart your web server:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apachectl restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 5: Verify Setup
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open your browser and navigate to &lt;code&gt;http://localhost/phpmyadmin&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Log in with your MariaDB credentials.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Congratulations! You have successfully installed PHP, MariaDB, and phpMyAdmin on your macOS system. You can now start developing PHP applications locally.&lt;/p&gt;

</description>
      <category>localhost</category>
      <category>php</category>
      <category>mariadb</category>
      <category>phpmyadmin</category>
    </item>
    <item>
      <title>How to Generate an SSH Key on macOS for Accessing a VPS Ubuntu</title>
      <dc:creator>Parsa Roshani</dc:creator>
      <pubDate>Wed, 02 Jul 2025 07:49:22 +0000</pubDate>
      <link>https://dev.to/parsaroshani/how-to-generate-an-ssh-key-on-macos-for-accessing-a-vps-ubuntu-41ce</link>
      <guid>https://dev.to/parsaroshani/how-to-generate-an-ssh-key-on-macos-for-accessing-a-vps-ubuntu-41ce</guid>
      <description>&lt;h3&gt;
  
  
  Step 1: Generate an SSH Key
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open the Terminal on your macOS.&lt;/li&gt;
&lt;li&gt;Run the following command to generate a new SSH key:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; rsa &lt;span class="nt"&gt;-b&lt;/span&gt; 4096 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-t rsa&lt;/code&gt;: Specifies the type of key (RSA).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-b 4096&lt;/code&gt;: Defines the key size (4096 bits).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-C "your_email@example.com"&lt;/code&gt;: Adds a comment to the key (usually your email).

&lt;ol&gt;
&lt;li&gt;When prompted, specify the file name for the key. Press Enter to use the default path.&lt;/li&gt;
&lt;li&gt;You can add a passphrase to the key for extra security or leave it blank by pressing Enter.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Step 2: View the Public Key
&lt;/h3&gt;

&lt;p&gt;Your public SSH key is stored at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/.ssh/id_rsa.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To view the public key, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.ssh/id_rsa.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the public key.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 3: Add the Public Key to Your VPS
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Connect to your VPS manually using a password:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   ssh username@server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;On the VPS, open or create the &lt;code&gt;authorized_keys&lt;/code&gt; file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.ssh
   nano ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Paste the public key you copied into the file.&lt;/li&gt;
&lt;li&gt;Save and exit the editor.&lt;/li&gt;
&lt;li&gt;Set the appropriate permissions for the file and directory:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;chmod &lt;/span&gt;600 ~/.ssh/authorized_keys
   &lt;span class="nb"&gt;chmod &lt;/span&gt;700 ~/.ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 4: Test Password-Free Access
&lt;/h3&gt;

&lt;p&gt;On your macOS, test the SSH connection without a password:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh username@server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 5: Optional Configuration
&lt;/h3&gt;

&lt;p&gt;To simplify SSH access, you can configure the &lt;code&gt;~/.ssh/config&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host my-vps
    HostName server_ip
    User username
    IdentityFile ~/.ssh/id_rsa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can connect using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh my-vps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;By following these steps, you can securely and conveniently access your VPS without needing to enter a password every time. This method enhances both security and efficiency in server management.&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>ubuntu</category>
      <category>vps</category>
      <category>accessing</category>
    </item>
  </channel>
</rss>
