I'm trying to connect to a server via ssh providing a password but it still keeps asking me for it to enter it manually when the script is executing:
session = Net::SSH.start(host, "root", password: pass) do |ssh|
result = ssh.exec!("ls -l")
If you want to make it fail when you are not able to connect you have to add non_interactive mode on start method
:non_interactive => set to true if your app is non interactive and prefers authentication failure vs password prompt
check this code
session = Net::SSH.start(host, "root", password: pass,non_interactive: true ) do |ssh| result = ssh.exec!("ls -l") end
Try to connec to with that user doing ssh by yourself, if not you have to check your ssh configuration (you may to allow to root user) check on
if you have this config.
and then restart ssh daemon.
If it still , you may check your root pass.