Sponsored Content
Top Forums Shell Programming and Scripting How to put scp in background inside expect Post 302420074 by Corona688 on Monday 10th of May 2010 01:25:13 PM
Old 05-10-2010
That you're having to shoehorn a stored plaintext password into scp's otherwise secure authentication system with expect is a subtle hint, writ in mile-high flashing neon letters: You're not supposed to do this. It's designed to stop you doing this for security reasons, use pre-shared keys instead -- it's what they're there for. There's instructions for it plastered all over the internet. They do exactly what you want except they don't have the security problems of storing a plaintext password, and don't have the poor reliability and extra wait and extra software requirements of an interactive input manually brute-forced with expect.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to store output in variable when put in background

Hi, How do I store following command output: export RESULT=`date` & It works when I do : export RESULT=`date` But what I need is when command put it background, I also need that output going to RESULT variable. Is there any way ? Thanks Sanjay (1 Reply)
Discussion started by: sanjay92
1 Replies

2. UNIX for Advanced & Expert Users

How to put vi file_names in background mode?

HI, When I used to work with Sun Solaris, I used to open multiple files and without closing it I will put them in background mode(using Ctrl-ZZ). In this way I will have 4-5 files open and using fg %2, I can vi the second file..while the rest of the files will be in background mode! I want to... (4 Replies)
Discussion started by: thiagoo
4 Replies

3. Shell Programming and Scripting

put an interactive script in background after taking input

i am trying to find a way to put an interactive script in the background after taking input from the user a few test lines i was trying: date echo "Enter location" LOCATION= read LOCATION sleep 100 sleep 200 date for this small example i want the script to as the user for the... (7 Replies)
Discussion started by: epsilonaurigae
7 Replies

4. UNIX for Dummies Questions & Answers

kill a command I am running / then put it to background

I have a command running in the foreground (and so my term window is locked up) and I want to kill it, then resume it in the background and go home. It is creating a zip file, and the file will be written to the current directory - no std in / std out issues. How do I do this? Kill it with a... (3 Replies)
Discussion started by: hindesite
3 Replies

5. Shell Programming and Scripting

How can put a background process to the foreground

Hi, guys: I am working on my own shell using c. When I put a process into the background, how can I put it back to the foreground using tcsetpgrp? Thanks (3 Replies)
Discussion started by: tomlee
3 Replies

6. Programming

Calling expect script inside another expect

Hi, Am very new to expect scripting.. Can You please suggest me how to call an expect script inside another expect script.. I tried with spawn /usr/bin/ksh send "expect main.exp\r" expect $root_prompt and spawn /usr/bin/ksh send "main.exp\r" expect $root_prompt Both... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies

7. Shell Programming and Scripting

scp not working in expect script

Hi All, I run the scp command in shell prompt without issue, but when on expect script as below: #!/usr/bin/expect spawn scp /var/spool/sms/failed.tar.gz abc@10.10.12.2:/home/abc expect "abc@10.10.12.2's password: " send "abcfef\r" exit 0 It looks not working at all and the... (3 Replies)
Discussion started by: elingtey
3 Replies

8. Linux

Not able to put ls -lR command in background

Hi All, i am trying to put ls -lRt command to run in the background but it fails. i continue to get output on screen and didnt get the command prompt right after i put the command in background. command i am using is ls -lRt & i am using bash. Can someone let me know how to... (6 Replies)
Discussion started by: omkar.jadhav
6 Replies

9. Shell Programming and Scripting

scp script getting timed out with expect

Hi, I have an expect script where in i am trying to scp a folder but it is getting timed out. Any help will be appreciated. (I don't have the option for sharing keys) expect -c 2> /dev/null " spawn scp -r -o NumberOfPasswordPrompts=1 -o StrictHostKeyChecking=no root@10.10.10.10:test_dir... (2 Replies)
Discussion started by: temp_user
2 Replies

10. Shell Programming and Scripting

Put currently running script into background

Hi All, Suppose I have a script and inside it I want/need to put it into background. I need the script to not react to SIGHUP signals. I tried: #!/bin/bash echo "" > test_disown mypid=$$ echo "PID=$mypid" ( kill -SIGSTOP $mypid jobs > myjobs #disown -h <job-spec> #kill -SIGCONT $mypid )... (6 Replies)
Discussion started by: JackK
6 Replies
UnixCrypt(3pm)						User Contributed Perl Documentation					    UnixCrypt(3pm)

NAME
Crypt::UnixCrypt - perl-only implementation of the "crypt" function. SYNOPSIS
use Crypt::UnixCrypt; $hashed = crypt($plaintext,$salt); # always use this module's crypt BEGIN { $Crypt::UnixCrpyt::OVERRIDE_BUILTIN = 1 } use Crypt::UnixCrypt; DESCRIPTION
This module is for all those poor souls whose perl port answers to the use of "crypt()" with the message `The crypt() function is unimple- mented due to excessive paranoia.'. This module won't overload a built-in "crypt()" unless forced by a true value of the variable $Crypt::UnixCrypt::OVERRIDE_BUILTIN. If you use this module, you probably neither have a built-in "crypt()" function nor a crypt(3) manpage; so I'll supply the appropriate por- tions of its description (from my Linux system) here: crypt is the password encryption function. It is based on the Data Encryption Standard algorithm with variations intended (among other things) to discourage use of hardware implementations of a key search. $plaintext is a user's typed password. $salt is a two-character string chosen from the set [a-zA-Z0-9./]. This string is used to perturb the algorithm in one of 4096 different ways. By taking the lowest 7 bit of each character of $plaintext (filling it up to 8 characters with zeros, if needed), a 56-bit key is obtained. This 56-bit key is used to encrypt repeatedly a constant string (usually a string consisting of all zeros). The returned value points to the encrypted password, a series of 13 printable ASCII characters (the first two characters represent the salt itself). Warning: The key space consists of 2**56 equal 7.2e16 possible values. Exhaustive searches of this key space are possible using massively parallel computers. Software, such as crack(1), is available which will search the portion of this key space that is generally used by humans for passwords. Hence, password selection should, at minimum, avoid common words and names. The use of a passwd(1) program that checks for crackable passwords during the selection process is recommended. The DES algorithm itself has a few quirks which make the use of the crypt(3) interface a very poor choice for anything other than password authentication. If you are planning on using the crypt(3) interface for a cryptography project, don't do it: get a good book on encryption and one of the widely available DES libraries. COPYRIGHT
This module is free software; you may redistribute it and/or modify it under the same terms as Perl itself. AUTHORS
Written by Martin Vorlaender, martin@radiogaga.harz.de, 11-DEC-1997. Based upon Java source code written by jdumas@zgs.com, which in turn is based upon C source code written by Eric Young, eay@psych.uq.oz.au. CAVEATS
In extreme situations, this function doesn't behave like crypt(3), e.g. when called with a salt not in [A-Za-z0-9./]{2}. SEE ALSO
perl(1), perlfunc(1), crypt(3). perl v5.8.8 1999-10-21 UnixCrypt(3pm)
All times are GMT -4. The time now is 09:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy