ssh query


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ssh query
# 1  
Old 05-25-2009
ssh query

hi guys!!

i am writing a script in the middle of which i do ssh to some machine,

for eg: ssh root@1.1.1.1

this prompt me for password.. since i know the password of the machine, is there anyway by which i can provide password to ssh command? so that i am not prompted for password.

As my scripts goes to the end user. i dont want user to enter any sort of info.

thanks in advance
# 2  
Old 05-25-2009
If you search the site for "SSH automate password" you'll get a grand of results, all dealing with that problem, using either expect or public key authentication.
# 3  
Old 05-25-2009
you can follow this link for passwd less ssh login

ssh-keygen: password-less SSH login
# 4  
Old 05-26-2009
Quote:
Originally Posted by amitranjansahu
you can follow this link for passwd less ssh login

ssh-keygen: password-less SSH login
hi amitranjansahu,

thanks for the link. it was really usefull but when i generate key through "ssh-keygen" command it prompted me for "Enter file in which to save the key"
& "Enter passphrase "

now i was thinking to some how automate above two options, so end user dont have to type anything.. i mean user should only run my script, no further action user should take..

can you help me on this?

thanks

-----Post Update-----

Quote:
Originally Posted by pludi
If you search the site for "SSH automate password" you'll get a grand of results, all dealing with that problem, using either expect or public key authentication.
hi pludi,

Sorry I am bothering you again; can we also automate scp command for the password less copying? As we did for ssh command.

As i found similar types of flags associated with both scp and ssh command, hence i was asking?

Thanks

Last edited by allrise123; 05-26-2009 at 05:43 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Query regarding PuTTY SSH Tunneling

I have a process running on my local server. http://dev.techx.com:6060/proct I wish to block port 6060 and expose port 7777 to the outside world. I block port 6060 and open port 7777 on the firewall. What should be the PuTTY Settings -> Connection -> SSH -> Tunnels 1. Destination ... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. Shell Programming and Scripting

Run sql query after ssh in UNIX

I am running this test.ksh on server1. It successfully logins to server2 but runs the queries of query.sql on server1. query.sql is present in both server1 and server2 Can anybody please help. I need to run queries on server2 itself.:confused: Below is the test script... (10 Replies)
Discussion started by: shruthimithra
10 Replies

3. Shell Programming and Scripting

Query on executing awk using SSH

Hi All, Im trying to find the count of process running on remote server using SSH. Below command dosen't work. ssh -q user@host "ps -ef | grep "pattern" | grep -v 'grep' | awk '{print $2}'|wc -l" But below command works. ssh -q user@host "ps -ef | grep "pattern" | grep -v... (1 Reply)
Discussion started by: Girish19
1 Replies

4. Shell Programming and Scripting

Query related to the SSH key pairs

Hi All, I have question , How to generate the SSH keys for the two servers in the pair. So if the server will be replicated , same SSH key pairs will work on each server. No need to generate the SSH keys for the second server. I have created the SSH keys for the single server. I was... (1 Reply)
Discussion started by: sharsour
1 Replies

5. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

6. Shell Programming and Scripting

run query in shell script after ssh

Hi, I need to run sql query in shell script after getting connected to ssh. For that I connected to ssh through shell script using RSA keys done]. Now when I am running sql query, it's not working... but several other commands like 'ls'. 'mkdir', etc are working properly. Here is my code: ... (2 Replies)
Discussion started by: shekhar2010us
2 Replies

7. Solaris

[Solved] SSH Query differences Solaris 9/10

Hi, I am trying to SSH without a password from a Solaris 10 box to a Solaris 9 box. I am not using root user but file permissions seem to be fine... Can anyone tell me why this might not be working?! I can successfully SSH without a password from the Solaris 9 box to the Solaris 10 box,... (0 Replies)
Discussion started by: mcclunyboy
0 Replies

8. Shell Programming and Scripting

Query regarding ssh keygen

Hi, I have two Unix servers A and B. I have a script in server A. I want to connect to server B from A using ssh only and without giving passwords everytime i connect. I went through other posts regarding this and I generated a public key in server A and copied that in server B. Now when I... (3 Replies)
Discussion started by: mick_000
3 Replies

9. Shell Programming and Scripting

Help with quotes in query with ssh and su

Hi I have to run a query in a remote postgresql server but I'm having troubles with quotes, what I need to do is: Login to remote server su as cpanel user execute the query The following code works well if USERH is a numerical value, the problem is went USERH is a string (example... (8 Replies)
Discussion started by: Datacenter1
8 Replies

10. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

Hi, I have a requirement as below which needs to be done viz UNIX shell script (1) I have to connect to an Oracle database (2) Exexute "SELECT field_status from table 1" query on one of the tables. (3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies
Login or Register to Ask a Question