{"id":9694,"date":"2022-09-20T07:17:05","date_gmt":"2022-09-20T01:47:05","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/"},"modified":"2022-09-20T07:17:05","modified_gmt":"2022-09-20T01:47:05","slug":"solved-how-to-encrypt-curl-command-to-secure-server-password","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/","title":{"rendered":"[Solved] How to encrypt curl command to secure server password?"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-69071907\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"69071907\" data-parentid=\"69044522\" data-score=\"0\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>Using a SSH key is a good way of accessing a Linux server without using a password,<\/p>\n<p>Requirements<br \/>\n1.Your destination server should have ssh enabled<br \/>\nYou should have generated public and private ssh keys (just use the command <code>ssh-keygen -t rsa<\/code>)<br \/>\n2. You should have a user account and password on the server. Even root account will do.<br \/>\n3. You should know the IP address of the server<\/p>\n<p>Method 1: Copy the key to the server<\/p>\n<ol>\n<li>Copy the SSH key to the remote server.<br \/>\n<code>ssh-copy-id -i ~\/.ssh\/id_rsa.pub YOUR_USER_NAME@IP_ADDRESS_OF_THE_SERVER<\/code><br \/>\nby logging in with the username and password<\/li>\n<\/ol>\n<p>Method 2: If the server does not have username and password authentication and only allows SSH public key authentication.<\/p>\n<p>You can ask the end user to provide her\/his public key. Now what you can do is to create <code>.ssh\/authorized_keys<\/code> directory and then copy the public key here.<\/p>\n<ol>\n<li>Get the public key<\/li>\n<\/ol>\n<p>Ask the end user to provide the public key by typing the following command:<\/p>\n<p><code>cat ~\/.ssh\/id_rsa.pub<\/code><br \/>\nIt will show a long random string starting with ssh-rsa:<\/p>\n<pre><code>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ3GIJzTX7J6zsCrywcjAM\/7Kq3O9ZIvDw2OFOSXAFVqilSFNkHlefm1iMtPeqsIBp2t9cbGUf55xNDULz\/bD\/4BCV43yZ5lh0cUYuXALg9NI29ui7PEGReXjSpNwUD6ceN\/78YOK41KAcecq+SS0bJ4b4amKZIJG3JWm49NWvoo0hdM71sblF956IXY3cRLcTjPlQ84mChKL1X7+D645c7O4Z1N3KtL7l5nVKSG81ejkeZsGFzJFNqvr5DuHdDL5FAudW23me3BDmrM9ifUmt1a00mWci\/1qUlaVFft085yvVq7KZbF2OP2NQACUkwfwh+iSTP username@hostname\n<\/code><\/pre>\n<p>You can get this text via email or messaging tools. Normally, it shouldn\u2019t be a problem.<\/p>\n<ol start=\"2\">\n<li>Create ssh directory in the user\u2019s home directory (as a sysadmin)<\/li>\n<\/ol>\n<p>Keep in mind that you have to create these new directories and files in the end user\u2019s home directory, not on your own (root\/sysadmin).<\/p>\n<p><code>mkdir -p \/home\/user_name\/.ssh &amp;&amp; touch \/home\/user_name\/.ssh\/authorized_keys<\/code><br \/>\nNow open this <code>\/home\/user_name\/.ssh\/authorized_keys<\/code> file with a text editor and add the public key of the user here:<\/p>\n<p><code>vim \/home\/user_name\/.ssh\/authorized_keys<\/code><br \/>\nSave and close the file. It\u2019s almost ready.<\/p>\n<ol start=\"3\">\n<li>Set appropriate permission to the file<\/li>\n<\/ol>\n<p>Having appropriate file permission on the ssh file is very important otherwise you\u2019ll see errors like Permission denied (publickey).<\/p>\n<p>First, make sure to set the correct file permissions:<\/p>\n<p><code>chmod 700 \/home\/user_name\/.ssh &amp;&amp; chmod 600 \/home\/user_name\/.ssh\/authorized_keys<\/code><br \/>\nYou created those file with either root or your own admin accounts for some other user. You need to change the ownership to the user:<\/p>\n<p><code>chown -R username:username \/home\/username\/.ssh<\/code><\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\"><\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved How to encrypt curl command to secure server password? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] Using a SSH key is a good way of accessing a Linux server without using a password, Requirements 1.Your destination server should have ssh enabled You should have generated public and private ssh keys (just use the command ssh-keygen -t rsa) 2. You should have a user account and password on the server. Even &#8230; <a title=\"[Solved] How to encrypt curl command to secure server password?\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/\" aria-label=\"More on [Solved] How to encrypt curl command to secure server password?\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[1042,772,2727,2728,2586],"class_list":["post-9694","post","type-post","status-publish","format-standard","hentry","category-solved","tag-bash","tag-curl","tag-ftp","tag-secure-coding","tag-sh"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] How to encrypt curl command to secure server password? - JassWeb<\/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:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] How to encrypt curl command to secure server password? - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] Using a SSH key is a good way of accessing a Linux server without using a password, Requirements 1.Your destination server should have ssh enabled You should have generated public and private ssh keys (just use the command ssh-keygen -t rsa) 2. You should have a user account and password on the server. Even ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-20T01:47:05+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] How to encrypt curl command to secure server password?\",\"datePublished\":\"2022-09-20T01:47:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/\"},\"wordCount\":323,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"bash\",\"curl\",\"ftp\",\"secure-coding\",\"sh\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/\",\"name\":\"[Solved] How to encrypt curl command to secure server password? - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-09-20T01:47:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] How to encrypt curl command to secure server password?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] How to encrypt curl command to secure server password? - JassWeb","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:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] How to encrypt curl command to secure server password? - JassWeb","og_description":"[ad_1] Using a SSH key is a good way of accessing a Linux server without using a password, Requirements 1.Your destination server should have ssh enabled You should have generated public and private ssh keys (just use the command ssh-keygen -t rsa) 2. You should have a user account and password on the server. Even ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/","og_site_name":"JassWeb","article_published_time":"2022-09-20T01:47:05+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] How to encrypt curl command to secure server password?","datePublished":"2022-09-20T01:47:05+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/"},"wordCount":323,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["bash","curl","ftp","secure-coding","sh"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/","url":"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/","name":"[Solved] How to encrypt curl command to secure server password? - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-09-20T01:47:05+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-how-to-encrypt-curl-command-to-secure-server-password\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] How to encrypt curl command to secure server password?"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/9694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=9694"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/9694\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=9694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=9694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=9694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}