Sponsored Content
Top Forums Shell Programming and Scripting Multi server access through remote server using ssh Post 302918949 by whizkidash on Friday 26th of September 2014 10:24:22 AM
Old 09-26-2014
Multi server access through remote server using ssh

Team,

Presently I have 5 ip address kept in ip_abc1 file, for each of the ip address listed, i need to login on each ipaddress
one at a time and login as below for that specific ip address
Code:
ssh -p 8101 karaf@<ip.address_for the specific ip address as logged in>
password
 
features:list
osgi:list
shell:logout

In thisway i need to perform same steps for my other 4 ip address listed

Any suggession as i will be doing it from my remote jump boxes, to access these ip address.

I am trying to fit in the below code but not sure....

Code:
for ip_addr in $(cat ip_abc1);do
echo "###batch $ip_addr### begins"
ssh ${ip_addr} "bash -s" < input_file
echo "###batch $ip_addr### ends"
done

Regards
Whizkid

Last edited by Franklin52; 09-26-2014 at 12:47 PM.. Reason: Fixed code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remote server access

hi everybody, im kinda a new to scripting.... i have attached an image in this post... my goal is to extract data from the remote servers (server1,2,3 as in figure) to the server residing locally.... the criterias are: * I should not pass the password across the remote servers. *... (1 Reply)
Discussion started by: mercuryshipzz
1 Replies

2. UNIX for Advanced & Expert Users

remote web server access (apache)

Hi, I have web server (apache) installed in server-1 and i want to view the web pages from diferent servers also while the web server is running only in one server ....(all the servers are connected to office LAN) right now all the servers have apache running......and CPU utilzation is at its... (2 Replies)
Discussion started by: aditya.ece1985
2 Replies

3. UNIX for Dummies Questions & Answers

TomCat access in an Remote Linux Server

Hi all, I Installed Tomcat in an remote linux server (/usr/tomcat)and start service, using ./startup.sh (and tried with ./catalina.sh too). //----------------------------------------------------------------// # ./startup.sh Using CATALINA_BASE: /usr/tomcat/apache-tomcat-6.0.16/ Using... (1 Reply)
Discussion started by: gothama
1 Replies

4. UNIX for Dummies Questions & Answers

Remote Access to FTP server not working

I am trying to setup an FTP server in a Fedora Core 3 machine through the command line interface and not KDE. I think I am successful in getting the ftp service running, as when I do an ftp 127.0.0.1, I am able to log in using any one the user accounts I have created on this machine and browse... (8 Replies)
Discussion started by: cooljumbo2k8
8 Replies

5. Shell Programming and Scripting

Can a script runned in local server access remote server?

Hi, Im creating a script that is supposed to run commands on remote server using sftp. My script is as below: #!/bin/ksh sftp remote_server mypassword cd /u08/mydir/allfiles mget * .. But this is what I got when I runned the script: Connecting to remote server...... (3 Replies)
Discussion started by: luna_soleil
3 Replies

6. UNIX for Dummies Questions & Answers

server is up but cannot access through ssh

server is at remote site; server is up. I can access it through console. but I cannot access it through ssh. I have restarted SSH already and even do ifconfig ce0 down and up still not successful ... any comment? (2 Replies)
Discussion started by: uuontario
2 Replies

7. OS X (Apple)

Access the SSH of the server

Good evening I have a VPS Server Processor OS: centos-5-x86 I could not log on to the SSH Server This image from the panel WHM Main >> Server Status >> Service Status https://www.unix.com/attachment.php?attachmentid=1666&stc=1&d=1286598999 This copy of the program PuTTY ... (4 Replies)
Discussion started by: hamed
4 Replies

8. UNIX for Advanced & Expert Users

Server access for SSH Tunneling!

Hi! I came to know about SSH Tunneling to bypass the Firewall. I will have to setup a free access SSH server to tunnel data access through PUTTY or OpenSSH. The problem is that I don't know about any free access servers. So, can anyone of you guide me for that, for any type of help? (1 Reply)
Discussion started by: nixhead
1 Replies

9. IP Networking

Ssh to remote access point http server

I need to do some remote administration to an access point that is sitting behind a firewall that only has ssh enable from the outside but http/https from the inside. So to be a bit clearer: remote(outside firewall) ssh --> ssh-server(internal) --> access point(http/https) Ultimately... (3 Replies)
Discussion started by: metallica1973
3 Replies

10. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 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 (presumably using a login password, so password authentication should be enabled, unless you've done some clever use of multiple identities) It also changes the permissions of the remote user's home, ~/.ssh, and ~/.ssh/authorized_keys to remove group writability (which would oth- erwise prevent you from logging in, if the remote sshd has StrictModes set in its configuration). 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) 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 10:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy