LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-13-2014, 03:45 AM   #1
postcd
Member
 
Registered: Oct 2013
Posts: 527

Rep: Reputation: Disabled
Bash: how to make script ask RSA key accept?


Hello,

i have command:
Code:
sshfs -o idmap=user root@myip:/home/folder /home/folder
it normally asks me like this:

Quote:
The authenticity of host '*** (<no hostip for proxy command>)' can't be established.
RSA key fingerprint is ***.
Are you sure you want to continue connecting?

But when added into bash script, along with other commands before, after it, it dont asks anything and just output:
read: Connection reset by peer


Please how to make the bash script ask me like when im placing this command alone in shell?
 
Old 02-13-2014, 04:52 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Once you answer 'yes' it is supposed to remember it (file ~/.sshd/known_hosts), and don't ask anymore. So I think you should consult log-files on the remote side to find out why did it close the connection.
 
Old 02-13-2014, 04:55 AM   #3
postcd
Member
 
Registered: Oct 2013
Posts: 527

Original Poster
Rep: Reputation: Disabled
This is for first time connections so its not remembered. thanks
 
Old 02-13-2014, 05:47 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
If the script runs without a controlling terminal, it obviously cannot ask for reply.
eg:
Code:
$ tty
/dev/pts/0
$ nohup tty
nohup: ignoring input and appending output to `nohup.out'
$ cat nohup.out
not a tty
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any other method of generating pub key attenuation other than rsa key sanjay87 Linux - Server 1 03-29-2012 09:21 AM
How to make a bash script ask for a specific key. Slightly Disoriented Linux - Newbie 16 11-22-2010 12:08 PM
Putty/SSH login failed when using RSA public key: 'Server refused our key' itsecx@gmail.com Linux - Server 10 10-04-2010 01:19 PM
How do I make a script accept wildcards in arguments? CartersAdvocate Slackware 15 12-12-2008 12:03 AM
sed doesn't accept $variable in bash script chii-chan Programming 6 05-28-2005 07:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration