Sponsored Content
Top Forums Shell Programming and Scripting SFTP using user id and password Post 302417162 by binlib on Wednesday 28th of April 2010 05:46:00 PM
Old 04-28-2010
To fool a program into thinking that it's running in interactive mode, use expect. Or use a pty wrapper like a perl module or write a C program.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sftp prompting for password

I have the problem with SFTP; BELOW IS the entry from my ssh_config file It's prompting me for password all the time when using SFTP. pLEASE help. (1 Reply)
Discussion started by: dsravan
1 Replies

2. UNIX for Advanced & Expert Users

password verification verify password of a user for only first 8 characters

Helo , I m using linux pam library for user and its password authentication. I m creating new user and giving its password.I m giving password of 10 characters.now when I login in as that newly created user its ask me $ su - ram Password: You are required to change your password immediately... (12 Replies)
Discussion started by: amitpansuria
12 Replies

3. UNIX for Advanced & Expert Users

How to use SFTP from command line without entering user and password

I would like to use SFTP from command line without entering userid and password. Here is what I have gathered and did. 1) Create a public and private key pair for the protocol you want to use. To create a key pair for use by SSH2, enter: ssh-keygen -t dsa I did that and got... (7 Replies)
Discussion started by: Hangman2
7 Replies

4. Shell Programming and Scripting

password - SFTP

Hi team, I know if we need to transfer the files between between 2 servser, we use SFTP through key setup between 2 server. currently There are some problems and we are not able to setup keys between servers. How can i use password with SFTP for temporary solutions, so that the file... (6 Replies)
Discussion started by: Amit.Sagpariya
6 Replies

5. Shell Programming and Scripting

sftp is asking password

Hi i have generate public private key pair using command ssh-keygen -t rsa -b 2048 and then it made the two keys under the directory ~/.ssh ( in server 1) one is public key and another one is private .. i copied public one key onto my second server under the directory ... (22 Replies)
Discussion started by: aishsimplesweet
22 Replies

6. Shell Programming and Scripting

SFTP with Password

Hi Guys, I need to know how can i achieve SFTP "with" password in a shell script. I have already done passwordless key generation thing and it is working but at the moment i am interested in passing a password. And another question I have is say i have a.ksh and b.sh scripts...Can i invoke... (6 Replies)
Discussion started by: Arpit Narula
6 Replies

7. Shell Programming and Scripting

SFTP prompting for password even though password is in script

Hi All, I am trying to transfer a file from one server to a remote server using SFTP. Client is not ready for key setup. I am working on Solaris 10. Here is the code. #!/bin/ksh # sample automatic Sftp script to dump a file USER="user1" PASSWORD="pass1" HOST="host1" sftp $USER@$HOST... (6 Replies)
Discussion started by: megha2525
6 Replies

8. Shell Programming and Scripting

Sftp with password

I have been tasked with scripting a sftp transfer from my clients sftp server to a vendor. I have been given a user name and password. This is an older OEL server, 5.2. I am not able to install any packages on this system. It does not have expect, ssh-pass, or any other ssh password helper... (6 Replies)
Discussion started by: mtrgoose
6 Replies

9. Shell Programming and Scripting

Passwordless sftp using a different user than the runtime user

I am running a shell script as user A. In that script I need to execute a sftp that would transfer the file using another user B. I am using the below command: sftp -oPort22 B@remote server However, I am getting password prompts each time. I have done the following: Added the public... (4 Replies)
Discussion started by: mady135
4 Replies
IO::Pty::Easy(3pm)					User Contributed Perl Documentation					IO::Pty::Easy(3pm)

NAME
IO::Pty::Easy - Easy interface to IO::Pty VERSION
version 0.09 SYNOPSIS
use IO::Pty::Easy; my $pty = IO::Pty::Easy->new; $pty->spawn("nethack"); while ($pty->is_active) { my $input = # read a key here... $input = 'Elbereth' if $input eq "ce"; my $chars = $pty->write($input, 0); last if defined($chars) && $chars == 0; my $output = $pty->read(0); last if defined($output) && $output eq ''; $output =~ s/Elbereth/e[35mElberethe[m/; print $output; } $pty->close; DESCRIPTION
"IO::Pty::Easy" provides an interface to IO::Pty which hides most of the ugly details of handling ptys, wrapping them instead in simple spawn/read/write commands. "IO::Pty::Easy" uses IO::Pty internally, so it inherits all of the portability restrictions from that module. METHODS
new(%params) The "new" constructor initializes the pty and returns a new "IO::Pty::Easy" object. The constructor recognizes these parameters: handle_pty_size A boolean option which determines whether or not changes in the size of the user's terminal should be propageted to the pty object. Defaults to true. def_max_read_chars The maximum number of characters returned by a "read()" call. This can be overridden in the "read()" argument list. Defaults to 8192. raw A boolean option which determines whether or not to call "set_raw()" in IO::Pty after "spawn()". Defaults to true. spawn(@argv) Fork a new subprocess, with stdin/stdout/stderr tied to the pty. The argument list is passed directly to "exec()". Returns true on success, false on failure. read($timeout, $length) Read data from the process running on the pty. "read()" takes two optional arguments: the first is the number of seconds (possibly fractional) to block for data (defaults to blocking forever, 0 means completely non-blocking), and the second is the maximum number of bytes to read (defaults to the value of "def_max_read_chars", usually 8192). The requirement for a maximum returned string length is a limitation imposed by the use of "sysread()", which we use internally. Returns "undef" on timeout, the empty string on EOF, or a string of at least one character on success (this is consistent with "sysread()" and Term::ReadKey). write($buf, $timeout) Writes a string to the pty. The first argument is the string to write, which is followed by one optional argument, the number of seconds (possibly fractional) to block for, taking the same values as "read()". Returns undef on timeout, 0 on failure to write, or the number of bytes actually written on success (this may be less than the number of bytes requested; this should be checked for). is_active Returns whether or not a subprocess is currently running on the pty. kill($sig, $non_blocking) Sends a signal to the process currently running on the pty (if any). Optionally blocks until the process dies. "kill()" takes two optional arguments. The first is the signal to send, in any format that the perl "kill()" command recognizes (defaulting to "TERM"). The second is a boolean argument, where false means to block until the process dies, and true means to just send the signal and return. Returns 1 if a process was actually signaled, and 0 otherwise. close Kills any subprocesses and closes the pty. No other operations are valid after this call. handle_pty_size Read/write accessor for the "handle_pty_size" option documented in the constructor options. def_max_read_chars Read/write accessor for the "def_max_read_chars" option documented in the constructor options. pid Returns the pid of the process currently running in the pty, or undef if no process is running. BUGS
No known bugs. Please report any bugs through RT: email "bug-io-pty-easy at rt.cpan.org", or browse to http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IO-Pty-Easy <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IO-Pty-Easy>. SEE ALSO
IO::Pty (This module is based heavily on the try script bundled with IO::Pty.) Expect IO::Pty::HalfDuplex SUPPORT
You can find this documentation for this module with the perldoc command. perldoc IO::Pty::Easy You can also look for information at: o AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/IO-Pty-Easy <http://annocpan.org/dist/IO-Pty-Easy> o CPAN Ratings http://cpanratings.perl.org/d/IO-Pty-Easy <http://cpanratings.perl.org/d/IO-Pty-Easy> o RT: CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=IO-Pty-Easy <http://rt.cpan.org/NoAuth/Bugs.html?Dist=IO-Pty-Easy> o Search CPAN http://search.cpan.org/dist/IO-Pty-Easy <http://search.cpan.org/dist/IO-Pty-Easy> AUTHOR
Jesse Luehrs <doy at tozt dot net> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Jesse Luehrs. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-03-05 IO::Pty::Easy(3pm)
All times are GMT -4. The time now is 05:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy