Sponsored Content
Top Forums UNIX for Advanced & Expert Users Automated SCP script passing password to preserve source file timestamp Post 302439979 by Corona688 on Sunday 25th of July 2010 11:33:04 AM
Old 07-25-2010
Ugh...

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.

Testing it here, copying from a remote host with scp -p does indeed preserve the timestamp, and without a password given pre-shared keys, and definitely non-interactively, deprived of any sort of terminal. I'd expect it to be an expect weirdness, or perhaps an odd version of ssh.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ftp copy: preserve source file date stamp

Is there any way to preserve a file's create/mod date stamp when it is "put" via ftp (or even using Fetch) to a Win2K server and a SunOS 5.8 server? For example, if I copy a file with a create/mod date of "01/15/2005 3:36 PM" to my Win2K or SunOS ftp server, the date stamp will change to the... (5 Replies)
Discussion started by: cassj
5 Replies

2. UNIX for Advanced & Expert Users

scp automated script

Hi Unix gurus, I am trying to create a script to automate the copying of files daily from one server to another using the scp command. --> #!/bin/ksh KEY="$HOME/.ssh/SSHKEY" if ;then echo "Private key not found at $KEY" >> $LOGFILE echo "* Please create it with \"ssh-keygen -t dsa\" *"... (5 Replies)
Discussion started by: gholdbhurg
5 Replies

3. Shell Programming and Scripting

preserve timestamp of symlinks using rsync

Hi, In my shell programming, When i copy sym links from one server to another server using rsync it does not preserve time stamp . it showing current time after copying in destination server.the command i used is rsync -vaR -- How can i preserve sym links time stamp using rsync. Thanx (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

4. Shell Programming and Scripting

Passing Password into scp Command

Hi Everyone, I'm trying to run scp as a one-line command, as of right now, it prompts me for the user's password to the remote machine. Does anyone know if there is an option to pass the password parameter into the scp command on the same line so it doesn't prompt me? Thanks! (1 Reply)
Discussion started by: twhitmarsh
1 Replies

5. UNIX for Advanced & Expert Users

How to copy a file from remote server and preserve timestamp

Hi How to copy a file from remote server and preserve timestamp. Please not, i have to pass username and password to connect to the remote server in the shell script. Can this be achieved with simple ftp ? are there any options in ftp ? Thanks (4 Replies)
Discussion started by: skumar75
4 Replies

6. Shell Programming and Scripting

Automated SCP from a job?

Hi all - I have a script which runs on the OS level, but refuses to run as a cron or as an Oracle job. The Script is pretty straight forward: #!/bin/bash username="MyUsername" host="Remote.server" path="Remote.directory/files/*.*" password="MyPassword" expect -c " spawn /usr/bin/scp... (3 Replies)
Discussion started by: danimaltex
3 Replies

7. Shell Programming and Scripting

Automated FTP without plaintext user/password in script

hi , i am a still beginner in unix and specially in ftp i've written this script but my admin asked me that he don't want to see in my ftp neither user neither password , so i've created .netrc file where in it i've put machine name , user and pass but still included in my script , so if someone... (19 Replies)
Discussion started by: semaan
19 Replies

8. Shell Programming and Scripting

Script should wait for password while doing scp

Hi team, need help on this :- trying to scp a file from A ( it could any server among hundreds not one) server to B server ( fixed ) . The script runs in a third server CFGEngine server. a. we dont use static password ( its pin + rsa token) so , "here documents" kind of thing is not... (3 Replies)
Discussion started by: gauravsharma29
3 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

Preserve destination timestamp while copying

Hi Guys, I am trying to copy a file from source to destination, I need to preseve timestamp of destination cd desitnation ll file.txt Aug 17 17:22 file.txt cp -p source/file.txt destination/ I need to preseve same timestamp after copying cd desitnation ll file.txt Aug 17... (9 Replies)
Discussion started by: rohit_shinez
9 Replies
asadmin-delete-connector-security-map(1)			   User Commands			  asadmin-delete-connector-security-map(1)

NAME
asadmin-delete-connector-security-map, delete-connector-security-map - deletesthe named security map for the given connector connection pool SYNOPSIS
delete-connector-security-map --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile filename] [--terse=false] [--echo=false] [--interactive=true] --poolname connector_connection_pool_name mapname Deletes the named security map for the given connector connection pool. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. Default is false. --echo setting to true will echo the command line statement on the standard output. Default is false. --interactive if set to true (default), only the required password options are prompted. --poolname connector connection pool name for which the security map that is to be deleted belongs to. OPERANDS
mapname name of the security map to be deleted. Example 1: Using delete-connector-security-map asadmin> delete-connector-security-map --user admin --password adminadmin --poolname connector-pool1 securityMap1 Command delete-connector-security-map executed successfully EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin- create-connector-security-map(1AS), asadmin-list-connector-security-maps(1AS), asadmin-update-connector-security-map(1AS) J2EE 1.4 SDK March 2004 asadmin-delete-connector-security-map(1)
All times are GMT -4. The time now is 10:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy