I'm trying to automate the launch of SSMS to automatically load my Solution file and connect to two servers.
I have the file bit working, but can only make it connect to one server.
I use the -S parameter in the command line, but when I use more than one, it only uses the end one.
Is there a way to use -S to connect to multiple servers?
Code:
c:\ssms.exe -E -S myServer\myInstance -S myOtherServer\OtherInsance
"c:\mySol.ssmssln"
Check SSMSBoost add-in that I develop. It allows to auto-connect servers during start-up, also it has "Workspaces" - lists of documents with connections, that can be loaded with 1 click. Restore previous session is also included.
Related
I'm able to connect and interact with a hive database on the Putty terminal. But I'm clueless about how to do it on Datagrip.
These are the steps that I'm using for Putty:
Starting a session through SSH-type on the host(HostName) and port(22), which opens a terminal, and there I feed my login details.
Then, I invoke a batch script on the remote server ssh session which then calls other .sh scripts, this step sets the path for various environment variables and defines a lot of hive configurations. At completion of this batch file I can see a "hive>" on the terminal, indicating I can run sql queries now.
Is there any way, I can get Datagrip working in this environment and setup driver location, work directory, home directory, everything on the remote server. And call this batch script from Datagrip itself.
Servers aren't visible, they are hidden behind another server. In order to make them visible you have to log into the first server over ssh. Once there the other servers are visible and you can ssh into them from the current server (the one you just logged into/ssh'ed into).
I want to be able to run commands on the very last server in my script.
Is it possible to SSH into one server, than ssh into the next server from the current server we ssh'ed into using phpseclib and run commands?
It looks possible in the libssh2 examples for ssh2 functions on the PHP man pages so I was hoping it was possible with this library as well. Anyone had similar requirements?
Thanks.
You could do $ssh->exec("ssh user#domain.tld 'ls -l'");. I don't think you could do much more than that even with libssh2. If you can could you update your orig post to include an example?
I'm using WinSCP to interact with a remote server that supports only SFTP and doesn't allow SSH access.
My interaction involves moving/deleting a subset of files (identified by file names) in a certain directory.
To simplify this, I would typically synchronize [ Remote -> Local ], delete the files locally using the cygwin commandline (so that I can specify a list of file names instead of selecting files in the GUI) and then synchronize [ Local -> Remote ] to push the deletes to remote.
But, now, I want to further simplify the process so I can hand this over to an operations person. I went looking and was delighted to find that WinSCP supports 'commands'.
It would be great if I could enter something like this in the 'Command' field at the bottom in the 'Commander' view of WinSCP:
get queue-queue-from-DLQ-ID-69703273-db51-11e1-ba9f-005056010165 \
queue-queue-from-DLQ-ID-3d64697a-db51-11e1-b86e-005056010166 \
queue-queue-from-DLQ-ID-76fdb365-db50-11e1-b78d-005056010164 \
queue-queue-from-DLQ-ID-76ed3836-db50-11e1-ba9f-005056010165
But when I enter this in the 'Command' field, I get the following error:
Current SFTP-3 session does not support command you request. Separate shell session may be opened to process the command. Do you want to open separate shell session?
When I hit ok, I get the following error:
Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).
The latter one is probably due to the fact that SSH is not supported.
But my question is, since get is an SFTP command, why am I getting the first error? Doesn't WinSCP itself use that command under the covers to support a GUI 'copy to local' operation?
How can I configure either WinSCP or the Linux box so that I can do what I have shown above?
I guess this answers my question: http://winscp.net/eng/docs/remote_command
Apparently, the 'Command' feature is only supported for SCP.
I wonder why WinSCP can't expose a commandline interface for SFTP operations that are generally supported during an sftp interactive session.
You can use WinSCP command-line scripting interface to run the get command.
https://winscp.net/eng/docs/scripting
The 'Commands' feature (remote commands execution) is supported even for SFTP protocol. But this feature executes the command on remote server. You cannot use this feature to automate WinSCP. And there's no remote command that you can easily use to download file.
See https://winscp.net/eng/docs/remote_command
I have a folder with 30000 files. I want to copy 1000 files a time via SSH to another folder. I need to do that cause my script is timing out when I try to run it on all 30k.
Is that possible?
EDIT
Based on the comments.
I connect via putty. The script is executed from the user by clicking a button and it not the problem. I just want to move the files in batches and I don't want to do it via ftp.
Like the LIMIT command in SQL (LIMIT 0,1000 or LIMIT 1000,2000)
The best way to copy over ssh is by using scp (pscp in putty)
pscp.exe -r somedir me#server:/data/vol1
pscp.exe uses all settings from putty including authentication keys.
So I have been working on this for some time. Would like to know if there is a better way or if I am on the right track.
I would basically like to allow some users to login to my server via SSH and then have a squid tunnel via that SSH connection.
The tricky part however is that I dont want these users to be able to execute ANY commands. I mean NOTHING at all.
So at this stage I have setup a Jail via - jailkit. The specific user is then placed in the jail and given the bash shell as a shell.
The next step would be to remove all the commands in the /jail/bin/ directories etc so that they are not able to execute any commands.
Am I on the right path here? What would you suggest?
Also...I see that it will give them many command not found errors...how do I remove these.
Is there any other shell I could look at giving them that would not let them do anything?
You could set their shell to something like /bin/true, or maybe a simple script that will output an informational message, and then have them logon using ssh -N (see the ssh manual page). I believe that allows them to use portforwarding without having an actuall shell on the system.
EDIT:
The equivalent of ssh -N in PuTTY is checking the "Don't start a shell or command at all" checkbox in its SSH configuration tab (Connection->SSH).
EDIT2:
As an alternative to this you could use a script that enters an infinite sleep loop. Until it is interrupted using Ctrl-C the connection will remain alive. I just tried this:
#!/bin/sh
echo "DNSH: Do-Nothing Shell"
while sleep 3600; do :; done
If you use this as a shell (preferrably with a more helpful message) your users will be able to use port-forwarding without an actual shell and without having to know about ssh -N and friends.