Introduction
MobaXterm is a free, open-source terminal emulator for Windows that includes an X11 server, SSH client, and a built-in HTTP server. In this article, we will explore how to use MobaXterm's HTTP server to easily upload and download files.
Prerequisites
Before we begin, make sure you have the following:
- MobaXterm installed on your Windows system
- A file or folder you want to upload or download
Uploading a File
To upload a file using MobaXterm's HTTP server:
- Open MobaXterm and start an X11 session or terminal window.
- Type "mxterm --httpd" in the terminal and press Enter to start the HTTP server.
- A message will appear, showing the server's root directory and URL.
- Copy the URL, including the port number (e.g., "http://localhost:8080").
- Use an FTP client or web browser to access the URL and upload your file to the root directory.
Downloading a File
To download a file using MobaXterm's HTTP server:
- Start an X11 session or terminal window in MobaXterm.
- Type "mxterm --httpd" in the terminal and press Enter to start the HTTP server.
- Copy the URL of the file you want to download (e.g., "http://localhost:8080/filename.txt").
- Use an FTP client or web browser to download the file from the URL.
Code Example
Here's an example of starting the HTTP server and uploading a file using an FTP client:
C:\>mobaxterm.exe
Welcome to MobaXterm ssh terminal for Windows.
Press Enter to login automatically or type your username to login manually.
username: (your username)
password: (your password)
C:\Users\(your username)>mxterm --httpd
[INFO] MobaXterm HTTP Server started on port 8080
[INFO] Press Ctrl+C to stop the server
C:\Users\(your username)>ftp localhost
Connected to localhost.
220 ProFTPD 1.3.5 Server (ProFTPD) [localhost]
Name (localhost:username): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remotes system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for "/".
total 24
drwxr-xr-x 2 1001 1001 4096 Mar 24 15:24 upload
-rw-r--r-- 1 1001 1001 12 Mar 24 15:24 file1.txt
226 Transfer complete.
ftp> cd upload
250 CWD command successful.
ftp> put C:\Users\(your username)\Downloads\file2.txt file2.txt
local: C:\Users\(your username)\Downloads\file2.txt
remote: upload/file2.txt
200 PORT command successful.
150 Opening BINARY mode data connection for "/upload/file2.txt".
226 Transfer complete.
ftp> quit
221 Goodbye.
C:\Users\(your username)>
Summary and References
In this article, we explored how to use MobaXterm's built-in HTTP server to easily upload and download files. By following the steps outlined above, you can quickly and conveniently manage files on your local system while using MobaXterm for SSH or X11 sessions.
For more information on MobaXterm, visit the official website at https://mobaxterm.mobatek.net/.
To learn more about FTP, check out the following resources: