Skip to content

This is a personal project for exploring remote server files using ssh connection.

Notifications You must be signed in to change notification settings

sangleshubham/ssh-file-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 SSH File Explorer

A lightweight CLI tool for establishing SSH connections using password or private key authentication and exploring the files present in server. Easily connect to remote servers via terminal with flexible config options.


🚀 Features

  • Connect to any SSH server via CLI
  • Supports password and private key authentication
  • Simple config flags: --host, --port, --username, etc.
  • Logs connection status and errors
  • File exploration on remote server
  • Download files from remote server
  • Interactive prompts using inquirer
  • Colored CLI output using chalk
  • Robust error handling and logging
  • Cross-platform support (Linux, macOS, Windows)

📦 Installation

Clone the repo and install dependencies:

git clone https://github.com/sangleshubham/ssh-file-explorer.git
cd ssh-file-explorer
npm install

🧹 Usage

Run the CLI tool with required options:

node index.js --host your.server.com --port 22 --username youruser --password yourpassword --authMethod password

Or with a private key:

node index.js --host your.server.com --port 22 --username youruser --privateKeyPath /path/to/key --authMethod privateKey

⚙️ Options

Flag Description
--host SSH server hostname or IP
--port SSH port (default: 22)
--username SSH login username
--password Password for authentication
--privateKeyPath Path to private key file for key-based auth
--authMethod 'password' or 'privateKey'

🔧 Example

node index.js --host 192.168.1.10 --port 22 --username admin --authMethod privateKey --privateKeyPath ~/.ssh/id_ed25519

🗂️ Project Structure

/project-root
├── src           
    ├── connect-ssh.js           # SSH Authenticator is implemented here
    ├── file-and-folder-ssh.js   # Helper code for handling File and Folder download and traversal
    ├── helper.js                # Helper code for project
├── index.js          		 # The main execution js file
├── package.json
└── README.md

🤩 Dependencies


📖 Development Timeline

Week 1: Project Setup and Basic SSH Connection

  • Initialize Node.js project with npm init
  • Install commander and node-ssh
  • Implement basic SSH connection
  • Test SSH connectivity
  • Add basic CLI commands (connect/disconnect)

Week 2: File Exploration and Downloading

  • List directories/files on remote server
  • Navigate remote directories via CLI
  • Download files from remote to local
  • Show download progress indicators
  • Test and debug file features

Week 3: Enhancements and Documentation

  • Add colored output using chalk
  • Add interactive prompts via inquirer
  • Implement robust error handling
  • Write detailed documentation with examples

Week 4: Final Testing and Optimization

  • Test on Linux, macOS, Windows
    • Known issue with Windows terminals: Some terminals may crash due to a known bug in the inquirer library.
    • Issue was fixed by Inquirer.js team some times back.
  • Optimize SSH connection & file operations
  • Final code/documentation review
  • Prepare for deployment/personal use

Week 5: If I ever get time.

  • Remove password-prompt Dependency.

📄 License

MIT License — free to use, modify, and distribute.


🙌 Contributing

Have suggestions or improvements? Fork the repo and submit a pull request!


📞 Contact

For support, open an issue or email [[email protected]].

About

This is a personal project for exploring remote server files using ssh connection.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published