I do this any time I'm running updates on my home server. Log in, start a byobu session (similar to screen), then run my updates. If my SSH connection drops, the upgrade doesn't get interrupted and leave my package manager in a state that needs a manual fix.
Also, if you happen to want to browse Reddit without corporate IT knowing what you're up to, you can keep RTV running on a remote server and SSH into it at any time and continue reading where you left off :^)
Yes indeed! I personally have preferred not to use & for this purpose since there are better solutions however. The utility "screen", for example, can be used to create multiple running sessions in the background that can be detached and reattached to anytime, effectively giving you a persistent command line "window". A more featured (and imo way cooler) version of screen is Byobu, and it's what I use personally.
you can also configure it to start up with pre-configured, named windows. or use something like tmux-resurrect - there are a lot of plugins available.
I would use byobu though instead of plain tmux - it's pretty nice.
Using synergy you do not need to switch the keyboard and mouse.
ipython is much nicer to work with than the usual interpreter (tab completion, changing directories etc.). It also has a web interface, which you can start by running
ipython notebook
Other things you might want to look into:
Really cool.
The 'windowing console' is an app called 'Byobu' by Dustin Kirkland.
> Byobu is a Japanese term for decorative, multi-panel screens that serve as folding room dividers. (http://byobu.co/about.html)
But I like to think it means 'Build Your Own Buttugly Ui'
sudo apt-get install byobu
edit : and then : man byobu. Basically you create / navigate panes with the F2 F3 keys.
> I need to get better at tmux.
This near the top of my todo list, I've been fiddling with byobu which seems like it could awesome if I could just find the time to actually use it.
If you have sufficient error handling in the script itself then you should be able to catch any exceptions and allow it to start over again. If you search the sub for 'exceptions' then you'll see a bunch of old related PRAW posts showing how to apply them.
One example that the author has linked to before is this.
Along the same lines as what TheSox mentioned, I'd recommend using byobu (Linux package) as it allows you to have multiple 'screens' (like tabs) in the terminal. Handy for leaving a long-running script open in one tab, then others for general use (viewing logs, apt updates etc).
For logging I use something like
0 * * * * /usr/bin/python3 /home/me/bot/bot.py >> /home/me/bot/bot.log 2>&1
What makes you say the SSH tunnel will drop more than any other protocol? And how would this lock you out if autossh reconnects SSH automagically?
You can use ServerAliveInterval inside the SSH connection which should keep it up, barring any network disturbances, but that would interrupt other protocols too.
Then you can use screen (or byobu which looks pretty cool, see: http://byobu.co) to keep your reverse shell just the way you want it.
I guess if you wanted to go hard core you could attach a 4G dongle to the laptop and have completely OOB communications with the laptop, but going by the OP I'm assuming the laptop is allowed to be connected to the network and therefore is allowed to use normal outbound communications. (but if the pentest client blocks outbound SSH or drops long-lived sessions, then the OOB modem would be needed, of course with permission and disclosure because you're essentially bridging their internal network to the public internet which is generally uncool)
Yup. You'd run screen within your ssh client (putty for example) and it gives you multiple terminal windows as well and split screen options. It's fantastic. That said, I'd actually check out byobu. Best of screen and tmux. Virtual terminal managers like that take a minute to get used to but it's worth it once you've got a handle on it. I usually have to have 4+ ssh tunnels running at a given time and byobu lets me do that with ease. It's even easier when you're just flipping between virtual terminals on the same server. There are also GUI-tabbed ssh clients like KiTTy that replace Putty, but if you're doing work with sensitive data.. I don't know how well audited the code is.
Sounds great. I'm able to hack together some of the session management features you mentioned with things like tmux-ressurect/tmux-continuium (for saving and restoring shell sessions) and other plugins on that page (for naming and switching between sessions quickly); Or byobu, and some scripts. Thought I'd link to them in case you haven't heard of them (you probably have).
The rest of the features you mentioned I don't know of any present day solutions to. I'd like to see them implemented, though.
There's a nice demo on the Byobu home page. Very, very, very useful if you're running headless linux servers. TL;DW: start byobu, start factorio, hit ctrl-A and then type the letter d, log off the server normally and factorio continues to run. You can get back to that shell session where factorio is running by logging back in and typing byobu again, just like you had the terminal open the whole time. Skip to 4:30 in the demo to see this functionality.
byobu provides an elegant solution for situations like these.
It has a concept it calls window sets which allows one to define a list of "windows" to launch when instantiating a byobu session.
For instance, using your example, you would first create a $HOME/.byobu/windows.tmux.config file that contains all the commands you wish to execute:
new-session -s config -A -n whatever 'vi file' new-window -t config:2 -n 'whatever' 'vi file' new window -t config:3 -n 'whatever' 'vi file'
Then, to invoke this window set, you'd run
BYOBU_WINDOWS=config byobu
http://byobu.co/ Byobu is a GPLv3 open source text-based window manager and terminal multiplexer. It was originally designed to provide elegant enhancements to the otherwise functional, plain, practical GNU Screen, for the Ubuntu server distribution. Byobu now includes an enhanced profiles, convenient keybindings, configuration utilities, and toggle-able system status notifications for both the GNU Screen window manager and the more modern Tmux terminal multiplexer, and works on most Linux, BSD, and Mac distributions.
Byobu! (an enhanced Gnu screen) is a boost for your terminal experience, its something like a window manager for terminals. You can switch around different terminals and even tile them in one terminal. On some systems you have to compile it yourself, but most distros have it in their repositories (I remember compiling it on CentOS 7).
I don't use tmux directly. I personally love Byobu and have used it since it was based on screen (I kind of preferred the screen UI over the tmux one though).
After I first started using byobu I couldn't go back to plain shells. I have to have it on everything now. It's just too convenient to not have.
I use a separate gnome-terminal with Byobu in addition to Emacs. Byobu is a wrapper for GNU screen or tmux and has some nice keybindings and a status display. There are two main things which have prevented me from switching to Emacs for my shelling:
There may be a way to solve the former problem, but since Emacs steals key bindings, the latter is hard to Emacs-ize. It's annoying when I want to send C-c to the terminal and Emacs eats it. I find it easy enough to alt-tab between the windows (frames).