WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Problems trying to write a text file to a network location  (Read 7220 times)

Offline ambaum01

  • Newbie
  • *
  • Posts: 17
Re: Problems trying to write a text file to a network location
« Reply #15 on: December 13, 2012, 10:21:37 PM »
Hi ambaum01
Just a guess on my part::
Code: [Select]
cd /usr/local/etc/ssh/
cp sshd_config.example sshd_config
editor sshd_config
Change the line that reads
Code: [Select]
#ChallengeResponseAuthentication yesto
Code: [Select]
ChallengeResponseAuthentication noThen run:
Code: [Select]
/usr/local/etc/init.d/openssh restartSee if it still prompts you for a password.

No luck, it is still prompting me for a password as it was before.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11590
Re: Problems trying to write a text file to a network location
« Reply #16 on: December 13, 2012, 10:31:00 PM »
Hi ambaum01
As I said, it was just a guess.

Offline ambaum01

  • Newbie
  • *
  • Posts: 17
Re: Problems trying to write a text file to a network location
« Reply #17 on: December 13, 2012, 10:32:31 PM »
I appreciate it just the same.  this is a pretty frustrating problem.  If I could just get past this hurdle I think I could make this thing work.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Problems trying to write a text file to a network location
« Reply #18 on: December 13, 2012, 10:59:20 PM »
Instead of trying to circumvent ssh security, you could as well consider to look into nc and netcat the file content.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11590
Re: Problems trying to write a text file to a network location
« Reply #19 on: December 13, 2012, 11:15:50 PM »
HI tinypoodle
I don't think he's trying to circumvent ssh security. He's trying to get the script to submit the password.

Offline ambaum01

  • Newbie
  • *
  • Posts: 17
Re: Problems trying to write a text file to a network location
« Reply #20 on: December 13, 2012, 11:57:22 PM »
HI tinypoodle
I don't think he's trying to circumvent ssh security. He's trying to get the script to submit the password.
This exactly.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11590
Re: Problems trying to write a text file to a network location
« Reply #21 on: December 14, 2012, 12:23:06 AM »
Hi ambaum01
I've never worked with expect myself, but suspect the problem may be in the script. For example:
Code: [Select]
expect "username@servername's password: $"This is what expect is looking for from ssh. It's very specific, so if your syntax for the response is not exactly right, it
will fail. I recommend Googling    linux expect scp example    to find a better starting point for a more robust script.
Google will return a lot of examples related to what you want with that search phrase.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Problems trying to write a text file to a network location
« Reply #22 on: December 14, 2012, 08:48:02 AM »
HI tinypoodle
I don't think he's trying to circumvent ssh security. He's trying to get the script to submit the password.

Your statement leaves me puzzled...   :-\
Perhaps you mean to disagree on semantics while agreeing in essence?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11590
Re: Problems trying to write a text file to a network location
« Reply #23 on: December 14, 2012, 12:10:24 PM »
Hi tinypoodle
If you consider a script circumventing security, then yes, I disagree on semantics while agreeing in essence.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Problems trying to write a text file to a network location
« Reply #24 on: December 14, 2012, 04:51:29 PM »
Hi ambaum01,

There is an expect related thread here: http://forum.tinycorelinux.net/index.php/topic,14493.0.html that relates to sending an ssh password using expect.  I have a script similar similar to the one shown there that puts or gets a file using scp and using expect to provide the password.

In my case, probably due to some oddity in my system (and my systems -do- have the occasional oddity), these things only work as root (sudo ... ), but they do work.

Of course there are security concerns with embedding passwords in scripts...
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline ambaum01

  • Newbie
  • *
  • Posts: 17
Re: Problems trying to write a text file to a network location
« Reply #25 on: December 18, 2012, 09:07:22 AM »
Thanks for the suggestions.  I will do some more research on this forum and elsewhere to get this solved.  I've always wanted a reason to become familiar with Linux, and as frustrating as some of this has been, I have been learning a great deal.  I greatly appreciate everyone's advice thus far.

Offline ambaum01

  • Newbie
  • *
  • Posts: 17
Re: Problems trying to write a text file to a network location
« Reply #26 on: December 27, 2012, 01:02:13 PM »
I finally resolved this issue using ssh.  It turns out it was much easier to implement than I initially thought.  I've run into a different issue, but I will post it in another thread.  Thanks again.