从 sublime-text 运行脚本

从 sublime-text 运行脚本

我有一个脚本,用于在我使用的服务器上写入公钥。在以前的 Ubuntu 16.04 版本中,我可以正常使用它。我不知道这是否与 Sublime Text 或 Ubuntu 本身有关。但今天我再也不能了。我的脚本是:

#!/bin/bash

# Caso não tenha a chave , use o comando: 'ssh-keygen -t rsa' para gerar a mesma. 

chave="/home/douglas/.ssh/id_rsa.pub"
usuario="admin"
host="192.168.1.2"
porta="22"

ssh-copy-id -i $chave -p $porta $usuario"@"$host

当我执行它时,我在 Sublime Text 控制台中收到以下错误:

> usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed:
> "/home/douglas/.ssh/id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting
> to log in with the new key(s), to filter out any that are already
> installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed
> -- if you are prompted now it is to install the new keys ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory Permission
> denied, please try again. ssh_askpass: exec(/usr/bin/ssh-askpass): No
> such file or directory Permission denied, please try again.
> ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
> Permission denied (publickey,password).

通过终端运行,脚本有效。我该如何解决这个问题?

相关内容