ps切片工具做网站,新榜数据平台,扫描到网站目录然后怎么做,个人网站建设的收获找到自己Mac的ssh公钥#xff0c;如果没有ssh密钥的话#xff0c;需要生成一下
cat ~/.ssh/id_rsa.pub# 在~/.ssh路径下面执行命令生成ssh密钥
ssh-keygen -t rsa然后找到要免密登陆的远程服务器
~/.ssh/authorized_keys
把自己Mac上面的公钥拷贝到这里面即可 Python脚本 …找到自己Mac的ssh公钥如果没有ssh密钥的话需要生成一下
cat ~/.ssh/id_rsa.pub# 在~/.ssh路径下面执行命令生成ssh密钥
ssh-keygen -t rsa然后找到要免密登陆的远程服务器
~/.ssh/authorized_keys
把自己Mac上面的公钥拷贝到这里面即可 Python脚本 def test_scp(self):# 远程服务器的地址和目标路径remote_host root10.10.10.222remote_path /home/ps/Code/ROS/robot_audio/test/WhisperAudio/person# 循环遍历i的范围6到19for i in range(6, 20):# 生成文件路径local_file f/opt/audio/test/WhisperAudio/person/b1max_{i}.wav# 构建scp命令scp_command fscp {local_file} {remote_host}:{remote_path}try:# 执行scp命令subprocess.run(scp_command, shellTrue, checkTrue)print(f文件 b1max_{i} 传输成功)except subprocess.CalledProcessError as e:print(f文件 b1max_{i} 传输失败{e})