Hi I have managed to connect to a remote server via ssh, but nothing will actually send through to the remote server screen through my script...it waits until i am back to the main terminal before it outputs anything.
Can anyone tell me how to get commands to send through to the remote server?
when you try and interactive connection to the remote machine using ssh, are you prompt for entering login+password or not ?
If not, (and if you still can get connected to the remote machine) then it means that the authentication keys exchange is correctly setup so you should be able to run it using your script.
Otherwise you should add your public authentication key to the authorized_keys file of the remote machine and check that ssh is configured properly.
Yes, with ssh I usually start trying to get this running on both ends:
If I want passwordless login and complete trust, I copy the entire $HOME/.ssh*/ to the remote $HOME.
If $HOME is a mount onto multiple systems, that dir $HOME/.ssh/ or $HOME/ssh2/ is moved; see "man ssh" and "man sshd_config 5" (add 2 after ssh if you have made it up to the better ssh2), but usually see /etc/ssh2/ssh2_config under UserConfigDirectory.
That makes the keys match, although it also breaks localhost/127.0.0.1 entries until you remove the old system localhost/127.0.0.1 line in authorized_users or whatever -- it tells you.
The -n is a speed up and simplification, as when there is no input stdin only output, ssh does not need to fork off a child or thread to watch stdin. Some commands get very confusing without it, like:
Both 'ssh2' and 'pg' will be reading /dev/tty, so 'pg' will seem unresponsive half the time, because 'ssh2' does not know 'ls' does not read stdin.
I need to copy python script file to around 100 servers using expect script.
1. Copy script to my user home first(/home/myhome) on each remote server
2. change permissions on copied file to 766.
3. sudo to appuser1 account on remote server. copy script file from my user home to /usr/bin/... (1 Reply)
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)
Hi,
I need to run a script located in a directory on remote server by using ssh authentication from my local unix server. Can anyone help me in this.
I have tried the below command. It worked for echo command but when i tried to open a file using cat command it is showing "cat: cannot open... (6 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)
I am having problems receiving data from a remote server. It seems that I can send an HTTP request to any host such as http://www.google.com, but I can't get a reply.
I'm sending the host a HTTP 1.0 request that is formatted as such:
GET / HTTP/1.0
Host: http://www.google.com
Connection:... (0 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)
I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config.
I am not sure if I can do this with BASH scripting.
I have set up password less login by adding my public key to authorized_keys file, it works.
I am a little... (1 Reply)
Hi,
Just wanted to know, how can I ftp/transfer/copy a (design.tar.gz) archive from a Unix Server (sdmc222.sdmc.cp-srv.com) which is at a remote location, to my Windows Desktop. Obviously, it is not possible at cmd prompt on my Windows using the following commands :-
ftp... (3 Replies)
I am trying to write a script that logs into an SMTP server and authenticates as a user or verifies that a user exists. I can do all this from the command line but I don't know how to write a script to do this for me, I login and then the script stops, I'm sure this is some basic principle. ... (3 Replies)