FAQ Database Discussion Community


How to open a new terminal from my working terminal with same directory in Linux?

linux,unix,ssh
Is there any command to open a new terminal from my working terminal with same directory while working with ssh in Linux? e.g., I am working in the following terminal. My pwd is /home/work/Kayan01/test_run I want to open a new terminal directly from my working terminal, so that the pwd...

Creating a Virtual Machine on Bluemix, is giving an error while importing ssh key [closed]

ssh,openstack,bluemix
I am following the steps to create Virtual Machine on Bluemix following the steps as below. https://www.ng.bluemix.net/docs/starters/index-gentopic4.html#vm_ssh_key I am blocked when I am trying to configure a SSH key. I am using an existing key pair which I use with my other machines. I get an error "Keypair data is...

Vagrant asks for password after SSH key update

ssh,vagrant
I remade my SSH key after switching to a new machine and just copied over my existing customized Vagrant box I packaged up. When I tried to ssh into the box, I got the REMOTE HOST IDENTIFICATION HAS CHANGED error. So I cleared the entry out of the known_hosts and...

How to create VM instance in Google Compute Engine?

linux,ssh,virtual-machine,google-compute-engine
I am new to Google Compute Engine. I want to create a Web Server having following properties: 1 Core Red Hat Enterprise Linux 7.1 64 bit RAM 8 GB HDD: 100 GB SSH, JDK 1.7 Apache Web server as the proxy to Jboss App Server Enable HTTP / 80 and...

JSCH: No such file error

java,ssh,jsch
I have windows machine with running ssh server. I know the path on that machine. Let it be D:/Folder1/Folder2. I'm creating sftp channel using JSCH. But when i try to cd to D:/Folder1/Folder2, "No such file: 2" error is throwed. can anyone please help? May be i need to convert...

SSH Config are ignored by git client

git,ssh,gitlab
I interact with two different git repositories, both of them are GitLab implementation. Since I need to use different users (and e-mail) to access them, I created two ssh keys: let's say id_rsa_1 and id_rsa_2. After that I wrote a ~/.ssh/config file to specify when each id_rsa file should be...

Java and SSH looking to execute multiple commands from a file, across a list of hosts in another file and write the output to a file

java,ssh
“my-thoughts” Provided the code below. but it’s not working 100%. 1) if I have more than one command, the program won’t run. 2) one command in the command file, the script won’t execute properly. for example with “ls” the log file will have the following "Last login: Tue Jun 9...

Streaming/Tailing data over SSH using C# with SSH.NET leaks memory

c#,ssh,tail,ssh.net
I'm trying to tail a file over SSH using C#. This file with be read from the beginning and then continue to be monitored for hours at a time maintaining the SSH connection. I'm using SSH.NET library to provide the functionality to SSH. The file size can be anywhere up...

Python subprocess throws [Errno 2] No such file or directory, error generated only when it on a remote host

python,linux,ssh,subprocess,python-2.6
I'm running python 2.6. I'm getting the subprocess throws [Errno 2] No such file or directory only when I run the script via ssh. For example, if I run the script manually on the machine, there are no errors, but if I do ssh hostname script.py --host hostname it generates...

Capistrano deploy with bitbucket - Permission denied (publickey)

git,ssh,bitbucket
After adding public key to bitbucket acct, ssh -T [email protected] returns (in windows): The authenticity of host 'bitbucket.org (131.103.20.167)' can't be established. RSA key fingerprint is 65:8c:1b:f2:6f:91:6b:5c:3b:ec:4a:46:46:74:7z:40. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'bitbucket.org' (RSA) to the list of known hosts. logged in...

Multiple SSH Clients on Mac

osx,ssh,path
I have multiple SSH clients on my mac, one is at /usr/local/bin//ssh and the other one is at /usr/bin/ssh I want to use /usr/bin/ssh always! My PATH looks like: /usr/local/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin I am wondering how to set default SSH to /usr/bin/ssh without modify the PATH?...

ruby: running a command from a forked child process

python,ruby,ssh,io,fabric
I've the following snippet of code: job1 = fork do ret = `some_bash_script_running_python_fabric_task` end Process.detach(job1) This code is aimed at daemonizing a process, so the parent exits while child keeps running in background. I get as a result a python exception stating termios.error: (5, 'Input/output error'). I figured out that...

How to execute command line file on remote server?

linux,command-line,ssh
I have a staging script where I want to execute some operations on the remote machine. But when I use ssh ${REMOTEUSER}@${REMOTEHOST} the next line mkdir folderwon't work. The script stops and I end um in the Command Line of the remote server. How do I get the other commands...

Python (3.4) run SSH commands on local terminal [closed]

python,ssh,terminal
I'm writing a script that I'm running through a terminal, and would like it to run BASH commands in that same terminal. All solutions that I found were geared toward connecting remotely through SSH, whereas I just need to run SSH commands on the same machine. Can someone please point...

ssh result seems to only be 16bits in python with paramiko

python,ssh,paramiko
im using paramiko in python 2.7 to connect to a cisco router, send a command and then parse the output of the command in a for loop. the problem seems to be that the returning result is limited to 65535 characters (16bits). I printed the output and pasted it in...

Run Kubernetes on EC2

ssh,amazon-ec2,coreos,kubernetes
I am trying to run kubernetes on EC2 and I used CoreOs alpha channel ami.I configured Kubectl ssh tunnel for the communication between Kubectl client and Kubernets API. But when I try kubectl api-versions command, I am getting following error. Couldn't get available api versions from server: Get http://MyIP:8080/api: dial...

Capture SSH Response to variable

c#,c#-4.0,ssh,ssh.net
I am currently trying to "talk" to a router using SSH commands via C#. I am using the SSH.net model. public void connectSSH(string hostName, string username, string password) { using (var client = new SshClient(hostName, username, password)) { client.Connect(); client.RunCommand(CommandList.showEnvironment()); client.Disconnect(); } } This is the code I have so...

FIPS integrity verification test failed when iniating SSH session

ssh,openssl,centos,centos6,fips
I recently enabled the FIPS module under CentOS 6 (minimum install). Module is confirmed working: cat /proc/sys/crypto/fips_enabled yields 1 openssl md5 somefile(fails) and openssl sha1 somefile(succeeds). openssl version yields OpenSSL 1.0.1e-fips 11 Feb 2013 When I attempt to ssh into a box I connect to daily, I now see a...

Android-Studio git over ssh

android,git,ssh
I got a git-server on my Raspberry Pi with gitweb as webinterface. Its working so far. Now I want to connect via Android Studio with the built-in ssh to it. My project dir is : /home/git/straff.git I'll connect with this command from Android Studio: :ssh:[email protected]:/straff Android Studio is giving me...

net::scp copy/overwriting folder

ruby,ssh,scp
Say you copy folder f_1 from your local machine to target machine m_1 into the /tmp directory as mf_1. console: [[email protected]_1 tmp] ls -a | grep mf_1 # => doesn't exist irb: options = {recursive: true} Net::SCP.upload!(host, user, '~/f_1', '/tmp/mf_1', options) console: [[email protected]_1 tmp] ls -a | grep mf_1 #...

How to set up two SSH keys for two GitLab accounts and push/pull by using TortoiseGit?

git,ssh,key,gitlab,tortoisegit
Currently Im using GitLab as my remote GIT server. I have no problem using single Gitlab account with SSH key assigned to it. But now I applied another Gitlab account and I'm trying to use the same SSH key for it, but I cant add the key to this new...

Capistrano unable to pull a Stash repository using SSH

git,ssh,capistrano,capistrano3,atlassian-stash
I followed the following procedure: Created an SSH key; Enabled SSH in Atlassian Stash; Added SSH key for the Stash account called Capistrano (already used by Capistrano to successfully connect using username and password to Stash) Tested the SSH connection using the command git clone ssh://[email protected]:7999/project/repository.git and the repository is...

Trouble Connecting to MySQL via SSH

javascript,node.js,ubuntu,ssh,node-mysql
I am running a node Express website on my OS X machine locally. I need to ssh to a remote mysql database so I can start writing queries against it. Now I'm able to ssh to our remote server (running the mysql database) in the cloud when I do it...

Github: Permission denied (publickey) but I got “You've successfully authenticated” message

git,github,ssh
Step I had done: https://help.github.com/articles/generating-ssh-keys/ follow exactly. $ eval "$(ssh-agent -s)" Agent pid 31944 $ ssh-add Enter passphrase for /home/centos7/.ssh/id_rsa: Identity added: /home/centos7/.ssh/id_rsa (/home/centos7/.ssh/id_rsa) $ ssh-add -l 4096 ab:4d:23:23:99:ce:bb:9d:9f:9e:f9:b2:c8:1a:cd:f7 /home/centos7/.ssh/id_rsa (RSA) However, when I run $ git clone [email protected]:privateRepo/repo.git Cloning into 'repo'... The authenticity of host 'github.com (192.30.252.130)' can't be...

SSH with Command and File in Java

java,ssh,jsch,sshj
I'd like to run SSH within Java but I haven't figured out how to run an SSH statement that includes a command and file. The command for example in a standard terminal: ssh [email protected] 'upload' < myfile.txt Hopefully via a Java library, not some type of Runtime.exec()...

Berkshelf vendoring of cookbook on private Bitbucket repository

git,ssh,vagrant,bitbucket,berkshelf
I'm pulling my hair out trying to get Berkshelf to download a company cookbook from our private BitBucket (git) repository. This is on a Windows 8.1 host. I found this question and have attempted what was described in the answer. I also played around with the instructions Atlassian advises about...

Reverse Tunnel over JSCH (SSH) and HTTPS

java,apache,ssh,https,http-tunneling
I have to implement a reverse tunnel from client to server. I have used JSCH with the following command session.setPortForwardingR(rport, lhost, lport); and it works (see also Reverse SSH tunnel with JSCH Java)! next I have to tunnel my ssh session over an HTTPS stream 2-way authenticated: client -> firewall...

Optimizing Ansible Transport\SSH for Unconventional Networks

networking,optimization,ssh,ansible
I'm wondering how to optimise Ansible to work with a network radically different to one where use cases where Accelerate and default might not necessarily be beneficial. In this scenario I'm not dealing with a virtual network, nor am I dealing with servers. I'm dealing with hundreds of embedded, with...

Executing command using Paramiko on Brocade switch

python,ssh,paramiko,switching
I am trying to use Paramiko to SSH into a Brocade switch and carry out remote commands. The code is as given below: def ssh_connector(ip, userName, passWord, command): ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(ip, username=userName, password=passWord, port=22) stdin, stdout, stderr = ssh.exec_command(command) print stdout.readlines() ssh_connector(ip, userName, passWord, 'show running-config') While trying...

How to SSH to a linux machine out in the wild

linux,ssh
I have a linux machine that is portable and so will connect to different routers. The linux machine has a script that will automatically update its current public IP everytime it connects to the Internet. Now, from my computer I want to ssh into this linux machine. Assuming that the...

Warning everytime login remote server

linux,ssh,centos
The following warning shows up everytime when I login a remote server using ssh [email protected]_server, anyone knows why and how to fix it? Warning: the RSA host key for 'HOSTNAME' differs from the key for the IP address 'IP ADDRESS' Offending key for IP in /home/haifzhan/.ssh/known_hosts:15 Matching host key in...

Sending a list of commands to list of remote server through ssh by Java with JSch

java,ssh,jsch
I am new to Java (I am still in the learning process), so please I greatly appreciate it if your answer provides detailed steps that I can follow. Here is what I am looking for 1) I have a list of commands in txt file. 2) I have a list...

provide custom terminal session to incoming ssh connections in c++

c++,unix,ssh,terminal
We have a server that run with certain functionality. We want to enable some users with ssh authentication so that if an ssh session is initiated by the clients on certain port to the server, the sever will provide a custom terminal which supports only very few commands we have...

Capistrano and Corkscrew PATH error

ruby-on-rails,git,ssh,capistrano,gitlab
I'm trying to deploy my Rails application with Capistrano but when it comes to "git ls-remote" i get the following error: $ /usr/bin/env git ls-remote --heads [email protected]<server>:<project>.git /bin/bash: line 0: exec: corkscrew: not found DEBUG [a5205e2a] ssh_exchange_identification: Connection closed by remote host DEBUG [a5205e2a] fatal: The remote end hung up...

“Algorithm negotiation fail” error in JSch when trying to connect to Symantec NetBackup - grabing reports remotely

java,ssh,network-programming,server,jsch
I have been searching online and found similar posts but could not find a solution reading them. I am trying to connect to NetBackup servers using ssh from my computer and run a report and create graphs based on them. I am doing this using java and JSch library. The...

Script for merging two SSH connections together?

linux,bash,ssh,debian
I'm trying to write a bash script to merge 2 already-existing SSH connections. For example, if I have an embedded device automatically creating an SSH connection to my server (from behind a firewall), how can I connect to that server in the middle, and jump into the already-existing connection from...

Ansible: Do something when package version greater or equals

ssh,ansible
I have a problem with running a task only when the package it requires has the correct version. In my example it is the OpenSSH Server. Only on 6.5 or greater the ed25519 host key can generated. Here my tasks: - name: ensure openssh-server is present apt: pkg: openssh-server state:...

nodejs ssh client disable colors

node.js,ssh,xterm
anybody knows how to turn off color tags in the terminal? var conn = require('ssh2').Client(); var onShell = function(err, stream) { ... var start = true; var data_out = ''; stream.on('data', function(data) { if (/ > $/.test(data)) { console.log('test oK'); if ( start ) { stream.write('export\r\n'); start = false; }...

Vagrant java 1.6 to 1.8

java,ssh,vagrant
I Installed vagrant on my machine with hashicorp-precise32 virtual machine. It installed java 1.6 whereas i want java 1.8. Do i have to install another virtual machine? How to get java 1.8?

Run command sudo bash with WinSCP .NET assembly

.net,ssh,sudo,winscp,winscp-net
I am trying to run command sudo bash using VB.NET and WinSCP. I am using this code: Try Dim mySessionOptions As New SessionOptions With mySessionOptions .Protocol = Protocol.Sftp .HostName = "10.5...." .UserName = "hereGoesUsername" .Password = "hereGoesPassword" .SshHostKeyFingerprint = "ssh-rsa 2048 ......" End With mySession.Open(mySessionOptions) Try mySession.ExecuteCommand("sudo bash").Check() Last line...

Remote connection to embedded device in field

login,ssh,embedded,ethernet
I would like to ask about the way how to establish remote connection to Linux based embedded device in the field. I have a small linux board I want to place in remote location. It has an internet access through ethernet. Than I have a Linux server with public IP...

SharpSSH jSCH Algorithm negotiation fail

ssh,sftp,sharpssh
I use SharpSSH .NET library for SFTP. http://www.tamirgal.com/blog/page/sharpssh.aspx When I try to connect the server I get an error Algorithm negotiation fail But when try to connect by FileZilla it works with no problems. I find some with the same error but I do not find how to resolve this...

Program running non-stop in ssh

linux,ssh
I want to run non-stop program in SSH. When I use Command ./program.out and I close SSH my program exits too. I'm not root.

how to ssh run a tail and then send data to a mysql database

linux,bash,unix,ubuntu,ssh
This code SSH's and then runs a tail command on a remote hots. I would now like to pass that tailed data into a mysql database using a local script called insertPerfmon.sh. How do I pass data generated in a ssh session into the local shell script insertPerfmon.sh. The local...

paramiko: NameError: global name 'descriptor' is not defined

python,python-2.7,ssh
I'm trying to use paramiko for SSH, but got an error: >>> import paramiko >>> ssh = paramiko.SSHClient() >>> ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) >>> ssh.connect('54.***.***.110', key_filename='D:\Keys\MyOWN\priv.ppk') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "build\bdist.win32\egg\paramiko\client.py", line 366, in connect File "build\bdist.win32\egg\paramiko\client.py", line 515, in _auth File "build\bdist.win32\egg\paramiko\agent.py",...

C# Simple SSH Connection And Send Command

c#,ssh,connection,sbt
this is the code i'm using SshClient cSSH = new SshClient("192.168.10.144", 22, "root", "pacaritambo"); cSSH.Connect(); SshCommand x = cSSH.RunCommand("exec \"/var/lib/asterisk/bin/retrieve_conf\""); cSSH.Disconnect(); cSSH.Dispose(); but i want to send command from a textbox so I've tried this SshCommand x = cSSH.RunCommand(textbox3.Text); but didn't work basically i want textbox3.Text as a ssh command....

Frozen ssh when pulling changes from remote GIT repo

git,debugging,ssh,timeout,ubuntu-12.04
I have problems with pulling changes from remote git repo, already tried bitbucket and github. I am able to clone repo and also to pull when no commits are pending to download, in case of new commits git/ssh get stuck until connection is closed by remote host, see the attachement...

Proper SSH ENV in an Ambari bootstrapped HDP 2.2 Cluster

shell,hadoop,ssh,user,ambari
Just rolled out a new 2.2 cluster w/ Ambari, which was awesome, but now when I hit the shell with my user, I don’t have the right JAVA_HOME set in my env. Is there something I should source on login that will setup my ENV properly (not just JAVA_HOME) or...

Running git from node.js as a child process?

linux,node.js,git,ssh,debian
I am attempting to write a generic command-runner in Node.JS - however that's not massively important. My setup is as follows: I have a list of string commands that are executed using child_process.exec one after the other. I want to run git from one of these commands, specifically a pull....

git ssh doesn't work

git,ssh
I have done what the document said, and when I type ssh -T [email protected], it will show Warning: Permanently added the RSA host key for IP address '[192.30.252.149]:443 ' to the list of known hosts. Hi fifiteen82726! You've successfully authenticated, but GitHub does not provide shell access. However, when I...

Expect Script through Putty works but not when called by scripts executed via http

ssh,expect
I have an expect script that connects to one of our remote servers, it runs a few commands as admin then exits. When i run the script through the Putty CLI it works properly. However when I call the script via http it fails, the script isn't presented with the...

Alias for SSH and run command in a Vagrant VM

bash,ssh,vagrant
I have 2 vagrant machines in a folder, and I'm constantly having to ssh in both and run the same command. Basically I do: $ vagrant ssh machine1 [[email protected] ~]$ sudo rm -rf /tmp/cache/* [[email protected] ~]$ exit $ vagrant ssh machine2 [[email protected] ~]$ sudo rm -rf /tmp/cache/* [[email protected] ~]$ exit...

SSH aws ec2 elastic beanstalk without keypair

ssh,amazon-ec2,elastic-beanstalk
I have a running instance that was created without a keypair, as I understand is not possible to apply a keypair to a running instance, I need to ssh connect to the instance to get some logs, how can I do that? Right click on the instance -> Connect, shows...

Installing SSH in Ubuntu 14.04 for Bitbucket

ubuntu,ssh,bitbucket
I installed ssh by doing: sudo apt-get install openssh-server. When I try to search for the version I got this: [email protected]:~$ ssh -v usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd]...

rails capistano mac os deploy error

ruby-on-rails,ruby,osx,git,ssh
When I used linux everything deploy work, but when I deploy from mac os, I have: > cap production deploy DEBUG [1330f96c] Running /usr/bin/env [ -d ~/.rvm ] on IP Adress DEBUG [1330f96c] Command: [ -d ~/.rvm ] Text will be echoed in the clear. Please install the HighLine or...

Fabric execute with SSH key?

python,python-2.7,ssh,fabric,python-2.x
How do I execute commands without using the fab utility? Test case from fabric.api import execute, run def hostname(): return run('hostname') if __name__ == '__main__': execute(hostname, my_env={'key_filename': 'public_key_path'}, hosts='{user}@{ip}'.format(user='ubuntu', ip='ip address here')) Error TypeError: hostname() takes no arguments (1 given) ...

How to change a connection to Github from SSH to HTTPS?

git,github,ssh,https,git-remote
I created my first repository in Github yesterday. When making the connection I used SSH instead of https, so I went through a little painful SSH key creation and connection process. At some point I got stuck and the connection failed. I wondered at that moment how I could revert...

How do I SSH into EC2 with .pub?

amazon-web-services,ssh,amazon-ec2
When I create a new Elastic Beanstalk environment it asked me if wanted to create a new keypair. I say yes, and it created two file in my .ssh folder locally called app and app.pub. Normally to ssh into an instance I use a app.pem file. i.e ssh -i app.pem...

shell_exec('which git') returns empty string on Godaddy shared hosting server

php,git,github,ssh
I have everything setup with git and my server (godaddy shared hosting) regarding SSH keys and can update the server successfully via SSH with git pull [email protected]:username/reponame.git I'm attempting to use simple-php-git-deploy to automatically update a test server when I commit changes to my git repo When the below php...

Perl ssh Password

python,perl,ssh,expect
I am trying to use perl to SSH in to a machine and issue a few commands... my $ssh = Net::SSH::Perl->new($host); $ssh->login($user,$pass); my($stdout, $sterr, $exit) = $ssh->cmd($cmd); print "$stdout \n" This is the general idea, but I am still stuck at the prompt for the password. I have also attempted...

run python script with arguments on a remote linux host

python,linux,ssh
I have this python script that I'm trying to run on a remote host. However, the script requires two arguments. For example, python script.py --port 4000 --service status Now when I run the script locally on the machine it works fine. How can I run this same script on a...

How to Read Files Stored in Raspberry Pi Directly to Window Using R

linux,r,windows,ssh,raspberry-pi
I'm attempting to read files stored in Raspberry Pi (Raspbian) directly to Windows 7 using R. To be specific, here are what I've done so far. 1. Install R 3.1.2 on Windows 7 2. Install Raspbian on Raspberry Pi, stored some text data files in Raspberry Pi. 3. Attempt to...

vi/fugitive: Gpush does not exit… sometimes

ssh,vi,vim-fugitive
I just started using fugitive in my workflow... very useful! But I've seem to have run into a weird annoyance that I'm hoping someone might have a solution to: When I run :Gpush, sometimes control never returns to vi. Vi hangs on the output of git push until I Ctrl+C...

Can you create a project on GitLab using ssh?

ssh,gitlab
I have an account with gitlab.com. I am trying to automate some of the steps of setting up a new dev server. Is it possible to connect to my account at gitlab.com via ssh and then create a new project? If so, how? If no, why not? Currently I get...

Windows to Linux (Rsync and SSH)

linux,windows,ssh,rsync
I'm new to rsync, so my problem is probably obvious. I'm trying to backup the folders in Windows Pictures to a remote Linux directory. This is what I have: rsync -av ssh /cygdrive/c/users/Owner/Pictures [email protected]:/var/files/ImageSync I got this format from: Transferring from Windows to Linux with rsync But I am getting...

using sed to replace a line with back slashes in a shell script

regex,bash,shell,ssh,sed
I am trying to replace the bottom one of these 2 lines with sed in a file. <rule>out_prefix=orderid ^1\\d\+ updatemtnotif/</rule>\n\ <rule>out_prefix=orderid ^2\\d\+ updatemtnotif/</rule>\n\ And the following command seems to do that when executed as a command at the bash prompt sed -i '[email protected]_prefix=orderid ^2\\\\d\\+ updatemtnotif/@out_prefix=orderid ^2\\\\d\\+ updatemtnotif_fr/@g' /opt/temp/rules.txt however, when...

how to immediately login through ssh?

bash,ssh
Here is my problem. I need to run a command ./deploy.sh -u 1540 This will fetch version 1540 of deploy.sh on SVN When I do, the script access SVN and ask for a password. I'm using ssh. It will first ask me a password since it guesses my SVN login...

SSH directly into a docker container

ssh,debian,docker
i've got some docker conatiners and now I want to access into one with ssh. Thats working I got a connection via ssh to the docker container. But now I have the problem I don't know with which user I can access into this container? I've tried it with both...

How to initiate SSH connection from within a Fabric run command

python,ssh,fabric
I have a remote server, say 1.2.3.4which is running a docker container that is serving SSHD mapped to port 49222 on the docker host, so to connect to it manually I would do: workstation$ ssh 1.2.3.4 -t "ssh [email protected] -p 49222" and arrive at the docker container SSH command prompt...

BASH Script to SSH to another server and run commands as user

bash,ssh,cpanel
I read a lot though the forums and Google however I wasn't able to locate a workaround for this particular one. Basically my script is running on my local machine, then is SSH-ing onto a server with a different username (it works up until here), and on that machine I...

How can I safely return a bash array over ssh?

arrays,linux,bash,shell,ssh
In the bash shell, arrays can be easily quoted with declare -p, then evaled later to return them to normal. This seems acceptable for passing an array (as part of a script) to a remote machine over SSH. The problem is, going the other way across the wire I don't...

SSH permission denied (password) [closed]

linux,ssh
I am going to connect to another virtual machine with SSH. but I am not able to login (permission denied (password)). maybe I should set password in target system and I do not know how?

How to return from shell 'read' command passed in expect script?

linux,shell,ssh,user-input,expect
I am really new to using expect, and a bit confused regarding passing commands to an expect script, so please bear with me... I have searched numerous forums, but cannot seem to find an example of an expect script that uses the read command to get user input. In my...

Configure Git to use a .pem key from a specific location

git,ssh
Whenever I try to do a 'git pull origin master' I get (It is NOT Github): Permission denied (publickey). I am able to SSH into my AWS EC2 Linux sever, which has the bare repository, which I'm trying to pull from when I get the aforementioned permission error. I have...

SShpass not allowed with Travis CI

ssh,continuous-integration,travis-ci,continuous-deployment
Context I have an application in which, I m using unit tests and I need to continuous deliver this. I chose to use github + travis + docker. My Docker container is an Ubuntu 12.04 with openSSL that I cant connect from outside, and I dont have any problem with...

ansible ssh prompt known_hosts issue

ssh,command-prompt,ansible,ansible-playbook,hosts-file
I'm running Ansible playbook and it works fine on one machine. On a new machine when I try for the first time, I get the following error. 17:04:34 PLAY [appservers] ************************************************************* 17:04:34 17:04:34 GATHERING FACTS *************************************************************** 17:04:34 fatal: [server02.cit.product-ref.dev] => {'msg': "FAILED: (22, 'Invalid argument')", 'failed': True} 17:04:34 fatal: [server01.cit.product-ref.dev]...

copy key pair to amazon

amazon-web-services,ssh,amazon-ec2,ubuntu-server
I have run into trouble I have ec2 instance. I connected to it via ssh. I wanted to set up POST hook for git. And accidentally removed authorised_keys from /.ssh directory My question is : if I am still connected to my aws instance can I copy myKey.pem to /.ssh...

Openshift port-forwarding [on hold]

java,git,netbeans,ssh,openshift
After many hours and many attempts, remains now your help. Im trying to do port-forwarding to access my DB in Openshift on Neatbeans. I've already done lots of tutorials, upgrade and downgrade versions of net-ssh, uninstall rhc and so on. I have read a lot git solutions (ssh_options[]...) and doesn't...

Homestead/Vagrant ssh into the VM from another computer

ssh,vagrant,homestead
I've got a question regarding Homestead/Vagrant is it possible to ssh into the Vagrant VM from another computer? Here's my scenario: Homestead running into a windows PC with IP 192.168.0.201 Another windows machine with ip 192.168.0.200 From the second windows machine which is my PC I want to ssh into...

Error in executing a Jar file in remote machine

java,ssh,jar
I am trying to executing a jar file which is present in remote machine. When I execute below command from my local machine I get error: ssh -i /root/.ssh/pem_file [email protected][host_ip]:/home/user/folder1/java -cp jar1.jar -a option1 -e [email protected] -f TextFile.txt /home/user/folder1/ is the location where jar file is present on remote machine.The...

Expect script for checking ssh connection for a list of ips

shell,ssh,scripting,expect
Can anyone help me in creating an expect script to just do an SSH on a list of servers and check if it was fine. I do not need to interact, do not need to fire any command on each server, I just want to do an ssh and come...

SSH to multiple machines using a batch file

linux,batch-file,ssh
I have a large number of Linux devices that i want to be able to SSH into and change the netmask. I wanted to create a batch file to do this so that i can export a list of the IP addresses and then run a batch to change the...

Are SSH destination and source ports identical (symmetric ports)?

ssh,port
When I connect to SSH I use port 22 as destination, but when the reply comes back, does it come in on port 22 as well? Or is the client source port randomly assigned as in other TCP communication? If set up a firewall allowing outbound traffic to port 22...

Copying files from server to local computer using ssh [closed]

ssh,scp
I am having trouble copying files from a remote server using ssh. Using putty I log in to the server using ssh. Once I find the file I would like to copy over to my computer, I use the command: scp [email protected]:/dir/of/file.txt \local\dir\ It looks like it is successful, but...

running a program through ssh fails with “Error opening terminal: unknown.”

linux,bash,parsing,ssh,pipe
When I try to execute a simple command through ssh, then it is successful. e.g. #] ssh servername "echo abcd" abcd #] However, when I try the following command, it fails: #] ssh servername ~/htopmem.sh Error opening terminal: unknown. #] where the content of htopmem.sh is below. (inspired by the...

SSH remote command

ssh,command,remote-access
I have a strange SSH problem. If I run this ssh [email protected] 'md5sum file.txt' I get back the result as expected, but if I run this ssh [email protected] 'cat file.txt' then it just sits there....

SSH Connection to MySQL

java,mysql,jdbc,ssh
I have hit an issue and I am unsure as to where it is going wrong. I am establishing an SSH connection to my remote server and from there I am trying to access a MySQL Database. The SSH connection connects properly however, when attempting to access the MySQL db...

Unable to ssh into remote Linux by ngrok

linux,ssh,tcp,ngrok
The remote Linux is in an internal network and has no public IP address. So I installed ngrok. ngrok tcp 22 ngrok by @inconshreveable (Ctrl+C to quit) Tunnel Status online Version 2.0.19/2.0.17 Web Interface http://127.0.0.1:4040 Forwarding tcp://0.tcp.ngrok.io:36428 -> localhost:22 Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00...

Class 'Net_SSH2' not found in… when using phpseclib

php,ssh,phpseclib
I'm trying to use phpseclib to run a few ssh commands on my server. Attempting the below, I get Class 'Net_SSH2' not found in.... which seems to indicate phpseclib is not properly loaded, yet the echo shows that the include is working. What have I done wrong here? My php...

SSH connection problems in JSch

ssh,network-programming,server,jsch,public-key-exchange
I am trying to connect to a server using JSch. I get the "Negotiation fail" error. I checked the sshd_config file and got the following info: UsePAM yes PasswordAuthentication no Ciphers aes128-ctr,aes256-ctr,arcfour256,arcfour,aes128-cbc,aes256-cbc AllowTcpForwarding no PermitRootLogin no The rest of the scripts are commented out. As you see it doesn't mention...

Git Clone on LAN from Windows to Ubuntu Server

windows,git,ubuntu,ssh
So I have been working on a project for some time on a Windows workstation, tracking the development via git. Now I need to move said project to an Ubuntu server on the LAN, and this has been proving to be a major pain. I've logged into the Ubuntu server...

How to determine the subnet mask and network interface card from remote SSH login?

linux,shell,ssh,network-programming,aix
In a separate question (link below), it was suggested that I obtain the network interface card number and subnet mask from a remote SSH login, rather than prompting the user for it. All I have is the IP address of my remote host. I need to obtain the subnet mask...

Executing WP-CLI via SSH and Capistrano

wordpress,ssh,capistrano
I am fairly new to cap hence I can't figure out one thing. I have wp-cli installed on my server which I can run with wp ie wp --vetsion directly on the server will output WP-CLI 0.19.1 - great. What I am trying to achieve is run the command with...

Bash script to ssh to specific urls of a common format?

bash,ssh
All the vms at work I need to ssh into are of a common format (stuff014.stuff.com) with differing numbers. Is there a quick way to connect to them without making a big ssh config file and without using alias?

View EC2 Instance Server Files in AWS Console

amazon-web-services,ssh,amazon-ec2
Is it possible to browse server files (.php, etc.) inside the AWS Console (in the browser) and not via a SSH or FTP client? For example; view files just like in CPanel on a regular web host. I am working on a EC2 instance of a Debian OS that was...

How can I figure out which process is opening the certain tcp port?

linux,ssh,netstat,fuser
I usually use fuser command to check pid opening the certain tcp port like the following fuser 22/tcp //To get pid opening the 22 tcp port I've got a reference board which running a embedded linux. It have been already opening 22 tcp port for ssh connection. But fuser doesn't...

Best way to use multiple accounts on Bitbucket from my laptop

git,ssh,bitbucket
I have 2 Bitbucket accounts: https://bitbucket.org/myaccount1/ https://bitbucket.org/myaccount2/ I added all SSH keys necessary on these 2 accounts (all is ok about this). In my config file (under ~/.ssh directory): Host bitbucket.org - myaccount1 User git Hostname bitbucket.org PreferredAuthentications publickey IdentityFile ~/.ssh/myaccount1 Host bitbucket.org - myaccount2 User git Hostname bitbucket.org PreferredAuthentications...

Atlassian Stash - Permission Denied (publickey)

git,ssh,ssh-keys,atlassian-stash
I'm actually in the process of setting Atlassian Stash for my Workplace. I've ran into this issue which I'm not able to fix. Note, this is running on a Windows 7 64bits installation. When setting the SSH Keys, I followed the Stash Guide on how to create them and set...

how to correctly write command inside commands (ssh)?

bash,ssh
Here is the command I have which works It's just a kill with an expression which returns a number kill $(ps -ef | grep '[m]atchbox-panel --titlebar --start-applets showdesktop,windowselector' | cut -f8 -d' ') &> /dev/null Here is the ssh I normally use bash -c 'timeout 120s ssh -o StrictHostKeyChecking=no [email protected]

How to verify SSH keys properly added for Git?

git,ssh
What's the command to verify SSH keys are properly added for git? There are 2 sets of keys under our ~/.ssh/ and we want to add both of them. What we did was to run ssh-add -l in git bash: $ ssh-add -l 2048 28:1b:b8:b2:a8:f1:9b:bb:b5:85:21:d5:d8:0b:00:b2 /c/Users/myuser/.ssh/bb_rsa (RSA) 2048 3d:31:e8:f7:f5:cd:dd:c7:0b:84:16:66:23:95:af:05 /c/Users/myuser/.ssh/id_rsa...