Removing banners from scp calls (AIX/KSH)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Removing banners from scp calls (AIX/KSH)
# 1  
Old 06-16-2009
Removing banners from scp calls (AIX/KSH)

Hello all!
I am creating a script to synchronize key files on multiple servers in our environment. What I have works, but I am getting the banner for each of the servers in the output and it makes it difficult to quickly review when there are over a dozen servers in the array. I have tried a few different ways to suppress the banner (pipe this to grep for example) but nothing seems to work. Can someone offer a suggestion on how I could remove the banner text? Thanks in advance!

What I have today is:
Code:
 
SERVERNAME=`uname -n`
FILEDIR=/foo/bar
FILENAME=some.ini
for i in server2 server3 server5 server7 server8 server9 server10 
do
  if echo "$i" | grep -q "$SERVERNAME"
  then
    echo "Local machine, skipping..."
  else
    echo $i
    scp -p $FILEDIR/$FILENAME $i:$FILEDIR
  fi
done

The output looks like
Quote:
server2
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text
some.ini 100% 307 0.3KB/s 00:00
server3
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text Legal Text Legal Text Legal Text
Legal Text Legal Text Legal Text
some.ini 100% 307 0.3KB/s 00:00

Last edited by cpare; 06-16-2009 at 04:50 PM..
# 2  
Old 06-16-2009
What have you tried with grep?

You can use the -v option to exclude lines.

Regards
# 3  
Old 06-16-2009
When I do the following line in the shell by hand it runs just fine, but shows the banner
Code:
scp -p /foo/bar/some.ini server2:/foo/bar

When I try
Code:
scp -p /foo/bar/some.ini server2:/foo/bar |grep some.ini

I only see the banner, not the result line I am actually interested in.
When I try
Code:
grep some.ini `scp -p /foo/bar/some.ini server2:/foo/bar`

it shows the banner, and then appears to wait for input (I have been escaping out).
When I try
Code:
scp -p /foo/bar/some.ini server2:/foo/bar |grep -v some.ini

I only see the banner, not the result line I am actually interested in (seems to be the same as without -v).

Could it be because this data isn't coming back through stdout? I found this for debian - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=134589

Last edited by cpare; 06-16-2009 at 04:54 PM..
# 4  
Old 06-16-2009
You can try putting a ".hushlogin" file in your home directory on the remote server(s).
# 5  
Old 06-16-2009
Quote:
Originally Posted by achenle
You can try putting a ".hushlogin" file in your home directory on the remote server(s).
Thanks for this suggestion, however I tried this earlier as well with no success. There must be a globl setting that overrides this...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

ASK | How to scp command AIX to windows

Hii Master, im will copy file/directory aix to windows with scp commandline, but some error below: Note: If ping to 172.16.0.250 reply and was connected, and was open/allow port 22 at windows server inbound In aix finish installing ssh in windows finish installing winscp my... (3 Replies)
Discussion started by: williamen
3 Replies

2. Red Hat

TCP banners for httpd

Can this be done for httpd also? Reading the manul it does not mention httpd at all. Basically, what I want to do is disable the ability of the user to see what type of system the web server is on. Can I:- 1. Add /etc/banners/httpd file and add some text in here. 2. Edit hosts.allow to... (1 Reply)
Discussion started by: psychocandy
1 Replies

3. Shell Programming and Scripting

scp list of files using FOR LOOP in ksh

hi i want to scp files from remote server B to my local server A... and i have a file containing list of all files to be scped from remote server B there is a passwordless connectivity set between remote server and my local server. need a ksh script.. with a for loop that goes through... (2 Replies)
Discussion started by: billpeter3010
2 Replies

4. Shell Programming and Scripting

Problem while scp if bashrc calls Perl script

A weird thing, happened today: When i do SCP from a remote server, file is not getting copied to here. Application Server: Here is where i work, and have a login. I have several tweaks in .bashrc, and along with all those, today i called a PERL script from bashrc. So when ever i do scp from a... (4 Replies)
Discussion started by: thegeek
4 Replies

5. AIX

ssh and scp in aix 4.3.3

I'm using scp to copy files to another company via our 4.3.3 server. I am having transfer problems right at the transfer point in scp. Below are 2 debug outputs showing the bottleneck. The lower level debug preceeds the higher level debug output. It just seems to stop and refuses to transfer... (0 Replies)
Discussion started by: oldogbert
0 Replies

6. AIX

SCP from UNIX to AIX

Hi, I want to use SCP to transfer files from HP - UNIX to IBM AIX I have generated keys using ssh-keygen -t rsa on the UNIX box. I have copied the public key to the AIX box to the HOME_DIR of the user /.ssh/ authorized_keys When i try to use SCP it is still asking for a password.... (8 Replies)
Discussion started by: vijaykrc
8 Replies

7. HP-UX

SCP HP-UNIX to IBX-AIX

Hi, I want to use SCP to transfer files from HP - UNIX to IBM AIX I have generated keys using ssh-keygen -t rsa on the UNIX box. I have copied the public key to the AIX box to the HOME_DIR of the user /.ssh/ authorized_keys When i try to use SCP it is still asking for a password.... (2 Replies)
Discussion started by: vijaykrc
2 Replies

8. AIX

AIX intercepting system calls

hi, How to intercept existing system calls by kernel extensions on AIX? (2 Replies)
Discussion started by: ramkumar.pvs
2 Replies

9. IP Networking

Identification of data calls & voice calls

Is there any facility to filter/identify the data calls and voice calls coming throug modem? OR Can we get the data or voice calls information through a script(preferably C Kermit)? (0 Replies)
Discussion started by: pcsaji
0 Replies

10. AIX

Problems with scp in AIX-5.2

I am using ssh version OpenSSH_3.8p1, SSH protocols 1.5/2.0, OpenSSL 0.9.6l When i ssh to this server its working fine ,sftp is also fine ,but when i use scp to copy files to it i am prompted for the password and on entering it throws up the following error stty: tcgetattr: A... (1 Reply)
Discussion started by: arnab
1 Replies
Login or Register to Ask a Question