connecting servers using SSH - help needed


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting connecting servers using SSH - help needed
# 8  
Old 08-22-2008
Jegaraman i am waiting for your reply.
# 9  
Old 08-22-2008
Hi Senthil,

Can u pl send the output of the shell script execution.
# 10  
Old 08-25-2008
Hi Jegaraman,

here are the output.

bash-2.05$ cat connect.sh
#!/usr/bin/sh
while read box
do
ssh -n $box -l mvelmu 'hostname; ksh /axphome/mvelmu/count.ksh' > /home/mvelmu/$box.txt
done < "/home/mvelmu/machineaddress.txt"
bash-2.05$ cat connect_new.sh
#!/usr/bin/sh
while read box
do
# ssh -n $box -l mvelmu 'hostname; ksh /axphome/mvelmu/count.ksh' > /home/mvelmu/$box.txt
ssh -n $box -l mvelmu 'hostname 2>&1 | grep -v '^*' ; ksh /axphome/mvelmu/count.ksh' >> /home/mvelmu/$boxoutput.txt
done < "/home/mvelmu/machineaddress.txt"

Output for the script.

bash-2.05$ ./connect_new.sh
./connect_new.sh: * ; ksh /axphome/mvelmu/count.ksh: not found
./connect_new.sh: * ; ksh /axphome/mvelmu/count.ksh: not found
./connect_new.sh: * ; ksh /axphome/mvelmu/count.ksh: not found
./connect_new.sh: * ; ksh /axphome/mvelmu/count.ksh: not found
bash-2.05$ THIS SYSTEM IS RESTRICTED TO AUTHORIZED USERS AND BUSINESS PURPOSES
ONLY. INDIVIDUALS ATTEMPTING UNAUTHORIZED ACCESS AND NON-BUSINESS
UTILIZATION ARE LIABLE FOR DAMAGES INCLUDING THE VALUE OF DIVERTED
RESOURCES AND CRIMINAL PROSECUTION.

By continuing to login you agree to the above and accept responsibility
for all of your actions.
THIS SYSTEM IS RESTRICTED TO AUTHORIZED USERS AND BUSINESS PURPOSES
ONLY. INDIVIDUALS ATTEMPTING UNAUTHORIZED ACCESS AND NON-BUSINESS
UTILIZATION ARE LIABLE FOR DAMAGES INCLUDING THE VALUE OF DIVERTED
RESOURCES AND CRIMINAL PROSECUTION.

By continuing to login you agree to the above and accept responsibility
for all of your actions.
THIS SYSTEM IS RESTRICTED TO AUTHORIZED USERS AND BUSINESS PURPOSES
ONLY. INDIVIDUALS ATTEMPTING UNAUTHORIZED ACCESS AND NON-BUSINESS
UTILIZATION ARE LIABLE FOR DAMAGES INCLUDING THE VALUE OF DIVERTED
RESOURCES AND CRIMINAL PROSECUTION.

By continuing to login you agree to the above and accept responsibility
for all of your actions.
THIS SYSTEM IS RESTRICTED TO AUTHORIZED USERS AND BUSINESS PURPOSES
ONLY. INDIVIDUALS ATTEMPTING UNAUTHORIZED ACCESS AND NON-BUSINESS
UTILIZATION ARE LIABLE FOR DAMAGES INCLUDING THE VALUE OF DIVERTED
RESOURCES AND CRIMINAL PROSECUTION.

By continuing to login you agree to the above and accept responsibility
for all of your actions.
Usage: grep [OPTION]... PATTERN [FILE]...
Usage: grep [OPTION]... PATTERN [FILE]...
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
Try `grep --help' for more information.
Try `grep --help' for more information.


Please let me know if done some thing wrong on it
# 11  
Old 08-25-2008
Hi Senthil,

I think 2>&1 will alone do it. I think u can remove grep command and all other alterations.....
# 12  
Old 08-26-2008
Tried but still i am getting this output


bash-2.05$ cat connect_new.sh
#!/usr/bin/sh
while read box
do
ssh -n $box -l mvelmu 'hostname 2>&1 ; ksh /axphome/mvelmu/count.ksh' >> /home/mvelmu/$boxoutput.txt
done < "/home/mvelmu/machineaddress.txt"
bash-2.05$ ./connect_new.sh
THIS SYSTEM IS RESTRICTED TO AUTHORIZED USERS AND BUSINESS PURPOSES
ONLY. INDIVIDUALS ATTEMPTING UNAUTHORIZED ACCESS AND NON-BUSINESS
UTILIZATION ARE LIABLE FOR DAMAGES INCLUDING THE VALUE OF DIVERTED
RESOURCES AND CRIMINAL PROSECUTION.
By continuing to login you agree to the above and accept responsibility
for all of your actions.
# 13  
Old 08-28-2008
Hi Jegaraman,

Is it we need to add dev/null there ..?

Senthil.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Shell script for connecting multiple servers and then copying 30 days old files

Shell script for connecting multiple servers and then copying 30 days old files from those server . HI , I have 6 multiple servers pla1,pla2,pla3,pla4,pla5,pla6 1. These six servers have common shared mount point /var/share 2. Running script from /var/share to connect these servers.I... (1 Reply)
Discussion started by: rcroyal88
1 Replies

3. UNIX for Advanced & Expert Users

Connecting using ssh

We have 2 different servers say A and B and I want to check the log file of 2 servers simultaneously. If I am logged into server A how can I connect to server B. I have used ssh username@B.But it is asking password. How can I give the password on ssh. Or is there any other utility for... (2 Replies)
Discussion started by: jim john
2 Replies

4. Shell Programming and Scripting

connecting servers using shell script

Hi , I have three linux servers. I want to login from one server and check some status in the other server. How to connect other server from one server using shell script. Can anyone advice on this? Thanks, Chelladurai. (4 Replies)
Discussion started by: ckchelladurai
4 Replies

5. Solaris

Documentation on connecting EMC storage to Solaris servers

Hi Can anyone suggest me some documents for EMC clarion documents which I am going to use in the servers with solaris environments. (1 Reply)
Discussion started by: ningy
1 Replies

6. Solaris

Problem in connecting TCP services between 2 Solaris Servers

Hi, I have 3 solaris servers. Two servers of differnet network and one gateway. Server1 --> 192.168.0.1 --> Solaris 9 Server2 --> 10.27.40.2 --> Solaris 10 Server3 --> Iface1 --> 192.168.0.5 --> Solaris 10 --> Gateway Iface2 --> 10.27.40.5 Now I am able to ssh... (36 Replies)
Discussion started by: neel.gurjar
36 Replies

7. UNIX for Advanced & Expert Users

connecting servers

hi everyone i want to establish smtp connection between unix server and windows 2k3 mail server they are on one intranet. and unix server has ftp and telnet connection with the mail server. . (0 Replies)
Discussion started by: parmeet
0 Replies

8. UNIX for Dummies Questions & Answers

connecting servers

Please help me out i want to know how to send email from unix machine to any email-id. mail to be sent is web based mail. (1 Reply)
Discussion started by: parmeet
1 Replies

9. Shell Programming and Scripting

Connecting to remote servers

Please advise, The previous thread asked about the automated transfer of files between two servers. The question is - is there any way of encrypting the password within the script or is it a matter of setting the permissions settings on the script so that it can only be executed and possibly... (1 Reply)
Discussion started by: rdbooth
1 Replies

10. UNIX Desktop Questions & Answers

Newbie help needed connecting to Internet

I have an Ultra5 with 2.56 that is connected to a network. We don't use a proxy server on the network but access the internet directly through a gateway. How do I configure the Solaris box to see the internet? Opening the internet explorer and setting HTTP; FTP etc ports to the ip of the... (3 Replies)
Discussion started by: FattyLumpkin
3 Replies
Login or Register to Ask a Question