How to reload stunnel configuration with command line? - stunnel

Is there a command line to reload stunnel configuration file when the stunnel is running?
I start stunnel by command line. But I don't find any methods that can dynamic change its configuration.
Edit:
According here of Version 5.15, 2015.04.16, urgency: LOW:
New commandline options "-reload" to reload the configuration file and "-reopen" to reopen the log file of stunnel running as a Windows service (thanks to Marc McLaughlin).
It seems already have the command line, but I couldn't reload it.
Is my step wrong?
My test steps as following.
Enter dos mod
c:\stunnel\stunnel.exe -start
change the stunnel.config
c:\stunnel\stunnel.exe -reload
I only saw the stunnel pop-out window at step 4. But it does not reload.

How stupid I am, I found I use an older version stunnel.
It works when I change the to version 5.25.

Related

VS Code Remote SSH Connection not working

Im trying to setup vscode with the remote developement extensions on a second pc. While it works on my main one it doesnt on the second one. Tried reinstalling vscode, extensions and using older versions but nothing works.
When trying to connect it cancels after chosing the os. So I cant even type in the password.
I set it up in the exact same way as with the other pc.
Any ideas?
[20:32:53.595] remote-ssh#0.55.0
[20:32:53.595] win32 x64
[20:32:53.596] SSH Resolver called for "ssh-remote+ssh.blabla", attempt 1
[20:32:53.597] SSH Resolver called for host: ssh.blabla
[20:32:53.597] Setting up SSH remote "ssh.blabla"
[20:32:53.610] Using commit id "58bb7b2331731bf72587010e943852e13e6fd3cf" and quality "stable" for server
[20:32:53.612] Install and start server if needed
[20:32:54.639] Checking ssh with "ssh -V"
[20:32:54.686] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[20:32:54.691] Running script with connection command: ssh -T -D 52819 ssh.blabla bash
[20:32:54.694] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[20:32:54.758] >
]0;C:\WINDOWS\System32\cmd.exe
[20:32:54.758] Got some output, clearing connection timeout
[20:32:54.785] >
[20:32:55.045] > root#blabla's password:
[20:32:55.045] Showing password prompt
[20:32:57.596] "install" terminal command done
[20:32:57.597] Install terminal quit with output: root#blabla's password:
[20:32:57.597] Received install output: root#blabla's password:
[20:32:57.598] Stopped parsing output early. Remaining text: root#blabla's password:
[20:32:57.598] Failed to parse remote port from server output
[20:32:57.603] Resolver error: Error:
at Function.Create (c:\Users\Manuel.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:1:130564)
at Object.t.handleInstallOutput (c:\Users\Manuel.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:1:127671)
at I (c:\Users\Manuel.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:127:106775)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async c:\Users\Manuel.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:127:104774
at async Object.t.withShowDetailsEvent (c:\Users\Manuel.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:127:109845)
at async Object.t.resolve (c:\Users\Manuel.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:127:107960)
at async c:\Users\Manuel.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:127:141955
[20:32:57.606] ------
[20:32:59.376] Password dialog canceled
[20:32:59.376] "install" terminal command canceled```
Depending on the system you are in, when you first try to connect, a vscode-server will be set up and configured on your server.
In linux that can be in /Home/<user>/.vscode-server
If you are on windows, check what that is.
The first solution is to try the extension command: Remote-SSH: kill VS Code Server on Host
Open the command pallet (CTRL + SHIFT + P or COMMAND + SHIFT + P (mac) ).
And type Remote kill :
Then try to connect again! (That will kill the server on the host! Which will make it start again on the next try)
If that doesn't work, and things are still failing:
Delete, rm
Then a good solution that can work is: to connect to your server through terminal (vscode terminal, gnome-terminal, whatever). Then go and remove /Home/<user>/.vscode-server
Try to connect after that. At the attempt the server will be re-installed completely anew, chances are it will work. (I did that and it worked for me, so whatever that was going wrong on the vscode-server: just start all over)
But again: you will lose things, config, meta data, etc. (because you start anew).
Update:
As stated by #natevw in the comments:
I found that removing only the .vscode-server/bin subfolder helped straighten things out and afaict kept my data/settings.
Removing only vscode-server/bin seems to work well, and the config, metadata, etc. remains untouched.
I downgrade Remote-SSH plugin to 0.51.0, rm -rf $HOME/.vscode-server on the remote machine. Connect again, VSCode will download and install a new .vscode-server. Then upgrade Remote-SSH plugin, everything works.
One way worked for me is, by adding this line in the vscode settings (JSON) file.
"remote.SSH.useLocalServer": false
I met the same problem. After I did these steps, it works:
on the remote server:
rm -rf ~/.vscode-server
rm -rf ~/.vscode
On the local VS code:
reinstall remote-ssh
In case all the above fails, here's how I fixed my issue.
First, I was able to SSH into my remote server (Ubuntu 22.04, Raspberry Pi 4, arm64) using a simple bash terminal. So I logged in using my terminal (macOS), and I went to
cd $HOME/.vscode-server/bin/WHATEVER-HASH-YOU-HAVE/
In this directory, there is a file named server.sh. I tried running this script, and I got the following error:
./node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
The issue was clear: there was a missing shared library on my system. Either Node.js now requires that or the new version of the SSH-Remote extension; I don't know. I did not spent the time to dig into those specifics.
But to fix that, I simply did:
sudo apt-get install libatomic1
That installed the missing shared library.
After that, I delete $HOME/.vscode-server:
rm -rf $HOME/.vscode-server
and tried again connecting using VSCode. It worked!
Hope this can help someone like me, for whom all other options failed.
Issue: while trying to ssh connect to Linux(remote machine) using vscode.
Solution: remove/delete the bin folder inside .vscode-server and then reconnect to the remote machine
In remote server:
remote_name:~$ rm -rf ~/.vscode-server/bin
*reconnect to remote machine*
It turns out that my fish was a obstacle for vscode server.
Then I tried
chsh -s /bin/bash
And works fine.
I worked adding \\ in the path of the .config
I share the steps
Go to .config settings
select configuration
add double \\
Just deleted old host information from ssh settings file and problem solved.
I had faced this issue when I tried to connect to a Linux server from a windows laptop.
It was using the wrong fingerprint.
It worked for me after removing the line related to that server from $HOME/.ssh/known_hosts
I ran into the same issue, it got fixed when I updated the path of the IdentityFile from 'ssh_key' to '~/.ssh/ssh_key' (the entire path I mean) so that the VS code could recognize it.
Restart remote machine worked for me (after trying all the previous answers with no luck).
Giving you the oldest trick of the book:
restart
It worked for me and I laughed hysterically for exactly 57 seconds. Happy reconnecting to the server my dear Coder!
I could not connect to the server, my issue was the remote server was full
check with the command df -h if the disk is full !
Here is an alternative for Remote SSH, pls check my answer at: https://stackoverflow.com/a/68046111/13089935
TLDR:
We can use a web-based VS Code that is installed on the server directly.

KeePassXC won't add keys the running SSH agent when started from the gnome shell

I am running on Pop!_OS so for most things this is likely an aquivalent of Ubuntu.
KeepassXC is installed and the SSH-Agent is enabled.
There is a keyphrase configured with a key and it works just like a charm when I start keepassxc from the terminal keepassxc log in and then I can see that ssh-add -l lists an additional key. It also vanishes once I close KeePassXC. Perfect!
Now I start keypassXC from the gnome shell, hit the super key, search for keepassXC and log into its vault. Looking at ssh-add -l in the terminal: Nothing. No keys added. 😔
Now I took a look at /usr/share/applications/org.keepassxc.KeePassXC.desktop and changed Terminal=false to true. No, sadly not that easy.
My guess that it has something to do how the gnome shell starts KeePassXC, but can't say for sure what the problem is. Anyone got a clue what that could be or how to take a shot at the problem?
I got the KeepassXC ssh agent working on Ubuntu 16.04.6 with Unity as the window manager.
The issue is that if the SSH_AUTH_SOCK environmental variable is not set before the window manager starts it is not available for programs started in the window manager.
Some distributions have a system for starting programs such as the ssh-agent before the window manager. On my distro I found that /etc/X11/Xsession.d/90x11-common_ssh-agent was starting ssh-agent. See this comment on a user help issue for KeepassXC for more information.
However I also found that GNOME Keyring was starting an ssh agent of its own. I had to disable this in the startup applications. I also checked that no shells startup scripts (ie. .bashrc .bash_profile .profile .config/fish/config.fish were trying to start the ssh-agent, as doing so would replace the one started before the window manager.
An interesting side note, the ttys, that you get to with Ctrl+Alt+F1, Ctrl+AltF2, etc., also do not have the SSH_AUTH_SOCK environmental variable set as they start up before the window manager. If you need it here you can add code to find and set the SSH_AUTH_SOCK. For the fish shell I added the following to ~/.config/fish/config.fish:
# Set SSH_AUTH_SOCK if not set.
if test -z "$SSH_AUTH_SOCK";
set -gx SSH_AUTH_SOCK (find /tmp/ -path "/tmp/ssh-*/agent.*" 2>/dev/null)
end
I also found that in the upcoming 2.6.0 release of KeepassXC (targeted for 3. April 2020), there will be an added settings to allow overriding, or settings the value to use for SSH_AUTH_SOCK. However as this changes each time ssh-agent starts you will either need to keep changing it or set-up a link that would point to the current sock.

Jboss EAP 6 CLI Script with commands that require reload

I'm working on a cli script for JBoss EAP 6 (just a bunch of commands in a .bat file).
Now I'm running into issues with commands that rely on each other, where the former sets the server to a "reload-required" state.
For example:
first command: remove default-datasource ExampleDS. Outcome: success, server in state "reload required"
second command: remove h2-driver (required by default datasource). Outcome: failed, since server has not been restarted yet.
I've tried to place a reload command in between, but it seems as if the server is not completely up when the second command gets executed. Outcome still is failed, although if I try it a few seconds later, it works.
/subsystem=datasources/data-source=ExampleDS:remove
reload
/subsystem=datasources/jdbc-driver=h2:remove
Any suggestions how to make the CLI wait until JBoss is completely up again?
Try batching those commands together and doing a reload after you run the batch. For example:
batch
/subsystem=datasources/data-source=ExampleDS:remove
/subsystem=datasources/jdbc-driver=h2:remove
:reload
run-batch
Another option is to run the server to start the server in admin-only mode while configuring it. You should need the reload command in that case, but if you do make sure you use :reload(admin-only=true) until you're done configuring the server.
%JBOSS_HOME%\bin\standalone.bat --admin-only
rem Wait until server is started, then execute the CLI commands
%JBOSS_HOME%\bin\jboss-cli.bat -c --commands="/subsystem=datasources/data-source=ExampleDS:remove,/subsystem=datasources/jdbc-driver=h2:remove"

mysql daemon install as a service on windows

I just downloaded mysql 64 bit as a zip package from their website, extract it to c:\mysql
and added c:\mysql\bin to my path.
I then open a command prompt as administrator and run:
mysqld -install
To install the mysql server as a service. I then go to windows services and start MySQL (also tried sc start MySQL from cmd), but I get the following error message:
Upon inspecting the properties of the service, it shows the path as C:\Program Files\MySQL-5.6.17\bin\ instead of C:\mysql\bin. Any ideas why this is happening?
Use the FULL PATH of your mysql server exe
Try this:
"C:\mysql\bin\mysqld" -install
It turns out that the service installation routine expects the .exe to be at the MySQL default installation directory of C:\Program Files\MySQL-5.6.17\bin\
Your installation with the straightforward mysqld -install could work, albeit only partially, because you had the correct path under Windows PATH
This is certainly a great inadequacy in the MySQL documentation, which does not address this issue at all.
Knowing you might have resolved your problem one way or another, I still thought to post this here as it might be of help to someone with time!
Cheers.

restart openerp 7 server on Xubuntu

I am coding a custom module on Oerp7 on Xubuntu 12.04, and today, suddently (after some moduifications in the code I think), the restart server command still do not affecting my module.
i restart with this command :
sudo /etc/init.d/openerp-server restart
but the compiled (.pyc) files stayed unchange.
If I delete the module in the addons dir, the module don't properly work giving me a message saying that models are absent. that is normal; but why restart don't change anything. even if I modify the init.py or openerp.py files.
According tome is as restarting by this command now make nothing, while yesterday it did.
So, please, how could I fix that now.
You need to have -u modulename in the command line that starts the OpenERP server. So either modify the /etc/init.d/openerp-server script to have it there, or just start the server manually while you are developing.
Try
sudo /etc/init.d/openerp-server stop
ps aux | grep openerp
to see if the server really stopped.
Start the server with
sudo /etc/init.d/openerp-server start
Look also in the logs (/var/log/openerp/openerp-server.log for ex.) to see what heppens.