when i use ssh in my shell script it will promt for a password :(


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting when i use ssh in my shell script it will promt for a password :(
# 1  
Old 06-02-2011
when i use ssh in my shell script it will promt for a password :(

when i use ssh in my ssh in my shell script it is promt for the password
my command is
Code:
ssh user@server ls -l >log.txt

can some one suggest if i am doing wrong.


i dont want the script will prompt for a password promt.
my requirement is the shell script will take the password inside the shell script or automaticaly.

can some one help me on this issue.

Last edited by Franklin52; 06-02-2011 at 10:28 AM.. Reason: Please use code tags
# 2  
Old 06-02-2011
do ssh setup in the remote machine

HOWTO: set up ssh keys
# 3  
Old 06-02-2011
you can also try to your except program to avoid such prompt for any command.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP or scp with password in a batch script without using SSH keys and expect script

Dear All, I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
Discussion started by: ss112233
5 Replies

2. Shell Programming and Scripting

Ssh to 100s of hosts with password in a shell script or text file

I have about 500 hosts where I need to ssh by sending the password on the command line or in a text file in a clear text . However I am not able to download "sshpass" or other tools . Any other ways to pass the password in a script ? (3 Replies)
Discussion started by: gubbu
3 Replies

3. Shell Programming and Scripting

Passing password for ssh in Script

I want to do following 2 commands via script: 1) eval `ssh-agent`2) ssh-add /export/home/sufuser/.ssh/id_rsa When asked for passphrase enter "passwordpassword1234 but whenever I run the script it stucks after "ssh-add /export/home/sufuser/.ssh/id_rsa" command and asks fro... (4 Replies)
Discussion started by: yogeshpawar
4 Replies

4. Shell Programming and Scripting

Passing Password to SSH without using expect in a Script

How can I pass password in SSH command without using expect in a shell program. I don't have expect installed on my Solaris server. #!/bin/bash ssh user@hotname (how to supply pass in script?:wall:) Experts please help its very urgent. Shrawan Kumar Sahu (4 Replies)
Discussion started by: ss135r
4 Replies

5. Shell Programming and Scripting

ssh password script

ssh -L 9111:185.222.135.157:9222 -l xxmasrawy localhost i use this command to open tunnling between server and local host the return asked me for password i want to put this command in script and take password from script what can i do (2 Replies)
Discussion started by: xxmasrawy
2 Replies

6. Shell Programming and Scripting

ssh - passing password in shell script

I have a requirement, I need to run a command at remote system using a ssh. Is there any way we can pass the username and password in shell script to the ssh command as we did it in one of the shell script for FTP. ftp -n $i <<!EOF >> user Username $PASSWD cd /home/scripts ... (5 Replies)
Discussion started by: Muktesh
5 Replies

7. Shell Programming and Scripting

Script check if ssh requires a password???

Thanks to the help from this forum i've learned a lot of good stuff but I still have questions :). I need to write a script that checks if ssh to a box requires a password. I need it will be an "if" statement, if ssh requires password, then do a key exchange(with i already have). Just need to... (5 Replies)
Discussion started by: elbombillo
5 Replies

8. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

9. Shell Programming and Scripting

Sending ssh password in a script

Is there any way to send password in a sh script, to establish a ssh connection with the remote server, without having shared the public key? The command I'm currently using is in my script is !#/bin/sh ... ssh -l user remotehost "ls -l" I have shared the public key of the local... (3 Replies)
Discussion started by: farahzaiba
3 Replies

10. Solaris

password less login from openssh to SSH Secure Shell 3.0.1 Sun solaris 7

Hi, I would like to login from a Sun server running ssh: Sun_SSH_1.1, SSH protocols 1.5/2.0, OpenSSL 0x0090704f to ssh: SSH Secure Shell 3.0.1 on sparc-sun-solaris2.6 How can I achieve this? Thanks a million in advance (1 Reply)
Discussion started by: newbewie
1 Replies
Login or Register to Ask a Question