GithubHelp home page GithubHelp logo

salt_remote_shell's Introduction

salt_remote_shell

My development has halted, no time :(

salt remote shell tty hacking

this is crap and unsafe! dont use in production!

Next steps

  • #1
  • use salt as the communication transport vs directly using socket.
    • perhaps salt creates a /var/salt/minion_streams/minionid_cmdpid.socket
  • creating salt-tty to automate standing and connecting to remote program stream
  • support terminal things like changing screensize, keyboard cmds like ctrl+c

perhaps helpfull to review:

master or frontend runs

nc -l 4444

or use python as the shell...but my code blocks and dont work :(

cat > srv.py <<EOF
import socket, sys, time
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((socket.gethostname(), 4444))
s.listen(1)
(conn, addr) = s.accept()
print 'Connected by', addr
## blocks :(
sys.stdout = conn.makefile("r")
sys.stdin = conn.makefile("w", 0)
while 1:
   time.sleep(1)
EOF
python srv.py

minion runs somthing like

# run program (bash, sh, cmd, powershell)
cat > srv_shell_ep.py <<EOF
import socket, subprocess
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('salt.host', 4444))
pip = s.makefile("rw")
p = subprocess.call("/bin/bash -i".split(' '), stdin=pip, stdout=pip, stderr=pip)
EOF
python srv_shell_ep.py

salt_remote_shell's People

Contributors

steverweber avatar

Watchers

James Cloos avatar  avatar

salt_remote_shell's Issues

some pickle issue in windows

[root@salt ~]# salt windows\* remote.shell_unsafe
windows:
    The minion function caused an exception: Traceback (most recent call last):
      File "salt/minion.py", line 797, in _thread_return
      File "c:\salt\var\cache\salt\minion\extmods\modules\remote\__init__.py", line 45, in shell_unsafe
        ps.start()
      File "multiprocessing/process.py", line 130, in start
      File "multiprocessing/forking.py", line 277, in __init__
      File "multiprocessing/forking.py", line 199, in dump
      File "pickle.py", line 224, in dump
      File "pickle.py", line 331, in save
      File "pickle.py", line 419, in save_reduce
      File "pickle.py", line 286, in save
      File "pickle.py", line 649, in save_dict
      File "pickle.py", line 681, in _batch_setitems
      File "pickle.py", line 286, in save
      File "pickle.py", line 748, in save_global
    PicklingError: Can't pickle <function _run_proccess at 0x0000000002BFFA58>: it's not found as salt.loaded.ext.module.remote._run_proccess

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.