termscp/README.md

334 lines
15 KiB
Markdown
Raw Normal View History

2020-11-07 17:50:37 +01:00
# TermSCP
2020-11-07 17:48:41 +01:00
2020-12-14 19:11:42 +01:00
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Stars](https://img.shields.io/github/stars/ChristianVisintin/TermSCP.svg)](https://github.com/ChristianVisintin/TermSCP) [![Issues](https://img.shields.io/github/issues/ChristianVisintin/TermSCP.svg)](https://github.com/ChristianVisintin/TermSCP/issues) [![Downloads](https://img.shields.io/crates/d/termscp.svg)](https://crates.io/crates/termscp) [![Crates.io](https://img.shields.io/badge/crates.io-v0.1.3-orange.svg)](https://crates.io/crates/termscp) [![Docs](https://docs.rs/termscp/badge.svg)](https://docs.rs/termscp)
2020-12-06 11:01:57 +01:00
2020-12-18 10:47:37 +01:00
[![Build](https://github.com/ChristianVisintin/TermSCP/workflows/Linux/badge.svg)](https://github.com/ChristianVisintin/TermSCP/actions) [![Build](https://github.com/ChristianVisintin/TermSCP/workflows/MacOS/badge.svg)](https://github.com/ChristianVisintin/TermSCP/actions) [![Build](https://github.com/ChristianVisintin/TermSCP/workflows/Windows/badge.svg)](https://github.com/ChristianVisintin/TermSCP/actions) [![codecov](https://codecov.io/gh/ChristianVisintin/termscp/branch/main/graph/badge.svg?token=au67l7nQah)](https://codecov.io/gh/ChristianVisintin/termscp)
2020-11-07 17:48:41 +01:00
~ Basically, WinSCP on a terminal ~
Developed by Christian Visintin
2020-12-14 19:11:42 +01:00
Current version: 0.1.3 (13/12/2020)
2020-11-07 17:48:41 +01:00
---
2020-11-07 17:50:37 +01:00
- [TermSCP](#termscp)
2020-12-06 12:52:47 +01:00
- [About TermSCP 🖥](#about-termscp-)
- [Why TermSCP 🤔](#why-termscp-)
- [Features 🎁](#features-)
2020-12-13 10:25:22 +01:00
- [Installation 🛠](#installation-)
2020-12-06 12:32:53 +01:00
- [Cargo 🦀](#cargo-)
- [Deb package 📦](#deb-package-)
2020-12-13 10:25:22 +01:00
- [RPM package 📦](#rpm-package-)
2020-12-06 12:32:53 +01:00
- [Chocolatey 🍫](#chocolatey-)
- [Brew 🍻](#brew-)
2020-12-06 22:36:18 +01:00
- [Usage ❓](#usage-)
2020-12-15 16:45:34 +01:00
- [Address argument 🌎](#address-argument-)
- [How Password can be provided 🔐](#how-password-can-be-provided-)
- [Bookmarks ⭐](#bookmarks-)
2020-12-16 21:09:59 +01:00
- [Are my passwords Safe 😈](#are-my-passwords-safe-)
2020-12-20 15:22:52 +01:00
- [Text Editor ✏](#text-editor-)
- [How do I configure the text editor 🦥](#how-do-i-configure-the-text-editor-)
2020-12-06 22:36:18 +01:00
- [Keybindings ⌨](#keybindings-)
2020-12-06 12:32:53 +01:00
- [Documentation 📚](#documentation-)
- [Known issues 🧻](#known-issues-)
- [Upcoming Features 🧪](#upcoming-features-)
- [Contributions 🤝🏻](#contributions-)
2020-12-06 12:32:53 +01:00
- [Changelog ⏳](#changelog-)
2020-12-06 22:36:18 +01:00
- [Powered by 🚀](#powered-by-)
- [Gallery 🎬](#gallery-)
2020-12-06 12:32:53 +01:00
- [License 📃](#license-)
2020-11-07 17:48:41 +01:00
---
2020-12-06 12:52:47 +01:00
## About TermSCP 🖥
2020-11-07 17:48:41 +01:00
2020-12-09 16:20:55 +01:00
TermSCP is basically a porting of WinSCP to terminal. So basically is a terminal utility with an TUI to connect to a remote server to retrieve and upload files and to interact with the local file system. It works both on **Linux**, **MacOS**, **BSD** and **Windows** and supports SFTP, SCP, FTP and FTPS.
2020-11-07 17:48:41 +01:00
2020-12-06 22:40:08 +01:00
![Explorer](assets/images/explorer.gif)
2020-12-06 22:36:18 +01:00
---
2020-12-06 12:52:47 +01:00
### Why TermSCP 🤔
2020-11-07 17:48:41 +01:00
2020-12-09 16:20:55 +01:00
It happens quite often to me, when using SCP at work to forget the path of a file on a remote machine, which forces me then to connect through SSH, gather the file path and finally download it through SCP. I could use WinSCP, but I use Linux and I pratically use the terminal for everything, so I wanted something like WinSCP on my terminal. Yeah, I know there midnight commander too, but actually I don't like it very much tbh (and hasn't a decent support for scp).
2020-11-07 17:48:41 +01:00
2020-12-06 12:52:47 +01:00
## Features 🎁
2020-11-07 17:48:41 +01:00
- Different communication protocols
- SFTP
- SCP
2020-12-01 14:38:03 +01:00
- FTP and FTPS
2020-12-06 12:32:53 +01:00
- Practical user interface to explore and operate on the remote and on the local machine file system
2020-12-09 16:20:55 +01:00
- Compatible with Windows, Linux, BSD and MacOS
2020-11-07 17:48:41 +01:00
- Written in Rust
2020-12-06 12:32:53 +01:00
- Easy to extend with new file transfers protocols
---
2020-11-07 17:48:41 +01:00
2020-12-13 10:25:22 +01:00
## Installation 🛠
2020-11-07 17:48:41 +01:00
2020-12-06 12:32:53 +01:00
If you're considering to install TermSCP I want to thank you 💛 ! I hope you will enjoy TermSCP!
2020-11-07 17:48:41 +01:00
If you want to contribute to this project, don't forget to check out our contribute guide. [Read More](CONTRIBUTING.md)
2020-12-06 12:32:53 +01:00
### Cargo 🦀
2020-11-07 17:48:41 +01:00
```sh
# Install termscp through cargo
cargo install termscp
```
2020-12-06 12:32:53 +01:00
### Deb package 📦
2020-11-07 17:48:41 +01:00
2020-12-14 19:11:42 +01:00
Get `deb` package from [HERE](https://github.com/ChristianVisintin/TermSCP/releases/download/latest/termscp_0.1.3_amd64.deb)
or run `wget https://github.com/ChristianVisintin/TermSCP/releases/download/latest/termscp_0.1.3_amd64.deb`
2020-11-07 17:48:41 +01:00
2020-12-06 12:32:53 +01:00
then install through dpkg:
2020-11-07 17:48:41 +01:00
2020-12-06 12:32:53 +01:00
```sh
dpkg -i termscp_*.deb
# Or even better with gdebi
gdebi termscp_*.deb
```
2020-11-07 17:48:41 +01:00
2020-12-13 10:25:22 +01:00
### RPM package 📦
2020-12-06 12:32:53 +01:00
2020-12-14 19:11:42 +01:00
Get `rpm` package from [HERE](https://github.com/ChristianVisintin/TermSCP/releases/download/latest/termscp-0.1.3-1.x86_64.rpm)
or run `wget https://github.com/ChristianVisintin/TermSCP/releases/download/latest/termscp-0.1.3-1.x86_64.rpm`
2020-12-06 12:32:53 +01:00
then install through rpm:
```sh
rpm -U termscp_*.rpm
```
### Chocolatey 🍫
2020-12-06 14:38:22 +01:00
You can install TermSCP on Windows using [chocolatey](https://chocolatey.org/)
Start PowerShell as administrator and run
```ps
choco install termscp
```
2020-12-14 19:11:42 +01:00
Alternatively you can download the ZIP file from [HERE](https://github.com/ChristianVisintin/TermSCP/releases/download/latest/termscp.0.1.3.nupkg)
2020-12-06 14:38:22 +01:00
and then with PowerShell started with administrator previleges, run:
```ps
choco install termscp -s .
```
2020-12-06 12:32:53 +01:00
### Brew 🍻
2020-12-06 22:36:18 +01:00
You can install TermSCP on MacOS using [brew](https://brew.sh/)
From your terminal run
```sh
brew tap ChristianVisintin/termscp
brew install termscp
```
---
## Usage ❓
TermSCP can be started with the following options:
- `-P, --password <password>` if address is provided, password will be this argument
- `-v, --version` Print version info
- `-h, --help` Print help page
TermSCP can be started in two different mode, if no extra arguments is provided, TermSCP will show the authentication form, where the user will be able to provide the parameters required to connect to the remote peer.
Alternatively, the user can provide an address as argument to skip the authentication form and starting directly the connection to the remote server.
2020-12-15 16:45:34 +01:00
### Address argument 🌎
2020-12-06 22:36:18 +01:00
The address argument has the following syntax:
```txt
[protocol]://[username@]<address>[:port]
```
Let's see some example of this particular syntax, since it's very comfortable and you'll probably going to use this instead of the other one...
- Connect using default protocol (sftp) to 192.168.1.31, port is default for this protocol (22); username is current user's name
```sh
termscp 192.168.1.31
```
- Connect using default protocol (sftp) to 192.168.1.31, port is default for this protocol (22); username is `root`
```sh
termscp root@192.168.1.31
```
- Connect using scp to 192.168.1.31, port is 4022; username is `omar`
```sh
termscp scp://omar@192.168.1.31:4022
```
2020-12-15 16:45:34 +01:00
#### How Password can be provided 🔐
2020-12-06 22:36:18 +01:00
You have probably noticed, that, when providing the address as argument, there's no way to provide the password.
Password can be basically provided through 3 ways when address argument is provided:
- `-P, --password` option: just use this CLI option providing the password. I strongly unrecommend this method, since it's very unsecure (since you might keep the password in the shell history)
- Via `sshpass`: you can provide password via `sshpass`, e.g. `sshpass -f ~/.ssh/topsecret.key termscp cvisintin@192.168.1.31`
- You will be prompted for it: if you don't use any of the previous methods, you will be prompted for the password, as happens with the more classics tools such as `scp`, `ssh`, etc.
---
2020-12-15 16:45:34 +01:00
## Bookmarks ⭐
2020-12-20 15:22:52 +01:00
In TermSCP it is possible to save favourites hosts, which can be then loaded quickly from the main layout of termscp.
2020-12-15 16:45:34 +01:00
TermSCP will also save the last 16 hosts you connected to.
This feature allows you to load all the parameters required to connect to a certain remote, simply selecting the bookmark in the tab under the authentication form.
2020-12-16 21:09:59 +01:00
Bookmarks will be saved, if possible at:
- `$HOME/.config/termscp/` on Linux
- `FOLDERID_RoamingAppData\termscp\` on Windows
- `$HOME/Library/Application Support/termscp` on MacOs
For bookmarks only (this won't apply to recent hosts) it is also possible to save the password used to authenticate. The password is not saved by default and must be specified through the prompt when saving a new Bookmark.
> I was very undecided about storing passwords in termscp. The reason? Saving a password on your computer might give access to a hacker to any server you've registered. But I must admit by myself that for many machines typing the password everytime is really boring, also many times I have to work with machines in LAN, which wouldn't provide any advantage to an attacker, So I came out with a good compromise for passwords.
I warmly suggest you to follow these guidelines in order to decide whether you should or you shouldn't save passwords:
- **DON'T** save passwords for machines which are exposed on the internet, save passwords only for machines in LAN
- Make sure your machine is protected by attackers. If possible encrypt your disk and don't leave your PC unlocked while you're away.
- Preferably, save passwords only when a compromising of the target machine wouldn't be a problem.
2020-12-15 16:45:34 +01:00
To create a bookmark, just fulfill the authentication form and then input `CTRL+S`; you'll then be asked to give a name to your bookmark, and tadah, the bookmark has been created.
2020-12-16 21:09:59 +01:00
If you go to [gallery](#gallery-), there is a GIF showing how bookmarks work 💪.
### Are my passwords Safe 😈
Well, kinda.
As said before, bookmarks are saved in your configuration directory along with passwords. Passwords are obviously not plain text, they are encrypted with **AES-128**. Does this make them safe? Well, no, the key used to encrypt your passwords is generated at the first launch of termscp and stored on your drive. So it's still possible to retrieve the key to decrypt passwords. Luckily, the location of the key guarantees your key can't be read by users different from yours, but yeah, I still wouldn't save the password for a server exposed on the internet 😉.
2020-12-15 16:45:34 +01:00
---
2020-12-20 15:22:52 +01:00
## Text Editor ✏
TermSCP has, as you might have noticed, many features, one of these is the possibility to view and edit text file. It doesn't matter if the file is located on the local host or on the remote host, termscp provides the possibility to open a file in your favourite text editor.
In case the file is located on remote host, the file will be first downloaded into your temporary file directory and then, **only** if changes were made to the file, re-uploaded to the remote host. TermSCP checks if you made changes to the file calculating the digest of the file using `sha256`.
Just a reminder: **you can edit only textual file**; binary files are not supported.
### How do I configure the text editor 🦥
Text editor is automatically found using this [awesome crate](https://github.com/milkey-mouse/edit), if you want to change the text editor it has chosen for you, just set the `EDITOR` variable in your environment.
> This mechanism will probably change in 0.3.0, since I'm going to introduce the possibility to configure directly in termscp's settings.
---
2020-12-06 22:36:18 +01:00
## Keybindings ⌨
| Key | Command |
|---------------|-------------------------------------------------------|
| `<ESC>` | Disconnect from remote; return to authentication page |
| `<TAB>` | Switch between log tab and explorer |
| `<BACKSPACE>` | Go to previous directory in stack |
| `<RIGHT>` | Move to remote explorer tab |
| `<LEFT>` | Move to local explorer tab |
| `<UP>` | Move up in selected list |
| `<DOWN>` | Move down in selected list |
| `<PGUP>` | Move up in selected list by 8 rows |
| `<PGDOWN>` | Move down in selected list by 8 rows |
| `<ENTER>` | Enter directory |
| `<SPACE>` | Upload / download selected file |
2020-12-21 11:11:29 +01:00
| `<C>` | Copy file/directory |
| `<D>` | Make directory |
| `<E>` | Delete file (Same as `CANC`) |
| `<G>` | Go to supplied path |
| `<H>` | Show help |
2020-12-10 14:26:13 +01:00
| `<I>` | Show info about selected file or directory |
2020-12-14 13:52:49 +01:00
| `<L>` | Reload current directory's content |
2020-12-20 15:22:52 +01:00
| `<O>` | Edit file; see [Text editor](#text-editor-) |
| `<Q>` | Quit TermSCP |
| `<R>` | Rename file |
| `<U>` | Go to parent directory |
| `<DEL>` | Delete file |
2020-12-14 09:03:57 +01:00
| `<CTRL+C>` | Abort file transfer process |
2020-12-06 22:36:18 +01:00
2020-12-06 12:32:53 +01:00
---
2020-11-07 17:48:41 +01:00
2020-12-06 12:32:53 +01:00
## Documentation 📚
2020-11-07 17:48:41 +01:00
The developer documentation can be found on Rust Docs at <https://docs.rs/termscp>
---
2020-12-06 12:32:53 +01:00
## Known issues 🧻
2020-11-07 17:48:41 +01:00
- Ftp:
- Time in explorer is `1 Jan 1970`, but shouldn't be: that's because chrono can't parse date in a different locale. So if your server has a locale different from the one on your machine, it won't be able to parse the date.
2020-12-06 22:36:18 +01:00
- Some servers don't work: yes, some kind of ftp server don't work correctly, sometimes it won't display any files in the directories, some other times uploading files will fail. Up to date, `vsftpd` is the only one server which I saw working correctly with TermSCP. Am I going to solve this? I'd like to, but it's not my fault at all. Unfortunately [rust-ftp](https://github.com/mattnenterprise/rust-ftp) is an abandoned project (up to 2020), indeed I had to patch many stuff by myself. I'll try to solve these issues, but it will take a long time.
2020-12-06 23:29:59 +01:00
- `NoSuchFileOrDirectory` on connect: let me guess, you're running on WSL and you've installed termscp through cargo. I know about this issue and it's a glitch of WSL I guess. Don't worry about it, just move the termscp executable into another PATH location, such as `/usr/bin`.
2020-11-07 17:48:41 +01:00
---
2020-12-06 12:32:53 +01:00
## Upcoming Features 🧪
2020-11-07 17:48:41 +01:00
---
2020-12-10 14:26:39 +01:00
## Contributions 🤝🏻
2020-11-07 17:48:41 +01:00
Contributions are welcome! 😉
If you think you can contribute to TermSCP, please follow [TermSCP's contributions guide](CONTRIBUTING.md)
2020-12-06 12:32:53 +01:00
## Changelog ⏳
2020-11-07 17:48:41 +01:00
2020-12-06 22:36:18 +01:00
View TermSCP's changelog [HERE](CHANGELOG.md)
---
## Powered by 🚀
TermSCP is powered by these aweseome projects:
- [bytesize](https://github.com/hyunsik/bytesize)
- [crossterm](https://github.com/crossterm-rs/crossterm)
2020-12-20 15:22:52 +01:00
- [edit](https://github.com/milkey-mouse/edit)
2020-12-06 22:36:18 +01:00
- [rpassword](https://github.com/conradkleinespel/rpassword)
- [ssh2-rs](https://github.com/alexcrichton/ssh2-rs)
- [textwrap](https://github.com/mgeisler/textwrap)
- [tui-rs](https://github.com/fdehau/tui-rs)
- [whoami](https://github.com/libcala/whoami)
---
## Gallery 🎬
2020-12-16 21:09:59 +01:00
> Termscp Home
2020-12-06 22:40:08 +01:00
![Auth](assets/images/auth.gif)
2020-11-07 17:48:41 +01:00
2020-12-16 21:09:59 +01:00
> Bookmarks
![Bookmarks](assets/images/bookmarks.gif)
2020-12-20 15:22:52 +01:00
> Text editor
![TextEditor](assets/images/text-editor.gif)
2020-11-07 17:48:41 +01:00
---
2020-12-06 12:32:53 +01:00
## License 📃
2020-11-07 17:48:41 +01:00
Licensed under the GNU GPLv3 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
<http://www.gnu.org/licenses/gpl-3.0.txt>
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
You can read the entire license [HERE](LICENSE)