How to Upload a .txt file via SSH for SSL Validation

One of the methods provided to validate SSL is via File Validation. In this method, the domain owner is required to prove ownership by uploading a .txt file provided by the CA to a specific location in the document root of the server. To do this, follow the steps below

From Linux Computer

If you run a Linux OS on your desktop, follow the steps below:

1.Open terminal on your computer

2.Download the validation file to your computer. By default, the downloaded file can be found under Download folder.

3.Run the command below to upload the file. Assume the file name is HGTYKS1547HT.txt

scp -p 22 HGTYKS1547HT.txt [email protected]:/home

Replace user with your remote server username and 12.34.56.78 with your server IP or Hostname and 22 to your SSH port.

4.Once uploaded, login to the server and navigate to /home directory,

$: cd /home

5.Create appropriate directories as follows on your document root. Document root is the folder where your website files reside. For this documentation, we shall assume our document root is /var/www/html

$: mkdir -p /var/www/html/.well-known/pki-validation

This will create the folders called .well-known and pki-validation

6. You can now move the validation fil to the above location usng the command below

$: mv HGTYKS1547HT.txt /var/www/html/.well-known/pki-validation

7. Then test if this is properly uploaded using the validation link provided

From Windows Computer (Windows 10)

For a Windows computers, we will use a program called Powershell to upload the files.

1.On Windows Search, search the word Powershell and click on it

2.Download the validation file to your computer. By default, the downloaded file can be found under Downloads folder.

3. Navigate to the download folder using the command below

 >cd Downloads

After that, follow the steps 3 – 7 on the Linux guide above.

Was this article helpful?

Related Articles

Leave A Comment?