I have tried  echo yes | ssh myserver@13.4.2.1 yes | ssh myserver@13.4.2.1 ssh -y myserver@13.4.2.1   none of which appear to work?  EDIT #1  Part of my problem was I thought every command after the ssh command was a remote command when the commands were in fact local. I guess remote commands have to be declared in a string which is passed to the ssh command as an argument e.g.  $ ssh myserver@13.4.2.1 'remote command'
121312
I'm trying to run the command ssh -o StrictHostKeyChecking=no but I'm a bit lost as to how to run it. I've tried running it from a shell script, but the output was the man page or settings that lists out all the parameters.   I then tried running that command from the shell (Cygwin) itself, but got the same man output. How do I run the command? Do I need to provide credentials or anything?
93721
How to automate SSH login with password? I'm configuring my test VM, so heavy security is not considered. SSH chosen for acceptable security with minimal configuration.  ex)  echo password | ssh id@server   This doesn't work.  I remember I did this with some tricks somebody guided me, but I can't remember now the trick I used...
97493
I get the following prompt everytime I try to connect a server using SSH. I type "yes", but is there a way to aovid this?  The authenticity of host '111.222.333.444 (111.222.333.444)' can't be established. RSA key fingerprint is f3:cf:58:ae:71:0b:c8:04:6f:34:a3:b2:e4:1e:0c:8b. Are you sure you want to continue connecting (yes/no)?
115615
I want to execute a script, start.sh on a remote server which runs this:  nohup node server.js &amp;   Naively, I call SSH like this:  ssh myserver &lt;&lt;EOF ./start.sh &amp; EOF   This starts the script, but leaves the session connected. I want to follow this step with other commands in a script, so that's no good.  How can I SSH to the remote machine, launch a nohup command into the background, then disconnect? I suppose I could put the SSH process itself into the background, but that doesn't seem right.
47205
I'm running a remote bash script (using ssh -t 'bash doscript.sh'). In "doscript.sh" I have a sudo su anotheruser. At that point, the script seems to push a shell and I'm left in that "interactive" script and the rest of my script (doscript.sh) doesn't run unless I type "exit". Is there a workaround that gets around this problem?  Thanks in advance.  Here is the contents of my test script "doscript.sh":  sudo su diy cd pwd whoami exit whoami
15682
I'm working from the URL I found here:    My ssh client is Ubuntu 64 bit 11.10 desktop and my server is Centos 6.2 64 bit. I have followed the directions. I still get a password prompt on ssh.  I'm not sure what to do next.
112377
When I ssh into a server, how can I pass an environment variable from the client to the server?  This environment variable changes between different invocations of ssh so I don't want to overwrite $HOME/.ssh2/environment every time I do an ssh call. How can I do this?
116240
I just SSH'd into root, and then SSH'd again into root on the same machine. So I have two windows open both SSH'd into root on my remote machine.  From the shell, how can I see a list of these two sessions?
59836
I frequently ssh into my box at home from school, but usually when I change classes and my computer suspends, the pipe will be broken. However, ssh simply locks up - Ctrl+c, Ctrl+z and Ctrl+d have no effect.   It's annoying to have to restart my terminal, and even more annoying to have to close and re-create a new screen window.  So my question, is there an easy way to make ssh die properly (i.e. when the pipe fails "normally" it will exit with a message about a broken pipe)? Or do I have to figure out what the PID is and manually kill it?
34641
I would like to run  something &gt; file   on a remote system through ssh, but if I run  ssh host something &gt; file   the redirection is executed locally as ssh etc &gt; file  I've tried it with ' or '' or dd or with a pipe | instead, but I can't get it to work. How can this be done?
98973
I have a remote host, previously I can ssh into it with root and password  ssh root@remote_host   or I ssh into it first using a regular user account  ssh esolve@remote_host   and then su root and input password  but today, in both ways, my password is always incorrect, like  [esolve@local esolve]$  ssh root@remote_host root@remote_host's password:  Permission denied, please try again.   or   [esolve@remote_host ~]$ su root Password:  su: incorrect password   related information:   I can use this password to log in with root if I operated locally on that remote machine today. I ssh into is via VPN   Why did this happen? How can I solve this problem?
63786
I'm using a GNU/Linux system remotely, via SSH.  I mistakenly added something into my $HOME/.bash_profile scriot which causes an error. (To be specific: I added an exec foo command instead of . foo, applied to another bash script without execution permissions, which results in an error.)   Now I can't seem to SSH, SCP or SFTP into my machine: bash, my login shell, tries to run the exec foo command, gets the error and throws me out! I don't have any other account I can access remotely.  Is there something I can do to restore access to the system?  Additional details:   Most ports other than for SSH are unavailable since the machine is behind a firewall. It's a Devuan 3 ASCII (~= Debian 10 Beowulf) system.
30003
This is on Ubuntu 10.10 (Maverick Meerkat) 64-bit desktop.  I want to make my X server listen to remote connections from clients in other machines on the local network. I know about ssh -X and that is not what I want. I vaguely remember changing something like TCPListen from no to yes, but I don't remember where this change should be applied.  I'm interested in either a GUI method or a CLI one.  PS editing /etc/X11/xinit/xserverrc to remove the -nolisten tcp option and rebooting does not work.
79534
I need to run the following command (with real parameters) after login:  ssh -f user@example.com -L 54321:example.com:54321 -N   I need it only for my user, not all users on the machine. Also, I need it to run whether I login via the GUI or via SSH to a plain shell terminal. I would even like to know how to do this on machines without a GUI installed.  Where would I put the above line to be run as explained?
107683
Consider this:  $ ssh localhost bash -c 'export foo=bar' terdon@localhost's password:  declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" declare -x HOME="/home/terdon" declare -x LOGNAME="terdon" declare -x MAIL="/var/spool/mail/terdon" declare -x OLDPWD declare -x PATH="/usr/bin:/bin:/usr/sbin:/sbin" declare -x PWD="/home/terdon" declare -x SHELL="/bin/bash" declare -x SHLVL="2" declare -x SSH_CLIENT="::1 55858 22" declare -x SSH_CONNECTION="::1 55858 ::1 22" declare -x USER="terdon" declare -x XDG_RUNTIME_DIR="/run/user/1000" declare -x XDG_SESSION_ID="c5" declare -x _="/usr/bin/bash"   Why does exporting a variable within a bash -c session run via ssh result in that list of declare -x commands (the list of currently exported variables, as far as I can tell)?    Running the same thing without the bash -c doesn't do that:  $ ssh localhost  'export foo=bar' terdon@localhost's password:  $   Nor does it happen if we don't export:  $ ssh localhost bash -c 'foo=bar' terdon@localhost's password:  $    I tested this by sshing from one Ubuntu machine to another (both running bash 4.3.11) and on an Arch machine, sshing to itself as shown above (bash version 4.4.5).  What's going on here? Why does exporting a variable inside a bash -c call produce this output?
20785
I don’t actually need to run the command below, and I am aware of ssh keys if I did want to log in without typing a password. I would just like to know how ssh seems to circumvent my file redirection.  Running the following command, ssh prompts me for a password:  ssh nobody@192.168.1.151 &gt; /dev/null 2&gt; /dev/null &lt; /dev/null   How does this work? stdin, stdout, and stderr are all redirected, but ssh still manages to print a prompt on my screen and read what I type. I tried adding the ssh arguments -t -t and -T (not both at once), to enable or disable pseudo-tty allocation, but it made no difference.  I also tried closing all input and output this way, although I don’t know if I typed it correctly. Still, ssh prompts for a password:  (exec 0&lt;&amp;- 1&lt;&amp;- 2&lt;&amp;- 0&gt;&amp;- 1&gt;&amp;- 2&gt;&amp;-; ssh nobody@192.168.1.151)
105886
I'm trying to execute a string into my bash script. String contains variables (so I could substitute some CLI arguments depending on circumstances).  The problem is when I use variable containing --argument=value, everything breaks up, giving error:  Missing trailing-' in remote-shell command.   Example code:  #!/bin/bash  rsync_path="/usr/bin/rsync -azhrP" rsync_ssh_cmd="--rsh='ssh -o Compression=no'"  `$rsync_path /path/to/file $rsync_ssh_cmd username@localhost:/tmp`   If I just echo the last string from this code, it looks fine. But if i try to execute this string from script, it doesn't executes as expected.  I found a workaround - everything became OK if I try  eval "my-command-string"   instead of  `my-command-string`   or  (my-command-string)   Why does it so? How could I (should I really?) avoid to use eval?  I use bash 4.3.11(1)-release (x86_64-pc-linux-gnu) (Kubuntu 14.04.3).