文章目录
  1. 1. ssh不通,并报如下错误
  2. 2. scp时,-bash: syntax error near unexpected token ‘(‘

新开一贴,记录一下Linux使用中的一些问题。

ssh不通,并报如下错误
1
2
3
4
5
6
7
8
9
10
11
12
13
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
a9:31:72:45:8d:fb:13:57:85:cc:0a:1c:56:33:c6:04.
Please contact your system administrator.
Add correct host key in /home/experiment/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/experiment/.ssh/known_hosts:14
ECDSA host key for slave103 has changed and you have requested strict checking.
Host key verification failed.

【解决方案】将/home/experiment/.ssh/known_hosts对应行删掉。因为可能host key已经更新了。

scp时,-bash: syntax error near unexpected token ‘(‘

scp/rsync远程传输时,如果文件名包含括号’(‘或’)’,则简单的传输会报错,如下:

1
2
$ scp remote01:./xx/haha(2019).lcv .
-bash: syntax error near unexpected token `('

如果简单加上转义符’\’或者引号’’,也会报错:

1
2
3
4
5
6
$ scp remote01:./xx/haha\(2019\).lcv .
或者
$ scp remote01:./xx/haha"(2019)".lcv .

bash: -c: line 0: syntax error near unexpected token `('

bash: -c: line 0: `scp -f ./huqiu/das/benchmarks/lcvs/slave028_aeh_adult_r0_trial_500_P_100_S_1_TL_360_04061553(0.874701).lcv'

这时候,其实是加少了,因为涉及到本地端和remote端,所以需要提供可供两次转义还正确的写法。

【解决方案】

1
2
3
4
5
$ scp 'remote01:./xx/haha\(2019\).lcv' .
或者
$ scp remote01:./xx/haha"\(2019\)".lcv .

或者
$ scp remote01:./xx/haha\\\(2019\\\).lcv .

计算机相关 | CS.Related