-2

I'm trying to self-host a webpage and some other files available for download, but don't know anything about self-hosting. I only know about HTML, CSS, and Javascript.

I downloaded the lastest version of the free Ubuntu Server (16.04.1) and set it up. I'm running it in a virtual machine, VMware to be exact, with a host OS of Win 10. I successfully connected to the inet address and got the "It Worked!" page.

It worked page, Vmware, and putty

In addition to VMware, I also have PuTTY running on the host.

To get to my question, it says:

You should replace this file (located at /var/www/html/index.html) before continuing to operate your HTTP server.

That would be great! Except, I have no idea how to do it. I can get to the file's location using the cd command but that's it. How do I upload/put files on my server? I have the .HTML on my host OS but can't get it on my server. I might be doing this completely wrong anyways. The Internet's documentation on stuff like this isn't very good.

  • Anything that can be improved with the question? – Unnamed Sentient Being Dec 25 '16 at 4:23
  • The documentation is good enough to give you few different ways to do it. Google "transfer files from windows to linux". Your question shows little research effort – maybe that's why it is being downvoted (not by me though). – Kamil Maciorowski Dec 25 '16 at 10:18
  • Please do not expand your question this way. My answer used to be quite a good one before your edit, it has been upvoted as such. First you asked about file transfer in general, now it is specifically about Filezilla. You made all the answers seem inappropriate. Furthermore you are now asking about permissions. I have expanded my answer a little to help you with that in a basic way. Also the third subject appeared: the correct folder. This should be split in three different questions. I'm going to use my privileges to revert your unfortunate changes and make the answers appropriate again. – Kamil Maciorowski Dec 26 '16 at 5:10
  • @KamilMaciorowski I apologize for that, but the downvotes hinted at is was too broad and incomplete. In an effort to get the proper information I had to change it. I agree, it was wrong of me to do so and I won't do it again. Thank everso much anyways. – Unnamed Sentient Being Dec 26 '16 at 5:16
1

Since you already have SSH server running on the guest system, you may install (e.g.) Filezilla on the host and use this address:

scp://ip:port

The ip is the IP (or name) of your guest system; port is the port PuTTY uses. You can use just scp://ip if the port is 22, I bet it is.

Also write your SSH username and password in appropriate Filezilla fields – then connect and it should work.


Additional hints in case of permission issues:

Connecting Filezilla directly as root is a trouble wish; you can easily break your system with one misclick. This is probably restricted. It certainly should be restricted by default.

Upload to your home directory (i.e. /home/<your-username>/) where your regular user has all the access rights. Then log in with PuTTY and take it from there – like sudo cp ~/index.html /var/www/html/. Probably you will need to chown and maybe chmod the resulting file.

  • Tried uploading .html got this error: Error: /var/www/html/Free.html: open for write: permission denied Error: File transfer failed. I uploaded it to /var/www/html/ before deleting index.html – Unnamed Sentient Being Dec 26 '16 at 1:40
  • Same thing happens when I try to upload to home directory. Permission Denied – Unnamed Sentient Being Dec 26 '16 at 5:23
  • @SammySwanson Can you download any file? The following question may seem disrespectful but I have to ask: you are talking about /home/<your-username>/ directory, not just /home/, right? – Kamil Maciorowski Dec 26 '16 at 5:29
  • Not disrespectful at all for a noob. Thnx, it worked now that I clicked on my username, but when you said home directory i figured you just meant /home/ – Unnamed Sentient Being Dec 26 '16 at 5:31
1

There are many ways to transfer files between machines. Since you have a default OpenSSH already running on your ubuntu VM, and (presumably) a default PuTTY install on windows, a non-Windows way to do it without installing any additional software:

  1. Find the directory where putty.exe is located; probably C:\Program Files (x86)\PuTTY\
  2. Double-click psftp.exe
  3. At the psftp> prompt, issue open ${USERNAME}@${HOSTNAME_OR_IP}, and provide your password when prompted.
  4. Navigate to the correct location on each machine using cd and lcd (local change directory); pwd, lpwd, etc.
  5. Move files using put ${FILENAME} or get ${FILENAME}.

In practice on Windows, you'd download and install an application which puts a Windows style GUI around the sftp transfer, such as WinSCP.

-2

You can upload files to a remote system from another system by using either SFTP, SCP. Usually you would use SCP. You can also share a drive or directory from windows with by creating share and accessing it with samba on linux. So if its a Linux or Mac to linux copy use SCP. If its Windows to Linux, use SFTP, SCP, or SAMBA. All of these are pretty simple to setup, if you google those commands.

  • Could you include a bit more information? I'm still confused. Where do I use these commands, proper syntax, and what do they do? – Unnamed Sentient Being Dec 25 '16 at 6:10
  • $ scp source_file_path destination_file_path So if you are "sending" file from your local machine to a remote machine (uploading) the syntax would look like this $ scp ~/my_local_file.txt user@remote_host.com:/some/remote/directory When copying file from remote host to local host (downloading), its looks just the reverse $ scp user@remote_host.com:/some/remote/directory ~/my_local_file.txt # just download the file $ scp user@192.168.1.3:/some/path/file.txt . – ddlingo Dec 25 '16 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.