Sponsored Content
Top Forums Shell Programming and Scripting Passing Password to SSH without using expect in a Script Post 302546026 by pludi on Wednesday 10th of August 2011 08:43:27 AM
Old 08-10-2011
Use ssh-keygen to create a key pair and ssh-copy-id to copy the public key to another machine. From that point on ssh will automatically try to authenticate using the private key on the local machine.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect Script....encrypt password and use

Could someone please help me...I have an expect script. There's a need for a log in during the script and a password is required...right now the password is just a variable in the expect script...what would be the best way to put that in an encrypted flat file and have the expect script pull the... (2 Replies)
Discussion started by: cubs0729
2 Replies

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

3. Shell Programming and Scripting

SSH Login by passing password.

ssh/sftp login by passing password , is it possible.Don't want to expect. (1 Reply)
Discussion started by: dinjo_jo
1 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

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

6. Shell Programming and Scripting

tcl/expect magic ssh dictionary password

Hi gurus, I am trying to do some expect/TCL magic. My goal is to write some kind of password guessing script (nearly similar to dictionary attack against ssh). I read that this could be possible with expect/TCL, I am newbie in this language, its function and its terms so please be patient ;) ... (3 Replies)
Discussion started by: wakatana
3 Replies

7. Shell Programming and Scripting

Passing username and password to a script running inside "expect" script

Hi I'm trying to run a script " abc.sh" which triggers "use.sh" . abc.sh is nothing but a "expect" script which provides username and password automatically to the use.sh script. Please find below the scripts: #abc.sh #!/usr/bin/expect -f exec /root/use.sh expect "*name*" send... (1 Reply)
Discussion started by: baddykam
1 Replies

8. Shell Programming and Scripting

Passing password with SSH command

Hi Experts, I have specific requirement where I want to pass the password with the ssh username@hostname command . I dont want to use RSA public and private keys also. Because that will be on production server and no one wants to give access like that. Second thing it is production... (14 Replies)
Discussion started by: sharsour
14 Replies

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

10. Shell Programming and Scripting

Expect script not passing password / commands ??

Newbie here. My goal is to have the expect script log into the Ubuntu 18.04 server and run two commands (lsb_release -a and ip addr) and eventually pipe the output/results to a file. For now, I would be happy to get this one command or two to run successfully. How to fix this? #!/usr/bin/expect ... (3 Replies)
Discussion started by: jacob600
3 Replies
ssh-import-id(1)						    ssh-import							  ssh-import-id(1)

NAME
ssh-import-id - retrieve one or more public keys from a public keyserver (Launchpad.net by default) and append them to the current user's authorized_keys file (or some other specified file) SYNOPSIS
ssh-import-id [options] USER_ID_1 [USER_ID_2] ... [USER_ID_n] OPTIONS
-h | --help usage -o | --output F write output to file 'F' (default ~/.ssh/authorized_keys, use "-" for standard out) DESCRIPTION
This utility will securely contact a public keyserver (https://launchpad.net by default) and retrieve one or more user's public keys, and append these to the current user's ~/.ssh/authorized_keys file. The system administrator can change the source URL used by ssh-import-id(1) by editing the configuration file, /etc/ssh/ssh_import_id, which is sourced to obtain the value of URL. By default, URL="https://launchpad.net/~%s/+sshkeys". Note that this url really MUST be a secure, https url with a valid, signed certificate or else your system will be vulnerable to man-in-the-middle attacks! The "%s" will be populated by ssh-import-id(1) with the value(s) of USER_ID_1 [USER_ID_2] ... [USER_ID_n]. SEE ALSO
ssh(1) FILES
/etc/ssh/ssh_import_id AUTHOR
This manpage and the utility was written by Dustin Kirkland <kirkland@canonical.com> for Ubuntu systems (but may be used by others). Per- mission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. ssh-import 23 Feb 2010 ssh-import-id(1)
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy