Sponsored Content
Top Forums Shell Programming and Scripting SFTP script to automate login in to remote server Post 302822969 by Corona688 on Tuesday 18th of June 2013 12:37:31 PM
Old 06-18-2013
SSH keys are the noninteractive mode.

If they don't allow keys, then they probably don't allow automation, period. I'm sure they'd be livid to discover you automating it in blatantly insecure ways just because they didn't allow you to use the proper way.

You'd have to use a third-party brute forcing utility like expect and accept the security consequences of this poor practice.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Use cURL in shell script and get most recent file from remote server using SFTP

I have been trying to implement the following shell script -- sftp to remote server get list of files in the directory sftp get the most recent listed file exit This script will be scheduled to be executed everyday using CRON or CONTROL-M and the need is to have absolutely no human... (7 Replies)
Discussion started by: toobrown1
7 Replies

2. Shell Programming and Scripting

How to automate sftp without using expect script?

How to automate sftp with out using expect script? My batch file has the password but it is not taking. Please see below. I want to use this sftp connection in a loop for pushing new files in a directory one at a time. Hence I can not use an expect script. bash-2.05$... (5 Replies)
Discussion started by: Tuxidow
5 Replies

3. Programming

SFTP from one remote server to another remote server from desktop

Hi, I have 1. lappy 2. server A 3. server B Now, what i need is to run a command from lappy that will sftp a file from server A to server B. Please guide me to achieve this. -akash (1 Reply)
Discussion started by: akash.mahakode
1 Replies

4. Red Hat

Chroot sftp users, remote sftp login shows wrong timestamp on files

Hello, I have a weird issue, I have RHEL 5.7 running with openssh5.2 where sftpgroup OS group is chroot. I see the difference difference in timestamp on files, when I login via ssh and SFTP, I see four hour difference, is something missing in my configuration. #pwd... (8 Replies)
Discussion started by: bobby320
8 Replies

5. Shell Programming and Scripting

i want to execute shell script on remote server with in sftp session

Hi, I want to execute shell script with in sftp session for remote server. like i have a shell script test.sh that is on local server.i want to execute that script on remote server sftp user@192.168.56.10 sftp> test.sh ---execute for remote server not for local server. sftp... (3 Replies)
Discussion started by: SAUD PASHA
3 Replies

6. UNIX for Dummies Questions & Answers

Automate sftp process using script

Hi, guys, I am trying to automate a sftp process using "expect" method (since the key authentication method is disabled in my company network, there is no helping it). In order to try, I type in the command manually: sftp @ > << EOF >cd >ls -l >EOF >Connecting to @servername password: ... (3 Replies)
Discussion started by: warmboy610
3 Replies

7. HP-UX

Connect to remote server using sftp with password define within command/script

I am trying to connect to remote server in hp-ux, using sftp command (using sftp username@ip and password ) able to connect to remote server but, in this case sftp prompt for password and user need to manually enter it. I want sftp can read a password define in script or from file, so it can... (1 Reply)
Discussion started by: ketanraut
1 Replies

8. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

9. Shell Programming and Scripting

Running a script on remote server kills my login session

Hi there, I'm trying to run a script remotely on a server in a particular directory named after hostname which already exists, my login session gets killed as soon as I run the below command. Not sure what is wrong, is there a better way to do it ? Note: I can also use nohup command to run... (14 Replies)
Discussion started by: mbak
14 Replies
puttygen(1)							 PuTTY tool suite						       puttygen(1)

NAME
puttygen - public-key generator for the PuTTY tools SYNOPSIS
puttygen ( keyfile | -t keytype [ -b bits ] ) [ -C new-comment ] [ -P ] [ -q ] [ -O output-type | -l | -L | -p ] [ -o output-file ] DESCRIPTION
puttygen is a tool to generate and manipulate SSH public and private key pairs. It is part of the PuTTY suite, although it can also inter- operate with the private key formats used by some other SSH clients. When you run puttygen, it does three things. Firstly, it either loads an existing key file (if you specified keyfile), or generates a new key (if you specified keytype). Then, it optionally makes modifications to the key (changing the comment and/or the passphrase); finally, it outputs the key, or some information about the key, to a file. All three of these phases are controlled by the options described in the following section. OPTIONS
In the first phase, puttygen either loads or generates a key. Note that generating a key requires random data (from /dev/random), which can cause puttygen to pause, possibly for some time if your system does not have much randomness available. The options to control this phase are: keyfile Specify a private key file to be loaded. This private key file can be in the (de facto standard) SSH-1 key format, or in PuTTY's SSH-2 key format, or in either of the SSH-2 private key formats used by OpenSSH and ssh.com's implementation. -t keytype Specify a type of key to generate. The acceptable values here are rsa and dsa (to generate SSH-2 keys), and rsa1 (to generate SSH-1 keys). -b bits Specify the size of the key to generate, in bits. Default is 1024. -q Suppress the progress display when generating a new key. In the second phase, puttygen optionally alters properties of the key it has loaded or generated. The options to control this are: -C new-comment Specify a comment string to describe the key. This comment string will be used by PuTTY to identify the key to you (when asking you to enter the passphrase, for example, so that you know which passphrase to type). -P Indicate that you want to change the key's passphrase. This is automatic when you are generating a new key, but not when you are modifying an existing key. In the third phase, puttygen saves the key or information about it. The options to control this are: -O output-type Specify the type of output you want puttygen to produce. Acceptable options are: private Save the private key in a format usable by PuTTY. This will either be the standard SSH-1 key format, or PuTTY's own SSH-2 key format. public Save the public key only. For SSH-1 keys, the standard public key format will be used (`1024 37 5698745...'). For SSH-2 keys, the public key will be output in the format specified by RFC 4716, which is a multi-line text file beginning with the line `---- BEGIN SSH2 PUBLIC KEY ----'. public-openssh Save the public key only, in a format usable by OpenSSH. For SSH-1 keys, this output format behaves identically to public. For SSH-2 keys, the public key will be output in the OpenSSH format, which is a single line (`ssh-rsa AAAAB3NzaC1yc2...'). fingerprint Print the fingerprint of the public key. All fingerprinting algorithms are believed compatible with OpenSSH. private-openssh Save an SSH-2 private key in OpenSSH's format. This option is not permitted for SSH-1 keys. private-sshcom Save an SSH-2 private key in ssh.com's format. This option is not permitted for SSH-1 keys. If no output type is specified, the default is private. -o output-file Specify the file where puttygen should write its output. If this option is not specified, puttygen will assume you want to overwrite the original file if the input and output file types are the same (changing a comment or passphrase), and will assume you want to output to stdout if you are asking for a public key or fingerprint. Otherwise, the -o option is required. -l Synonym for `-O fingerprint'. -L Synonym for `-O public-openssh'. -p Synonym for `-O public'. The following options do not run PuTTYgen as normal, but print informational messages and then quit: -h, --help Display a message summarizing the available options. -V, --version Display the version of PuTTYgen. --pgpfp Display the fingerprints of the PuTTY PGP Master Keys, to aid in verifying new files released by the PuTTY team. EXAMPLES
To generate an SSH-2 RSA key pair and save it in PuTTY's own format (you will be prompted for the passphrase): puttygen -t rsa -C "my home key" -o mykey.ppk To generate a larger (2048-bit) key: puttygen -t rsa -b 2048 -C "my home key" -o mykey.ppk To change the passphrase on a key (you will be prompted for the old and new passphrases): puttygen -P mykey.ppk To change the comment on a key: puttygen -C "new comment" mykey.ppk To convert a key into OpenSSH's private key format: puttygen mykey.ppk -O private-openssh -o my-openssh-key To convert a key from another format (puttygen will automatically detect the input key type): puttygen my-ssh.com-key -o mykey.ppk To display the fingerprint of a key (some key types require a passphrase to extract even this much information): puttygen -l mykey.ppk To add the OpenSSH-format public half of a key to your authorised keys file: puttygen -L mykey.ppk >> $HOME/.ssh/authorized_keys BUGS
There's currently no way to supply passphrases in batch mode, or even just to specify that you don't want a passphrase at all. PuTTY tool suite 2004-03-24 puttygen(1)
All times are GMT -4. The time now is 02:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy