我正在尝试编写一个shell脚本,在远程服务器上创建一些目录,然后使用scp将文件从本地计算机复制到远程服务器上.这是我到目前为止所拥有的:
ssh -t user@server<<EOT
DEP_ROOT='/home/matthewr/releases'
datestamp=$(date +%Y%m%d%H%M%S)
REL_DIR=$DEP_ROOT"/"$datestamp
if [ ! -d "$DEP_ROOT" ]; then
echo "creating the root directory"
mkdir $DEP_ROOT
fi
mkdir $REL_DIR
exit
EOT
scp ./dir1 user@server:$REL_DIR
scp ./dir2 user@server:$REL_DIR
Run Code Online (Sandbox Code Playgroud)
每当我运行它时,我收到此消息:
Pseudo-terminal will not be allocated because stdin is not a terminal.
Run Code Online (Sandbox Code Playgroud)
脚本永远挂起.
我的公钥在服务器上是可信的,我可以在脚本之外运行所有命令.有任何想法吗?
我正在尝试在我的Web主机上创建一个git存储库并在我的计算机上克隆它.这是我做的:
ssh-keygen -t dsa.~/.ssh.然后,在尝试运行该命令后git clone ssh://user@host/path-to-repository,我收到一个错误:
无法与XX.XXX.XX.XX协商:未找到匹配的主机密钥类型.他们的提议:ssh-dss
致命:无法从远程存储库读取.
请确保您具有正确的访问权限并且存储库存在.
那是什么意思?
我正在Windows Server 2016上运行的Jenkins 2.152中创建一个工作,需要从bitbucket.org上托管的git repo中提取.我通过git-bash测试了ssh密钥,所以我知道它有效并且没有密码短语.当我尝试使用与Jenkins完全相同的私钥时,我收到一条错误消息.
Failed to connect to repository : Command "git.exe ls-remote -h
git@bitbucket.org:mygroup/myrepo HEAD" returned status code 128:
stdout:
stderr: Load key
"C:\\Users\\JE~1\\AppData\\Local\\Temp\\ssh2142299850576289882.key": invalid format
git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
凭据设置为
scope: Global
user: git
Private Key -> Enter Directly -> copy and past - generated by ssh-keygen -t rsa in gitbash
Passphrase: empty
ID: empty
description: bitbucket.org …Run Code Online (Sandbox Code Playgroud)