Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Reading password in init script: can't open /dev/tty
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
McLink
Apprentice
Apprentice


Joined: 02 Feb 2008
Posts: 161
Location: /dev/chair

PostPosted: Fri Sep 15, 2017 7:58 am    Post subject: Reading password in init script: can't open /dev/tty Reply with quote

I'm trying to write an init script that sets up an ssh tunnel, and I need a few passwords to make this happen. Unfortunately, ssh complains that it can't open /dev/tty and never prompts me for these passwords. In particular, the command
Code:
start-stop-daemon -u root -m --pidfile /var/run/openvpn-tunnel.pid \
    --start ssh -- -v -Nf "${LOGIN_USER}@${h}" -L "${PORT}:localhost:${PORT}"
produces, among lots of other output,
Code:
debug1: read_passphrase: can't open /dev/tty: No such device or address


On the other hand, some other init scripts (notably the one for OpenVPN) seem to have no trouble prompting for a password using relatively similar code. Does anyone know how to make SSH read the password from stdin when called from start-stop-daemon?
_________________
Mc'abit wrote:
Islam isn't the problem, religion is.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum