{"id":4675,"date":"2013-05-19T01:27:08","date_gmt":"2013-05-18T17:27:08","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=4675"},"modified":"2023-04-28T09:48:21","modified_gmt":"2023-04-28T09:48:21","slug":"how-to-use-wget-with-username-and-password-for-ftphttp-site-on-linux","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-use-wget-with-username-and-password-for-ftphttp-site-on-linux\/","title":{"rendered":"How to Use wget With Username and Password for FTP\/HTTP Site on Linux"},"content":{"rendered":"<p>Wget is a powerful command-line utility for downloading files from the internet. It supports various protocols, including HTTP, HTTPS, and FTP. In some cases, you may need to download files from a password-protected site, which requires authentication using a username and password.<\/p>\n<p>This short guide will walk you through the process of using wget with a username and password to download files on Linux.<\/p>\n<h2>Step 1: Install wget<\/h2>\n<p>First, ensure that wget is installed on your Linux system. If it is not already installed, you can install it using your system&#8217;s package manager.<\/p>\n<p>For Debian and Ubuntu-based systems, use the following command:<\/p>\n<pre>\r\nsudo apt-get install wget\r\n<\/pre>\n<p>For CentOS, RHEL, and Fedora-based systems, use this command:<\/p>\n<pre>\r\nsudo yum install wget\r\n<\/pre>\n<h2>Step 2: Download a File with Username and Password<\/h2>\n<p>After wget is installed, you can use it to download files from a protected site by including your username and password. Here&#8217;s how to do it for HTTPS and FTP sites:<\/p>\n<p><b>For HTTPS:<\/b><\/p>\n<pre>\r\nwget --user=&lt;username&gt; --password=&lt;password&gt; https:\/\/webhostinggeeks.com\/yourfile.txt\r\n<\/pre>\n<p>Replace &lt;username&gt; and &lt;password&gt; with your actual username and password for the protected site.<\/p>\n<p><b>For FTP:<\/b><\/p>\n<pre>\r\nwget --user=&lt;username&gt; --password=&lt;password&gt; ftp:\/\/webhostinggeeks.com\/yourfile.txt\r\n<\/pre>\n<p>Again, replace &lt;username&gt; and &lt;password&gt; with your actual username and password for the protected site.<\/p>\n<h3>Commands and Their Functions:<\/h3>\n<ul>\n<li><span class=\"fw-bold\">wget<\/span> &#8211; The command-line utility for downloading files from the internet<\/li>\n<li><span class=\"fw-bold\">&#8211;user<\/span> &#8211; Specifies the username to use for authentication<\/li>\n<li><span class=\"fw-bold\">&#8211;password<\/span> &#8211; Specifies the password to use for authentication<\/li>\n<\/ul>\n<h3>The Outcome<\/h3>\n<p>By following this guide, you have successfully used wget with a username and password to download files from protected HTTP and FTP sites on Linux. This method allows you to access and download files from sites that require authentication securely.<\/p>\n<p>We hope this guide has been helpful in explaining how to use wget with a username and password for FTP\/HTTP sites on Linux. If you have any suggestions or improvements, please feel free to leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wget is a powerful command-line utility for downloading files from the internet. It supports various protocols, including HTTP, HTTPS, and FTP. In some cases, you may need to download files&#8230;<\/p>\n","protected":false},"author":6,"featured_media":3785,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[996],"tags":[1536,1546,1924],"class_list":["post-4675","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux","tag-linux-utilities","tag-wget"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=4675"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4675\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/3785"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=4675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=4675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=4675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}