The problem here is that the cat is running locally. Your local shell is seeing the semicolon as a command separator between the ssh command and the cat command. Try quoting the command string to send it to the remote side eg:
or
If you have a more complex command e.g. involving awk I'd suggest a here-doc:
This User Gave Thanks to Chubler_XL For This Post:
Hi,
I am trying to run a sas prog on a remote server using ssh.
I have got the command that I am using in the below paragraph. With it, I was able to run shell scripts but when I tried 'sas' it errored out. I have got my keys exchanged so when I say ssh serverA I automatically connect to my... (4 Replies)
I have a task requiring that USER_A run a script, which connects to HOST_B as USER_B and does not ask for a password.
If I am logged in on HOST_A as USER_B, I can connect to HOST_B without a password, no problem. However, if I try running ssh with the command line "ssh USER_B@HOST_B" while... (3 Replies)
how to login with ssh to remote system with out applying the remote root/user password
with rlogin we can ujse .rhosts file
but with ssh howits possible
plz guide (2 Replies)
I have some commands which need to be executed in remote machine.
I have Linux Server from where I need to connect to Solaris server using ssh and then declare some variable over there and run some commands. I don't want to call a script which is present in Solaris server from Linux server... (7 Replies)
Hi!
Im trying to set access from ServerA(SunOS) to ServerB(Some custom Linux with Keyboard Interactive login) with SSH Keys. As a proof of concept I was able to do it between 2 virtual machines. Now in my real life scenario it isnt working.
I created the keys in ServerA, copied them to... (7 Replies)
There are two servers :
1. Site
2. Testing
from site server i want to connect testing server with ssh password less authentication.
i generated public and private keys with ssh-keygen -t rsa on site server.
cat id_rsa >> authorized_keys
cat id_rsa.pub >> authorized_keys
i... (15 Replies)
Hi experts,
I am not sure in which forum to submit this question. If this is not the correct place then please let me know where to submit this thread.
My requirement is to invoke windows batch scripts from linux shell script. Hence, I have installed openssh in Cygwin on the windows machine.... (2 Replies)
Hello,
I'm trying to create a ksh script to ssh to a remote server, enter the password and a couple commands. For security reasons I have changed the login, password and ip in my example.
#!/bin/ksh
ssh -t -t username@12.5.5.3 << EOF
password
cd bin
pwd
EOF
When I run it. It... (5 Replies)
Hi,
I am trying to run commands on a list of servers that I can ssh to and just want to know if there is a 'cleaner' way of doing this.
At the moment, I am doing as below. Is there a way that I can escape the double quote differently? If a use a single quote to enclose the commands that I... (1 Reply)
Hello,
What I want to do is to run a file on remote server by running a script at localhost but script should not ask ssh password of my remote server when script is executed.
Scenario1:
To copy files from server2 to data server:$ scp -r root@server2_ip:/var/www/html/*.* /var/
When I enter... (6 Replies)
Discussion started by: baris35
6 Replies
LEARN ABOUT DEBIAN
ssh-copy-id
SSH-COPY-ID(1) General Commands Manual SSH-COPY-ID(1)NAME
ssh-copy-id - install your public key in a remote machine's authorized_keys
SYNOPSIS
ssh-copy-id [-i [identity_file]] [user@]machine
DESCRIPTION
ssh-copy-id is a script that uses ssh to log into a remote machine and append the indicated identity file to that machine's ~/.ssh/autho-
rized_keys file.
If the -i option is given then the identity file (defaults to ~/.ssh/id_rsa.pub) is used, regardless of whether there are any keys in your
ssh-agent. Otherwise, if this:
ssh-add -L
provides any output, it uses that in preference to the identity file.
If the -i option is used, or the ssh-add produced no output, then it uses the contents of the identity file. Once it has one or more fin-
gerprints (by whatever means) it uses ssh to append them to ~/.ssh/authorized_keys on the remote machine (creating the file, and directory,
if necessary.)
NOTES
This program does not modify the permissions of any pre-existing files or directories. Therefore, if the remote sshd has StrictModes set in
its configuration, then the user's home, ~/.ssh folder, and ~/.ssh/authorized_keys file may need to have group writability disabled manu-
ally, e.g. via
chmod go-w ~ ~/.ssh ~/.ssh/authorized_keys
on the remote machine.
SEE ALSO ssh(1), ssh-agent(1), sshd(8)OpenSSH 14 November 1999 SSH-COPY-ID(1)