[SOLVED] Linux to Windows sharing WITHOUT manual password entry
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So maybe I should be using sftp. That is what is being used in the Powershell script that is taking care of this file transfer from linux to windows. I think I tried every combination of sftp and still no success. I have the host key that is being used in the Powershell script but I do not know how to use it in sftp in Linux. I tried everything!!
Ok ok, good news!!! I used sftp username@hostname and got a prompt asking for the password. Inputted the password and sftp> showed up, which means Im in!!!! Only problem is I need this non-interactive, all automated. Also, after getting to the "sftp>" prompt, how do I copy to the Win Share?
Is there any way I can put the password in a sftp command? I tried sftp username@hostname, entered password at the prompt and was happily shown "sftp>". Only problem is I need the password to be included so I don't have to input it.
Your connecting to the linux box not windows. You need to install a sftp server on windows. Dont have time at the moment to explain the client server model.
Is there a way I can actually put the host key in a bash script? This is very frustrating. Everything I need to be done can be done but I have to MANUALLY input a password. Once I get past having to input the password manually, everything else will be easy to put in my bash script
You did not fully explain your configuration and I made some wrong assumptions ie. did not pay enough attention to the details. The private key is typically located in your users home/.ssh directory. The default key name is id_rsa. To specify a key on the command line use the -i option. If you created your keys with puttygen then it has to be converted to the ssh format via putty.
I have actually installed the package expect and my issue has been resolved. Not the best because it it unsecure, but it's a short term solution. Here is the code:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.