Help with ssh command in shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with ssh command in shell script
# 1  
Old 05-21-2009
Error Help with ssh command in shell script

Hi All,

I am using ssh in my shell script. Can any one please suggest me option so that i can avoid the login message as below in the execution:

NOTE:
Please note that you have logged into the newer version of server "gabbro"
*******


Performing functions to this computer withe the intention of accessing
any computer services, programs or data, to which you are not authorised
is a criminal offence and is prohibited under the Computer Misuse Act 1990.

ANY PERSON OR COMPANY CONTRAVENING THIS POLICY WILL BE SUBJECT TO LEGAL ACTION.
# 2  
Old 05-21-2009
Code:
 
man ssh

Code:
 
I think ssh -f or ssh -n is wht u r looking for.

# 3  
Old 05-21-2009
No buddy. Its giving something else. I was using ssh -q but still its giving some warning/message
# 4  
Old 05-21-2009
Did you try passwordless ssh?
# 5  
Old 05-21-2009
Ya,

its simply ssh -q user@server
# 6  
Old 05-21-2009
Quote:
Originally Posted by vikash_k
Can any one please suggest me option so that i can avoid the login message as below in the execution[/I][/SIZE]
I don't think the system admin of the server running ssh would be happy if they knew you were trying to circumvent their standard warning message.
# 7  
Old 05-21-2009
It depends how you are using SSH in your script. You could filter out the banner using a regex, or maybe try the Expect module.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

The Shell lost the inverted comma in a nested ssh command

Hi, i want use this Comand for my psql request sh ssh -o StrictHostKeyChecking=no rootatemailaddress.de sudo psql -U postgres -c "select pg_terminate_backend(pid) from pg_stat_activity where datnam=\'$DB\';"'" but the shell lost the inverted comma for datnam=\'$DB\'. The request deliver... (2 Replies)
Discussion started by: peterpane007
2 Replies

2. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies

3. Shell Programming and Scripting

Shell script for ssh command listening

Hi, I'm trying to write a shell script checks if there is ssh command listening on port 1080 at loop back interface. If there is, just exit nicely with exit code 0. If not, start command: #ssh -D 1080 smsuser@10.76.172.23 ping -i 60 localhost The ssh keys needs to be generated and... (2 Replies)
Discussion started by: Kijana_kenn
2 Replies

4. Shell Programming and Scripting

issue on ssh command in ksh shell

Hi guru, I'm making crazy cause an issue on a ksh shell I made. In this shell I want to execute unix command on a remote machine using an ssh connection like ssh user@host 'command'..... The command is very simply, is an ls on a remote directory but it give me an unexpected result. The... (4 Replies)
Discussion started by: leobdj
4 Replies

5. UNIX for Dummies Questions & Answers

ssh command to execute shell script in another server

ssh -q <hostname> /opt/tcs/satish/tst.ksh ssh -q <anotherserver> /opt/tcs/satish/tst.ksh tst.ksh has "nohup <command> & " when i execute below script , its throwing error as nohup can not be found ssh -q <anotherserver> /opt/tcs/satish/tst.ksh > log & can someone let me... (5 Replies)
Discussion started by: only4satish
5 Replies

6. Shell Programming and Scripting

Shell Script with ssh command

How do I use the ssh command to connect to another server without the password prompt? I use: ssh user@host and it prompts for the password. how do I include the password in the ssh command? alternatively, how do you execute 1 command from server A on server B? thanks, ... (4 Replies)
Discussion started by: toughlittleone
4 Replies

7. Shell Programming and Scripting

executing command in a remote machine through ssh - shell script

Hi All, i have two machines like x and y . my requirement is i should connect to machine Y from x through ssh connection . and do some operation such as copy and move and delete files in Y machine . i tried with this code but it is doing in machine x only . and i need to exit from Y when... (1 Reply)
Discussion started by: rateeshkumar
1 Replies

8. Shell Programming and Scripting

Shell script with wget in ssh command

Hi, I am using a linux with bash. I have a script written which will login to a remote server and from there it runs a "wget" to downlaod a build file from a webserver. Here is the line inside the script: ssh -t -q -o StrictHostKeyChecking=no -o ConnectTimeout=5 root@${a}'wget... (4 Replies)
Discussion started by: sunrexstar
4 Replies

9. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

10. Shell Programming and Scripting

How to use ssh command in the shell script without user intervention?

Hello All, I need your help, i would like to know how to use ssh command in the shell scripts? and make the script continue to enter the password without user intervention example of the normal commands written manually: # ssh 172.30.1.256 -l mxread password: mxread Thanks in advance (3 Replies)
Discussion started by: Dendany83
3 Replies
Login or Register to Ask a Question