Giter VIP home page Giter VIP logo

mercury's Introduction

Mercury-SSH Commander EOL

This app reached the EOL stage; it will not be available on Google Play anymore, but you can download if from F-Droid.

Simple Android app that sends pre-configured commands to remote servers via SSH.

Get it on F-Droid

Usage

Take a look at the wiki to learn how to configure and use Mercury-SSH.

Limitations

This app is intended to be used as a simple remote so interactive commands and output handling are not supported.

License

This software is released under GPLv2 License, please refer to the attached LICENSE file for details.

mercury's People

Contributors

skarafaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mercury's Issues

Icon/Skinning

It would be nice if commands could have icons (maybe even dynamic ones, depending of the return value of the remote command, to signal state).

Awesome would be some kind of image-map with sensitive rectangles for each command. (so you could have an image of a remote control with commands mapped to buttons, for example)

and of course: GIF animations ;)

Can Mercury work with root but no sudo?

I think the answer here is no, as the documentation states that Mercury relies on sudo, but i just want to check: what if you connect directly as root?

I know this is not a common (or really recommended) scenario, but some just-enough distributions of Kodi such as LibreELECE or CoreELEC are set up to run basically as an appliance, where the root filesystem is an unpacked squashfs in read only, it offers no option to mess with the packages (so no option to install sudo), and runs everything as root. Which means you ssh into them as root.

Also nohup is available in the default path.

For reference:

# mount
(…)
/dev/loop0 on / type squashfs (ro,relatime)
(…)

@Skarafaz what do you think?

error: algorithm negotiation fail

Hi,

I use a somewhat hardened sshd config, in which I have the following:
Ciphers aes256-ctr
MACs hmac-sha2-512, hmac-sha2-256
KexAlgorithms diffie-hellman-group-exchange-sha256

This apparently prevents MercurySSH from connecting, I find a "ERROR: algorithm negotiation fail" in the logs.

I haven't digged in the code, but I think we should encourage strong crypto for SSH (in general), so it might be a good idea to make sure strong ciphers etc. don't break Mercury.

Thanks for a cool app otherwise!

Cheers

Duplicate Server tabs

I've just loaded two scripts into my Mercury-SSH directory. Both used the name variable "myserver".

Rather than having the two scripts listed under a single "myserver" tab, they are each under a separate "myserver" tab.

Is this the desired functionality or, could this be a bug?

Problem with special characters

I noticed a problem when I used a password with the character "#". To make it work, I had to change the server's password. Moreover, I could not make commands such as "/etc/init.d/something" work. I didn't go any further, but, as the commands worked when executed directly om a SSH shell, I suspect the character "/" is causing some problems too. Is there a way to use these characters on the config file ?

Thanks!

Renato.

[feature-request] Homescreen widgets

Hi @Skarafaz,
thank you for this usefull app!

I have an idea I consider a usefull continuation of the develpment: It would be nice to have the abillity to create widgets, one per configured actions so e.g. you could tap on the widget on your phones homescreean instead of opening the app, select the computers tab and tap on the line of the command you wish to trigger.

Just an idea ... thanks for reading 😄
Peter

command arguments

commands should have optional arguments.
Mercury would then request input from the user after command selection and before sending it.
Most important would be string arguments, but since the android UI offers a rich set of input methods, also number inputs, date/time, sliders, list selections etc. could be implemented as needed.

attempt to create directory in /storage/emulated/0 fails

When running 1.2.1 via f-droid on CM13, I get the message "Cannot create /storage/emulated/0/Mercury-SSH"

The logcat is:

12-11 18:52:16.740  2396  3067 I ActivityManager: Start proc 13558:it.skarafaz.mercury/u0a117 for activity it.skarafaz.mercury/.activity.MainActivity
12-11 18:52:16.960 13558 13558 W System  : ClassLoader referenced unknown path: /data/app/it.skarafaz.mercury-1/lib/arm
12-11 18:52:17.300 13558 13558 W art     : Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
12-11 18:52:17.405 13558 13572 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: false
12-11 18:52:17.465 13558 13572 D libEGL  : loaded /system/lib/egl/libEGL_mali.so
12-11 18:52:17.475 13558 13572 D libEGL  : loaded /system/lib/egl/libGLESv1_CM_mali.so
12-11 18:52:17.520 13558 13572 D libEGL  : loaded /system/lib/egl/libGLESv2_mali.so
12-11 18:52:17.570 13558 13572 E         : Device driver API match
12-11 18:52:17.570 13558 13572 E         : Device driver API version: 29
12-11 18:52:17.570 13558 13572 E         : User space API version: 29 
12-11 18:52:17.570 13558 13572 E         : mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Tue Aug 26 17:05:16 KST 2014 
12-11 18:52:17.570 13558 13572 I OpenGLRenderer: Initialized EGL, version 1.4
12-11 18:52:17.825  2396  3075 I ActivityManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.packageinstaller cmp=com.android.packageinstaller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10117 on display 0
12-11 18:52:17.840  2396  3001 W InputMethodManagerService: Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@ca14cea (uid=10117 pid=13558)
12-11 18:52:17.905  2396 12632 D NetlinkSocketObserver: NeighborEvent{elapsedMs=84997653, 192.168.0.1, [009027A212EF], RTM_NEWNEIGH, NUD_STALE}
12-11 18:52:18.135  2984  2984 I HK/LatinKbdBaseView: closing org.pocketworkstation.pckeyboard.LatinKeyboardView{6199360 V.ED..... ......ID 0,0-720,320 #1020026 android:id/keyboardView}
12-11 18:52:18.175  2396  2425 I ActivityManager: Displayed com.android.packageinstaller/.permission.ui.GrantPermissionsActivity: +273ms (total +1s462ms)
12-11 18:52:20.860  2396  3001 D VoldConnector: SND -> {12 volume remount_uid 10117 read}
12-11 18:52:20.860  1912  1963 D vold    : Remounting 10117 as mode read
12-11 18:52:20.860  1912  1963 E vold    : Failed to readlink: No such file or directory
12-11 18:52:20.860  2396  2529 D VoldConnector: RCV <- {400 12 Command failed}
12-11 18:52:20.860  2396  3001 W MountService: Failed to remount UID 10117 as read: com.android.server.NativeDaemonConnector$NativeDaemonFailureException: command '12 volume remount_uid 10117 read' failed with '400 12 Command failed'
12-11 18:52:20.860  2396  2407 D VoldConnector: SND -> {13 volume remount_uid 10117 write}
12-11 18:52:20.860  1912  1963 D vold    : Remounting 10117 as mode write
12-11 18:52:20.860  1912  1963 E vold    : Failed to readlink: No such file or directory
12-11 18:52:20.860  2396  2529 D VoldConnector: RCV <- {400 13 Command failed}
12-11 18:52:20.865  2396  2407 W MountService: Failed to remount UID 10117 as write: com.android.server.NativeDaemonConnector$NativeDaemonFailureException: command '13 volume remount_uid 10117 write' failed with '400 13 Command failed'
12-11 18:52:20.945 12822 12835 D OpenGLRenderer: endAllStagingAnimators on 0x4e150db0 (RippleDrawable) with handle 0x4dce0cc0
12-11 18:52:21.135  1987  1987 W SurfaceFlinger: couldn't log to binary event log: overflow.

Add option to use certain environmental variables when running a command

I would like to run a command with mercury (fantastic app BTW) to launch an x application in an existing X session. But I guess mercury doesn't support it yet.
Here is what I've done so far:
I have succeeded to launch Firefox in an existing X session with connect bot. I ran inside the ssh session the following commands:

$ export DISPLAY=:0
$ firefox

And I saw Firefox being launched.
Then I added the following to my JSON file:

{
	"name" : "testing DISPLAY",
	"cmd" : "export DISPLAY=:0 && firefox",
	"confirm" : false
},

It didn't work.. I guess there is a problem with the && expression.

What do you think?

Change the default keysize to 4096 bit

Hey and thanks for releasing this great app :)
Would changing the default keysize to 4096 bit have a terrible performance impact?
I looked up the library you used for generating the keypair and it seems like 4096 bit is supported.

Don't storre the Password !!!

I like your app, but do we really have to sotore the password plain text on a smart phone? Could you make it possible for the user to just enter the password every time he wants to send a command, and if the password was not set in the config.

mfg schabi

(Non-)Feature-Request: Keep it simple

Since mercury is meant to be used mainly by unix-users, I think it should stick to the Unix Philosophy and apply the KISS principle.
(If I were to develop this app I would even consider removing the "nohup" and "sudo" options in favor of a simpler, more intuitive and more secure app. Every administrator can add nohup and sudo to his or her scripts and adding the needed commands to the sudoers file is much better than storing and transmitting passwords for sudo on your Android device.)

Dynamic Variables

Please consider implementing the ability to add a variable into commands that allow user input. For example:

I have a server with nmap to do some pentesting from outside of my local network. I would like to be able to push the button to run the command and get a prompt that allows me to input the IP I would like to scan.

If you need some help, let me know. I haven't done much development but will dedicate some time to help this happen with some direction.

Thanks!

Feature Request: Remote Pull of Config

While the current config method is mainly designed for dependency free one-off comands, my workflows more often than not require droping small scripts on the ssh hosts which get executed by mercury. This leaves the configuration in two places: on the device for the mercury config and on the ssh host for the actual scripts / behaviour. Having to use adb to update the mercury config feels a litle tedious compared to having some kind of sync / pull behaviour.

Following the exising simple configuration philosophy I propose a new setting key "origin" on the json server property pointing to a file path. When the user invokes the sync/update action and the the key is present for a config file, its origin location on the remote server is checked for any changes and the config is updated in place.

Windows support

I tried using this app with Windows 10 OpenSSH Server, but it didn't work well. Key authentication doesn't work, but password login works fine, and I don't think any command can actually be executed due to the lack of nohup and a different shell on Windows.

If you have any success stories of using this app with Windows, please share!

Feature request: make individual scripts available as activities

Sorry, I am not an Android developer, just a tinkerer, so I do not know the correct vocabulary for what I'm requesting. It would be great if I could call an individual script from within Tasker. I can do this with RFO Basic, for instance. All I can do with Mercury is launch the app.

Thanks for considering this. Not being a developer, I am clueless about how difficult it would be, or what the downsides might be. I'll certainly continue using Mercury-SSH either way. I'll use it even more if I can automate some of its scripts. This is a feature I'd be willing to pay for.

rsync help

i need a little help to use mercury to backup a directory from my mobile to a debian desktop.
What would be the command line ?
something like that
/usr/bin/rsync -av -e ssh /my-mobile user@$desktop-debian:backup
or
rsync -a --delete /src/ /dst/
but in this case the rsync command is from my desktop?
src : smartphone ?
dst : desktop

Thanks for your help

Android TV

Thanks for this valuable app!

I installed it on my (Sony Bravia) Android TV and it works great with a hardware keyboard or mouse. With the remote control of the TV, however, I can select a command, but unfortunately I can't execute it.

Any idea why this happens?

lockscreen widget

using mercury commands without having to unlock the device would be awesome.

TTY ?

Some commands of mine need a (virtual?) TTY. (Like ssh -t command).
Any idea how to workaround this?

persistent connection

Hello Skarafaz and thanks for this awesome soft.
I mainly use it to send keys with xdotools.
So the connection/deconnection time lessens my experience, and I should like to see an option added for persistent connections in conf files.
Moreover, each of my commands start with

export DISPLAY=':0.0'
The ability to run commands when starting (or stopping) a session would be soooo appreciated.
Arnaudv6

port forward ?

it would be nice to establish a port forward of a service of the remote host locally.
My use case it to access the web interface of my nas that runs on localhost:8081
in the browser on my tablet.

something like I'd do one the command line as
ssh -L 8081:127.0.0.1:8081 -L 8080:127.0.0.1:8080 192.168.1.10

Connection through http proxy

With support for a connection using an HTTP proxy, it would be possible to send commands to SSH servers exposed using Pagekite (https://pagekite.net/), which is an awesome way of exposing an RPi Server at home since Pagekite avoids the need to configure a port forwarding on the router.

I think it is fairly easy to implement, since JSch already supports SSH connection through an http proxy (example at http://www.jcraft.com/jsch/examples/ViaHTTP.java.html).

Thanks!

[],

Renato.

sudoNoPasswd is no known property

Maybe I'm stupid and maybe I have a typo I'm not seeing but it does seem to me as if sudoNoPasswd cannot be used in the config.

{
    "name" : "Pi",
    "host" : "192.168.178.40",
    "port" : 22,
    "user" : "pi",
    "sudoNoPasswd" : true,
    "commands" : [ {
        "name" : "Restart Spotify",
        "sudo" : true,
        "cmd" : "systemctl restart raspotify"
    } ]
}

This leads to the error

Unrecognied field "sudoNoPasswd" (class it.skarafaz.mercury.model.Server), not marked as ignorable (8 known properties: "port", "sudoPath","nohupPath", "commands", "hosts", "name", "user","password"]) ...

Output feature request

Will this app be able to output the results from a command onto the log file or a separate dialog.

Feature rsa key

Hi, can you add feature, thats allow us to connect to the server via rsa key w/o password?

YAML config file

Can you make the config file format to be YAML
It's backward compatible with JSON (with YAML 1.2 release)
YAML reduces the config file size to a greater extent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.