ssh password script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ssh password script
# 1  
Old 05-24-2010
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  
Old 05-24-2010
You can use expect(1) or use key file authentication.

See the links on the bottom or search the forum.
# 3  
Old 05-25-2010
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

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

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

4. Shell Programming and Scripting

Passing password in script for ssh connection - no except

Used the script posted on forum - unix.com/shell-programming-scripting/21597-script-change-passwords-same-user-multiple-servers.html but the last question posted on this seems to be still unanswered, tried different things with no success, can someone help giving an way to pass the password via... (5 Replies)
Discussion started by: sapadmin
5 Replies

5. Shell Programming and Scripting

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 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... (2 Replies)
Discussion started by: alokjyotibal
2 Replies

6. Shell Programming and Scripting

Create script for change root password via SSH

HI I 'm new shall script and unix. I want to create script for change password root by ssh-keygen command . I have 50 servers and I want ot login ot the servers via ssh by type ones password and can login every machines.The script ssh-keygen must ot generate key every weekly than it send new... (2 Replies)
Discussion started by: pellnapook
2 Replies

7. HP-UX

sftp/scp/ssh script with password as authentication

Hello, Do you guys know set of commands that can incorporate to sftp/scp/ssh to add password in a script to automate file transfer. Our client is not using ssh keys authentication so we are force to create a script to pass the password into the script to transfer files via sftp/scp/ssh. We... (4 Replies)
Discussion started by: james_falco
4 Replies

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

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

10. 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
Login or Register to Ask a Question