remote-access

Passing a variable to a remote host in a bash script with ssh and EOF [duplicate]

半世苍凉 提交于 2019-11-27 09:20:58
This question already has an answer here: Passing external shell script variable via ssh 2 answers I have a script parsing a list of servers, looking for some stuff and executing commands if the circumstances are correct. The main server is connecting to them via ssh, executing all commands that are in the EOF statement: #!/bin/bash # parsing servers # defining one local variable $VAR ssh -T -p 1234 root@"server-ip" "$variable" << 'EOF' # doing some stuff... var_result=$(mysql -hhost -uuser '-ppasswort' -Ddatabase -N -e "SELECT something FROM somewhere WHERE value=$VAR;") EOF I know the

How do I pass credentials to a machine so I can use Microsoft.Win32.RegistryKey.OpenRemoteBaseKey() on it?

我的梦境 提交于 2019-11-27 08:42:16
This .NET API works OK if I'm trying to open the Registry in a machine that's in the same domain as I am (and my logged-on user has admin rights on the target machine). It gets tricky if it's an out-of-domain machine with a different, local administrative user (of whom I do have the password). I tried to use WNetUseConnection() (which has served me well in the past in situations where what I wanted was to read a remote disk file) prior to calling OpenRemoteBaseKey(), but no dice -- I get an access denied exception. Clearly, I must pass credentials some other way, but how? What I've used

How Connect to a Azure Windows VM and run a remote script with PowerShell?

青春壹個敷衍的年華 提交于 2019-11-27 08:24:05
问题 I am familiar with Linux envs and using SSH to run remote scripts and programs and automatic scripts from my desktop. I would like to have a similar workflow with Windows VMs that I have on my Azure Account. However, I can´t find a straight forward instructions on how to build my local PowerShell scripts. I need only to connect to a VM and call some scripts within it. The best I could find would be this guide from MS https://docs.microsoft.com/en-us/azure/virtual-machines/windows/winrm Or

Unable to access an instance of SQL Server 2008 R2 remotely

六眼飞鱼酱① 提交于 2019-11-27 07:57:16
问题 A very mysterious problem coming up :P I have a server configured with a static IP. I have installed SQL Server 2008 R2 with additional instance (ITAPP). Now When I use the IP to access the SQL Server following things happens: Client Machine: sqlcmd -S XXX.XXX.XXX.XXX -U sa -P mypass Connected Successfully.... But when I use: sqlcmd -S XXX.XXX.XXX.XXX\ITAPP -U sa -P mypass HResult 0xFFFFFFFF, Level 16, State 1 SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].

How to get remote access to a private docker-registry?

巧了我就是萌 提交于 2019-11-27 06:07:24
I'm trying to setup a private docker registry using the image taken from: https://github.com/docker/docker-registry Just by running: docker run -p 5000:5000 registry I can pull/push from/to this repository only from localhost, but if i try to access it from another machine (using a private address on the same LAN) it fails with an error message: *2014/11/03 09:49:04 Error: Invalid registry endpoint https ://10.0.0.26:5000/v1/': Get https:// 10.0.0.26:5000/v1/_ping: Forbidden. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 10

Copy file to remote computer using remote admin credentials

断了今生、忘了曾经 提交于 2019-11-27 04:26:24
I am using C#... I need the ability to copy a set of files to about 500 unique computers. I have successfully been able to use the LogonUser() method to impersonate a domain account that has the required permissions to copy the files. The destination path for the files is something like: \\RemoteComputer\C$\SomeFolder My questions is...is there a way to do this without having to use an all-powerful domain account (these computers may not be joined to the domain in the future)? I have the local administrator accounts for every computer...is there a simple way to copy a file to a computer using

Check status of services that run in a remote computer using C#

末鹿安然 提交于 2019-11-27 04:21:35
问题 I'm using the following code. ServiceController MyController = new ServiceController(); MyController.MachineName = server_txt.Text.Trim(); MyController.ServiceName = "Service1"; string msg = MyController.Status.ToString(); Label1.Text = msg; This code works fine for network computers where I have access. How to change this so it works for the systems in different domains using credentials? 回答1: If you use WMI, you can set the credentials in 'ConnectionOptions'. ConnectionOptions op = new

Wait until task is completed on Remote Machine through Python

ⅰ亾dé卋堺 提交于 2019-11-27 01:58:30
问题 I am writing a program in python on Ubuntu. In that program I am trying to print a message after completing a task "Delete a File" on Remote machine (RaspberryPi), connected to network. But In actual practice, print command is not waiting till completion of task on remote machine. Can anybody guide me on how do I do that? My Coding is given below import paramiko # Connection with remote machine client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client

Can't connect to Postgresql on port 5432

烈酒焚心 提交于 2019-11-27 01:18:00
问题 I have PostgreSQL 9.3 installed on a server running Ubuntu Server 14.04. If I ssh into the server via terminal, I'm able to connect with psql. But when I try to configure pgAdmin III to do the remote connection, I get: Server doesn't listen The server doesn't accept connections: the connection library reports could not connect to server: Connection refused Is the server running on host "172.24.3.147" and accepting TCP/IP connections on port 5432? When I run on the server service postgresql

MySQL remote connection fails with “unknown authentication method”

穿精又带淫゛_ 提交于 2019-11-26 22:57:55
I am trying to remotely connect to MySQL server online from my local machine, but I am getting the following error: Warning: PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password] in C:\xampp\htdocs\ticket\terminal\sync.php SQLSTATE[HY000] [2054] The server requested authentication method umknown to the client My local MySQL server version is 5.5.27, libmysql - mysqlnd 5.0.10 The remote MySQL server version is 5.5.23, the mysqlnd version isn't exposed. I guess it's an incompatible password hash issue, but I do not know how to resolve it. Below