Is there a Mac App or command to autoconnect to SSH? - macos

Right now I'm running a terminal with multiple tabs since I need to ssh into multiple servers to perform different tasks depending on the project. As I said I keep terminal up but it will eventually disconnect or some other hickup requiring me to either login back in or close and reopen terminal (and all my tabs/connections).
I'd like to either:
Open terminal type a command like "connect to webserver" and have it run the ssh command with password
Install an app that does this sort of thing and maybe has some extra functionality (not sure what that would be). Hopefully the app would auto connect and display windows for each connection I specify.

You should use vSSH Lite, Which is free for 2 tabs. Then you have to pay some amount.
Here is the link vSSH Lite

Related

Why does this command not work on Windows via SSH?

I'd like to send websites to be opened on my Windows PC from my MacBook via some automations involving SSH.
The following command works fine when I'm running it on my PC, but it only shows up in the task manager when I run it via SSH.
"C:\Program Files\Mozilla Firefox\firefox.exe" -private-window reddit.com
Tried to use it with the runas command as well.
Any idea?
Thanks.
The SSH session works like a normal user session, except it's not given access to the UI (meanings, SSH has no start button to click on, no firefox window and so)
While firefox DOES PROVIDE a way to run the browser for headless (no UI) sessions, you're still expecting your SSH user-session to do something as your non-ssh user session. This is why you see the process running, but you don't see the window.
Please have a look at different thread on the SE:
https://unix.stackexchange.com/questions/10121/open-a-window-on-a-remote-x-display-why-cannot-open-display
Which explains how to achieve what you want in a different way

Start the websocket server automatically on Windows without a visible command prompt window

I want to start a websocket server, like using the "php artisan websocket:serve", but that automatically start with windows, and without a windows of command prompt. I know how to do it on linux with supervisor, but i need to do that on Windows 7 with Xampp.
I currently use a batch file that starts automatically with Windows, although it works correctly, I wish the command prompt window would not remain permanently visible, since the PC is used for other business stuff, and sometimes the user closes by error the window, stopping the socket server.
Of course, thank you very much for your answers and excuse my bad English.
There are several ways to start windows process without visible console window. First you could create windows service, some software support it natively or you could use utility like NSSM. Second: You could start program via task scheduler and tune task properties. Third: You could use utility like CHP to start program without console window. Remember one thing: If you start program without console window (and it is not a windows service), the only way to stop it is taskkill command or GUI Taskmanager.
To initialize the websocket server on a windows machine, without the command prompt just set autoexec.bat to halt_threads 2.

Run a Applescript on a locked Mac by keypress or alternative options

I have an Applescript written for a specific purpose that launches an application and performs a couple of tasks. I would like to be able to run this script by pressing a key on my keyboard, however, while the Mac is locked. (Note: Mac is only locked, not "asleep")
I'm open to alternative options, if such (or more efficient) options exist.
The above scenario is my "ideal" configuration, the only thing I don't have flexibility on, is that the mac must stay locked for this process.
I have full administrative access to the Mac.
I would suggest you use ssh to "get into" your Mac while the screen is locked and then run your script from the shell. You would probably use osascript for that if it is Applescript, by the way.
In order to do this, you will need to ensure the sshd is running on your Mac by going to the Apple Menu, then System Preferences then Sharing and check the box beside Remote Login.
In order to ssh into your Mac, you could use another Mac, or a PC or the free iPhone/iPad app called Terminus which is brilliant for remotely controlling machines via ssh.
Rather than have to run a command when you log in, a technique which I often use is to have a user who can only execute a specific function and the very act of logging in does that function and then logs the user out again. So, for example, if I wanted a login that can reboot a machine, I would create a new user called reboot and instead of that user having bash in /etc/passwd as his shell, he would have /sbin/reboot as his shell. Just a thought - YMMV.
I've tried this same thing and when the Mac becomes locked, normal processing will not occur but slow to a crawl, so I had to turn my screens off instead of locking my Mac. There is no way around it.

Keep windows GUI while switching windows user or closing remote connection

I need to run a GUI script (AutoHotKey, which makes mouse clicks and press keys) on:
A different windows user (i.e. I run the script, then switch user
while keeping the session active)
A remote Amazon windows server (using remote desktop) where I also
run the script then close the Remote Desktop while keeping the
instance running
Unfortunately, in both cases, the script doesn't run as it seems that Windows enters a "GUI-less" mode where all GUI components are not active anymore.
Is there any solution to this?
Any hint would be greatly appreciated as I've now lost days trying to solve this!
Many thanks, Thomas
I do not believe this is possible due to the way Remote Desktop is implemented. When you close the RD connection, the GUI is no longer drawn. Therefore, AutoHotkey is unable to perform mouse clicks and key presses.
A possible workaround would be to make some registry tweaks (if possible on your server) which allow GUI interaction while minimized.
Locate HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
Create RemoteDesktop SuppressWhenMinimized as DWORD with a value of 2
Registry Tweak Source

Looking for a tabbed terminal emulator for windows. Any suggestions?

I've used Hummingbird Exceed as my Xserver on my windows box for years. I've almost always worked out of xterms, but at times the number of open windows can get a bit out of control and hard to manage. Wondering if there is a terminal emulator that runs on WinXP that supports tabbed windows, similar to Konsole on KDE.
Have you looked at Poderosa ? From the web page
Tabbed style GUI
It is convenient to open multiple connections at the same time.
Moreover, you can split the window
into panes and allocate each
connection. Many different ways to
connect| In addition to Telnet and
SSH1/2, local cygwin shell and serial
ports are supported.
PuTTyCM (PuTTy Connection Manager)
Too bad, its website is down right now, but the hard link still works http://puttycm.free.fr/download/puttycm.exe
Does KDE on Cygwin help?
You could also have a look at Super Putty.
It is similar to PuttyCM with a tabbed layout, but I have found it easier to use for saving and restoring sessions and layouts. Details can be found here
Edit:
My tool of choice for tabbed SSH on Windows now is MobaXterm.
I have used both PuttyCM and SuperPutty before. MobaXterm gives you a lot more options including saving credentials, XWindows support out of the box, ability to reconnect sessions, a sftp browser to copy files and many other useful features.

Resources