Sponsored Content
Full Discussion: Ssh in the background
Top Forums Shell Programming and Scripting Ssh in the background Post 302835281 by vinil on Monday 22nd of July 2013 07:16:46 AM
Old 07-22-2013
1 use password less ssh concept into use.
2 do validation of required files
3 if pass, sftp the file
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using ssh to execute a remote script in the background

Help please!! I want to use ssh to execute a remote exe and while it's running I want to query for the process ID of the exe (2 different ssh commands) 1. sshpass -p "<passwd>" ssh -f -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@<ipaddress> nohup /tmp/mmds_asyn & 2.... (0 Replies)
Discussion started by: rvompoluTMW
0 Replies

2. Shell Programming and Scripting

PID from background ssh

Hello. I was wondering if someone can help me out with something. To simplify my life, I have written a tiny script to open an ssh tunnel through another linux host so that I can access the esxi hosts on that network using the client. For this I have to tunnel ports 443, 902, and 903. Here is what... (1 Reply)
Discussion started by: numetheus
1 Replies

3. Programming

Background (nohup * &) SSH command block possible?

Hello, I am trying to find a way to send several sequential commands via SSH to a remote box in a single command. Thoughts so far: 1) Can I put them into a function and call the function within the ssh command? e.g. ssh <targetserver> $(functionx) No - then it calls the function in... (4 Replies)
Discussion started by: doonan_79
4 Replies

4. Programming

Background SSH using here document

I'm trying to use Here documents to pass several commands to a remote server over SSH. However I'm having problems. The code is as follows: nohup ssh $i_hostname exec /usr/bin/ksh -s << EOF >> $AS_STOPSAP_LOG & echo $i_instname; ps -ef | grep name | grep ${i_instname} |grep -v grep ... (4 Replies)
Discussion started by: doonan_79
4 Replies

5. Shell Programming and Scripting

Ssh = ssh expect and keep everything not change include parameter postion

I have write a script which contains ssh -p 12345 dcplatform@10.125.42.50 ssh 127.0.0.1 -p 5555 "$CMD" ssh root@$GUEST_IP "$CMD" before I use public key, it works well, now I want to change to "expect", BUT I don't want to change above code and "parameter position" I can post a... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

6. Shell Programming and Scripting

Executing a background script using ssh keys

Greetings, i've been working with a user-friendly menu on ksh to allow users execute scripts located on a remote server, so they wont have to login and manually launch those scripts every single time. This is a HP-UX box and currently on a /usr/bin/ksh shell. I've setup ssh keys on both... (1 Reply)
Discussion started by: nbriozzo
1 Replies

7. UNIX for Dummies Questions & Answers

Sudo ssh with command running in background

I am trying to run a command. This is one of my attempts: for i in fileservera; do ssh -t $i 'sudo ls /';doneThis works, and I see the directories. However, what I want to do now is start a process on the remote server such as /usr/bin/connectproc -standalonesudo /usr/bin/connectproc... (1 Reply)
Discussion started by: newbie2010
1 Replies

8. UNIX for Beginners Questions & Answers

Ssh script to validate ssh connection to multiple serves with status

Hi, I want to validate ssh connection one after one for multiple servers..... password less keys already setup but now i want to validate if ssh is working fine or not... I have .sh script like below and i have servers.txt contains all the list of servers #/bin/bash for host in $(cat... (3 Replies)
Discussion started by: sreeram4
3 Replies

9. Shell Programming and Scripting

Find active SSH servers w/ ssh keys on LAN

Hi, I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step: #!/bin/bash # LAN SSH KEYS DISCOVERY SCRIPT </etc/passwd \ grep /bin/bash | cut -d: -f6 | sudo xargs -i -- sh -c ' && cat... (11 Replies)
Discussion started by: syrius
11 Replies
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)
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy