Sponsored Content
Top Forums Shell Programming and Scripting 1 Script Not Sending Password - Other Scripts OK Post 303014352 by Wrjames2 on Friday 9th of March 2018 10:38:15 PM
Old 03-09-2018
I still have to type in the password...

This script .....

Code:
HOST=invtransfer@52.44.151.220
USER=invtransfer
PASSWORD='XXX$XXX'
sftp $HOST <<EOF
send $PASSWORD
get INVENTORY.txt
quit
EOF

Does this.. It is sending the correct password format but I still have to type it in.

"Send" doesn't work "user" doesn't work...

Code:
[hxisssmy@server ~]$ sh Bell_Daily.sh
Connecting to 52.44.151.220...
invtransfer@52.44.151.220's password:
sftp> send XXX$XXX
Invalid command.
sftp> get INVENTORY.txt
Fetching /INVENTORY.txt to INVENTORY.txt
/INVENTORY.txt                                100%  408KB 408.2KB/s   00:00
sftp> quit


Last edited by Scrutinizer; 03-10-2018 at 03:56 AM..
 

10 More Discussions You Might Find Interesting

1. Cybersecurity

Sending a message to a user when password will be expired

Hi, Does anyone have a script (for AIX) that sends a message to a user that his password will be expired within 5 days for ex. Thanks (1 Reply)
Discussion started by: Diederd
1 Replies

2. Windows & DOS: Issues & Discussions

ssh: sending password from windows client

Hi. My workstation is Windows. I use putty to connect to unix servers. The problem is that i'm doing it many times a day and each time i need to supply password. I have no control on ssh configuration on servers, because of account restrictions. So i can't use key authentication, how is suggested... (4 Replies)
Discussion started by: kukuruku
4 Replies

3. Shell Programming and Scripting

root password in SH scripts

Hi Everybody! I have to make my script more automatic as possible! In this, a have to mount a usb pen drive into a Blade (Solaris 2.8), and the only away I know to do it, is becoming a SuperUser (root). But unfortunately, when I become a SuperUser inside the script, it doesn't let me to put... (1 Reply)
Discussion started by: roosse77i
1 Replies

4. Shell Programming and Scripting

Sending ssh password in a script

Is there any way to send password in a sh script, to establish a ssh connection with the remote server, without having shared the public key? The command I'm currently using is in my script is !#/bin/sh ... ssh -l user remotehost "ls -l" I have shared the public key of the local... (3 Replies)
Discussion started by: farahzaiba
3 Replies

5. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

6. Shell Programming and Scripting

Idea for DB Password in Shell Scripts

I work in an environment where we have a Oracle DB Server on a AIX box. There are several batch scripts that load and execute on the database. The DBA wants to periodically change the password. Ideally I would like to have one common place to maintain the database as it is changed. I was thinking... (2 Replies)
Discussion started by: mode09
2 Replies

7. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

8. Solaris

Pam Module sending a cannot get password enry after certain period in /var/adm/messag

Pam Module sending a cannot get password enry after certain period in /var/adm/message. pam_login_limit(auth): Cannot get Password entry for user 'dbsnmp' What is dbsnmp? Also if account is locked does pam module checks for this locked account at regular interval and keeps on posting... (2 Replies)
Discussion started by: student2009
2 Replies

9. Shell Programming and Scripting

Expect Script sending password with $ and symbols

All, I am trying to use expect to send SFTP password because I am unable to share a key with the vendor. They gave me a password that uses some symbols in it like $ and ! When i try to use the send command in expect it thinks the $ is a variable. Is there anyway to have it send the... (2 Replies)
Discussion started by: markdjones82
2 Replies

10. Shell Programming and Scripting

Sending password over SSH

Hi guys, I wrote a script that logs into around 30 nodes via SSH as root. The issue is that I have to punch in the root password everytime and it is being a hassle. Is there a way to save the password in a secure way and automate the whole procedure. I do not want to save the password in... (9 Replies)
Discussion started by: Junaid Subhani
9 Replies
SCRIPT(1)						    BSD General Commands Manual 						 SCRIPT(1)

NAME
script -- make typescript of terminal session SYNOPSIS
script [-a] [-c COMMAND] [-f] [-q] [-t] [file] DESCRIPTION
Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1). If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript. Options: -a Append the output to file or typescript, retaining the prior contents. -c COMMAND Run the COMMAND rather than an interactive shell. This makes it easy for a script to capture the output of a program that behaves differently when its stdout is not a tty. -f Flush output after each write. This is nice for telecooperation: One person does `mkfifo foo; script -f foo' and another can super- vise real-time what is being done using `cat foo'. -q Be quiet. -t Output timing data to standard error. This data contains two fields, separated by a space. The first field indicates how much time elapsed since the previous output. The second field indicates how many characters were output this time. This information can be used to replay typescripts with realistic typing and output delays. The script ends when the forked shell exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not set) for the C-shell, csh(1)). Certain interactive commands, such as vi(1), create garbage in the typescript file. Script works best with commands that do not manipulate the screen, the results are meant to emulate a hardcopy terminal. ENVIRONMENT
The following environment variable is utilized by script: SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically). SEE ALSO
csh(1) (for the history mechanism), scriptreplay(1). HISTORY
The script command appeared in 3.0BSD. BUGS
Script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects. AVAILABILITY
The script command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/. Linux July 30, 2000 Linux
All times are GMT -4. The time now is 12:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy