{"id":163,"date":"2024-02-17T19:02:25","date_gmt":"2024-02-17T19:02:25","guid":{"rendered":"https:\/\/feellikelearning.com\/en\/?p=163"},"modified":"2024-02-17T19:02:25","modified_gmt":"2024-02-17T19:02:25","slug":"how-to-start-ssh-agent-on-ubuntu","status":"publish","type":"post","link":"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/","title":{"rendered":"How to start ssh-agent on Ubuntu"},"content":{"rendered":"\n<p>On Ubuntu, we can use this command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>eval $(ssh-agent -s)<\/code><\/pre>\n\n\n\n<p>It will output something like<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Agent pid 2499xxx<\/code><\/pre>\n\n\n\n<p>After this, we can use ssh-add<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-add &lt;path to the private key><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Explain &#8220;eval $(ssh-agent -s)&#8221;<\/h2>\n\n\n\n<p>The command <code>eval $(ssh-agent -s)<\/code> is a convenient way to start the SSH agent and set up the necessary environment variables in the current shell session. Here&#8217;s a breakdown of what each part of the command does:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code>ssh-agent -s<\/code><\/strong>: This command starts the SSH agent in the background and outputs shell commands to set up the environment variables that point to the newly created SSH agent. The <code>-s<\/code> option instructs <code>ssh-agent<\/code> to output commands suitable for use in a shell script.<\/li>\n\n\n\n<li><strong><code>$(...)<\/code><\/strong>: This is called command substitution. It allows the output of a command (<code>ssh-agent -s<\/code>) to be substituted in place as part of another command. Whatever is inside <code>$(...)<\/code> is executed, and its output is treated as if it were written directly into the command line.<\/li>\n\n\n\n<li><strong><code>eval<\/code><\/strong>: This is a shell built-in command that evaluates the arguments as a shell command. It basically causes the shell to re-parse and execute the command line generated by the command substitution <code>$(ssh-agent -s)<\/code>.<\/li>\n<\/ol>\n\n\n\n<p>So, when you run <code>eval $(ssh-agent -s)<\/code>, the <code>ssh-agent -s<\/code> command starts the SSH agent and outputs shell commands to set up the environment variables, and then <code>eval<\/code> evaluates and executes those commands in the current shell session. This effectively starts the SSH agent and sets up the environment variables so that subsequent SSH-related commands know how to communicate with the SSH agent.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On Ubuntu, we can use this command It will output something like After this, we can use ssh-add Explain &#8220;eval $(ssh-agent -s)&#8221; The command eval $(ssh-agent -s) is a convenient way to start the SSH agent and set up the necessary environment variables in the current shell session. Here&#8217;s a breakdown of what each part [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-163","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to start ssh-agent on Ubuntu - Feel Like Learning<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to start ssh-agent on Ubuntu - Feel Like Learning\" \/>\n<meta property=\"og:description\" content=\"On Ubuntu, we can use this command It will output something like After this, we can use ssh-add Explain &#8220;eval $(ssh-agent -s)&#8221; The command eval $(ssh-agent -s) is a convenient way to start the SSH agent and set up the necessary environment variables in the current shell session. Here&#8217;s a breakdown of what each part [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Feel Like Learning\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-17T19:02:25+00:00\" \/>\n<meta name=\"author\" content=\"feellikelearning\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"feellikelearning\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/\",\"url\":\"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/\",\"name\":\"How to start ssh-agent on Ubuntu - Feel Like Learning\",\"isPartOf\":{\"@id\":\"https:\/\/feellikelearning.com\/en\/#website\"},\"datePublished\":\"2024-02-17T19:02:25+00:00\",\"dateModified\":\"2024-02-17T19:02:25+00:00\",\"author\":{\"@id\":\"https:\/\/feellikelearning.com\/en\/#\/schema\/person\/1ec5aac313d6de20215fe2b8e176b8a7\"},\"breadcrumb\":{\"@id\":\"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/feellikelearning.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to start ssh-agent on Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/feellikelearning.com\/en\/#website\",\"url\":\"https:\/\/feellikelearning.com\/en\/\",\"name\":\"Feel Like Learning\",\"description\":\"keep curiosity alive\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/feellikelearning.com\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/feellikelearning.com\/en\/#\/schema\/person\/1ec5aac313d6de20215fe2b8e176b8a7\",\"name\":\"feellikelearning\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/feellikelearning.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/36aec9d519f02362e3e89b0716ae640d08701f57e818830f3f197db5fbc1ae20?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/36aec9d519f02362e3e89b0716ae640d08701f57e818830f3f197db5fbc1ae20?s=96&d=mm&r=g\",\"caption\":\"feellikelearning\"},\"sameAs\":[\"http:\/\/feellikelearning.com\/en\"],\"url\":\"https:\/\/feellikelearning.com\/en\/index.php\/author\/feellikelearning\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to start ssh-agent on Ubuntu - Feel Like Learning","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to start ssh-agent on Ubuntu - Feel Like Learning","og_description":"On Ubuntu, we can use this command It will output something like After this, we can use ssh-add Explain &#8220;eval $(ssh-agent -s)&#8221; The command eval $(ssh-agent -s) is a convenient way to start the SSH agent and set up the necessary environment variables in the current shell session. Here&#8217;s a breakdown of what each part [&hellip;]","og_url":"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/","og_site_name":"Feel Like Learning","article_published_time":"2024-02-17T19:02:25+00:00","author":"feellikelearning","twitter_card":"summary_large_image","twitter_misc":{"Written by":"feellikelearning","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/","url":"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/","name":"How to start ssh-agent on Ubuntu - Feel Like Learning","isPartOf":{"@id":"https:\/\/feellikelearning.com\/en\/#website"},"datePublished":"2024-02-17T19:02:25+00:00","dateModified":"2024-02-17T19:02:25+00:00","author":{"@id":"https:\/\/feellikelearning.com\/en\/#\/schema\/person\/1ec5aac313d6de20215fe2b8e176b8a7"},"breadcrumb":{"@id":"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/feellikelearning.com\/en\/index.php\/2024\/02\/17\/how-to-start-ssh-agent-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/feellikelearning.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to start ssh-agent on Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/feellikelearning.com\/en\/#website","url":"https:\/\/feellikelearning.com\/en\/","name":"Feel Like Learning","description":"keep curiosity alive","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/feellikelearning.com\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/feellikelearning.com\/en\/#\/schema\/person\/1ec5aac313d6de20215fe2b8e176b8a7","name":"feellikelearning","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/feellikelearning.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/36aec9d519f02362e3e89b0716ae640d08701f57e818830f3f197db5fbc1ae20?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/36aec9d519f02362e3e89b0716ae640d08701f57e818830f3f197db5fbc1ae20?s=96&d=mm&r=g","caption":"feellikelearning"},"sameAs":["http:\/\/feellikelearning.com\/en"],"url":"https:\/\/feellikelearning.com\/en\/index.php\/author\/feellikelearning\/"}]}},"_links":{"self":[{"href":"https:\/\/feellikelearning.com\/en\/index.php\/wp-json\/wp\/v2\/posts\/163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/feellikelearning.com\/en\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/feellikelearning.com\/en\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/feellikelearning.com\/en\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/feellikelearning.com\/en\/index.php\/wp-json\/wp\/v2\/comments?post=163"}],"version-history":[{"count":2,"href":"https:\/\/feellikelearning.com\/en\/index.php\/wp-json\/wp\/v2\/posts\/163\/revisions"}],"predecessor-version":[{"id":165,"href":"https:\/\/feellikelearning.com\/en\/index.php\/wp-json\/wp\/v2\/posts\/163\/revisions\/165"}],"wp:attachment":[{"href":"https:\/\/feellikelearning.com\/en\/index.php\/wp-json\/wp\/v2\/media?parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/feellikelearning.com\/en\/index.php\/wp-json\/wp\/v2\/categories?post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/feellikelearning.com\/en\/index.php\/wp-json\/wp\/v2\/tags?post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}