Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Linux for beginners-SFTP a file Post 303001549 by rbatte1 on Monday 7th of August 2017 07:26:35 AM
Old 08-07-2017
Thanks for making a suggestion Arnaudh78, but this would leave a few security issues:-
  • The credentials are plaintext in the script
  • The credentials will be plaintext during the execution of sshpass
I would strongly recommend using the suggestion of jim mcnamara which keeps your credentials more secure. Of course, you have to ensure that no-one steals your private key, but that is a requirement of the set up anyway.



Kind regards,
Robin
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP vs FTP and going UNIX to LINUX

I have automated an ftp process that FTP's files from one UNIX box to another in the following format: ftp -n -v $REMOTE_SERV << EOF user $FTP_USER $FTP_PASS cd $REMOTE_PATH put $CUR_NAME $NEW_NAME bye But how can I accomplish this SFTPing from a UNIX box to a LINUX box? I've seen... (4 Replies)
Discussion started by: TimBurke
4 Replies

2. Windows & DOS: Issues & Discussions

How to connect SFTP(Linux) from Windows DOS

I need to write a batch script for file transfer from SFTP to Windows system. SFTP is on Linux system. I kept this code in batch file and executing it.. but not working.. Even i tried from Command prompt like this "open sftp.host.com" but getting error. Can anyone help with the code and tell me how... (15 Replies)
Discussion started by: mohantmk
15 Replies

3. Emergency UNIX and Linux Support

solaris or linux sftp/ftp-server

Hi, we have a big problem, history: we migrated our companies ftp and sftp-server, which were vsftp and openssh, to one server, software is called JSCAPE ftp server professional edition for the first time everything was great, but after one or two months, our uploads hang, 0 byte files are... (11 Replies)
Discussion started by: funksen
11 Replies

4. Shell Programming and Scripting

File locking (Unix/Linux) & sftp

Hi all, Can anyone help ...on how to ensure that a file is locked . thanks & regards, Soodoo ---------------------------------------- Problem description: - We usually use the mv command in scripts to make sure that a file is complete and not being written to by another process. ... (1 Reply)
Discussion started by: soodoo
1 Replies

5. UNIX for Advanced & Expert Users

Sftp working on Linux but error on HP UX

Hi the below two line in my sh work fine in Linux but when I run it in HP UX it throws error saying "No such file or directory (-)." can anyone pleas let me know what is wrong. Any help is appreciated. INPUTFILE="$(echo ls -1t | sftp -b- $SFTPSERVER:$SFTPDIR |grep ^LK| head -1)" echo... (1 Reply)
Discussion started by: murtymvvs
1 Replies

6. Linux

SFTP files to a server from Linux.

Hi, I am looking for a shell script to sftp to a file server and copy all the files from a directory after the script is run. The server name should be a user input parameter and of-course the username/password as well. Rest all should be handled by the script. I tried with below snippet:- ... (1 Reply)
Discussion started by: happysingh
1 Replies

7. Red Hat

SFTP to VM Linux

Hi . We have customer users uploading sales data in excel format in a portal, once this file is uploaded a batch process will SFTP the file from here to a linux virtual machine and then to the mainframe . We are seeing that there are many cases where all the rows the user entered in excel file... (1 Reply)
Discussion started by: ron5174
1 Replies

8. UNIX for Beginners Questions & Answers

Sftp connection not establishing from Linux to DataPower

Hi Everyone, I am trying to send files from Linux to DataPower server using public key based authentication but it's not working as expected and every-time password expecting for sftp transfer. Can someone please help on this? Steps I fallowed: Created keys pair at source server... (4 Replies)
Discussion started by: renukeswar
4 Replies

9. UNIX for Beginners Questions & Answers

Which Linux Certification comes first for beginners?

I want to get a Linux Certification to start my Career in IT sector. My Qualification is MCS from a top university. Suggest me some Linux Certifications. (1 Reply)
Discussion started by: alexwatson1711
1 Replies
GIT-CREDENTIAL-STO(1)                                               Git Manual                                               GIT-CREDENTIAL-STO(1)

NAME
git-credential-store - Helper to store credentials on disk SYNOPSIS
git config credential.helper 'store [options]' DESCRIPTION
Note Using this helper will store your passwords unencrypted on disk, protected only by filesystem permissions. If this is not an acceptable security tradeoff, try git-credential-cache(1), or find a helper that integrates with secure storage provided by your operating system. This command stores credentials indefinitely on disk for use by future Git programs. You probably don't want to invoke this command directly; it is meant to be used as a credential helper by other parts of git. See gitcredentials(7) or EXAMPLES below. OPTIONS
--file=<path> Use <path> to lookup and store credentials. The file will have its filesystem permissions set to prevent other users on the system from reading it, but will not be encrypted or otherwise protected. If not specified, credentials will be searched for from ~/.git-credentials and $XDG_CONFIG_HOME/git/credentials, and credentials will be written to ~/.git-credentials if it exists, or $XDG_CONFIG_HOME/git/credentials if it exists and the former does not. See also the section called "FILES". FILES
If not set explicitly with --file, there are two files where git-credential-store will search for credentials in order of precedence: ~/.git-credentials User-specific credentials file. $XDG_CONFIG_HOME/git/credentials Second user-specific credentials file. If $XDG_CONFIG_HOME is not set or empty, $HOME/.config/git/credentials will be used. Any credentials stored in this file will not be used if ~/.git-credentials has a matching credential as well. It is a good idea not to create this file if you sometimes use older versions of Git that do not support it. For credential lookups, the files are read in the order given above, with the first matching credential found taking precedence over credentials found in files further down the list. Credential storage will by default write to the first existing file in the list. If none of these files exist, ~/.git-credentials will be created and written to. When erasing credentials, matching credentials will be erased from all files. EXAMPLES
The point of this helper is to reduce the number of times you must type your username or password. For example: $ git config credential.helper store $ git push http://example.com/repo.git Username: <type your username> Password: <type your password> [several days later] $ git push http://example.com/repo.git [your credentials are used automatically] STORAGE FORMAT
The .git-credentials file is stored in plaintext. Each credential is stored on its own line as a URL like: https://user:pass@example.com When Git needs authentication for a particular URL context, credential-store will consider that context a pattern to match against each entry in the credentials file. If the protocol, hostname, and username (if we already have one) match, then the password is returned to Git. See the discussion of configuration in gitcredentials(7) for more information. GIT
Part of the git(1) suite Git 2.17.1 10/05/2018 GIT-CREDENTIAL-STO(1)
All times are GMT -4. The time now is 08:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy