SSHを用いた転送

rsyncを使用する場合、SSHを用いたセキュアな転送を推奨します。
以下の設定を行い、パスワード無しのSSH転送を行います。

(1) 鍵の生成
[root@localhost tmp]# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):enterキー
Enter passphrase (empty for no passphrase):enterキー
Enter same passphrase again:enterキー
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
db:d5:4d:8c:b1:bf:3d:3f:3b:26:d3:bf:d2:82:b8:28 root@localhost
以上の操作で/root/.ssh に、秘密鍵「id_dsa」と公開鍵「id_dsa.pub」 というファイルが生成されます。

(2) 鍵の配置

公開鍵を公開先サーバにコピーします。
[root@localhost tmp]# scp -p /root/.ssh/id_dsa.pub 公開先サーバのIPアドレス:/root/.ssh/

公開先サーバのホスト上でコピーした公開鍵を~/.ssh/authorized_keys に追加します。
[root@www ~]# cd /root/.ssh
[root@www .ssh]# cat id_dsa.pub >> authorized_keys
[root@www .ssh]# rm id_dsa.pub
[root@www .ssh]# chmod 600 authorized_keys

(3) 転送コマンドの実行と確認
コマンドを実行し、転送の確認を行います。
[root@localhost ~]# /usr/local/bin/rsync -a --delete --bwlimit=2048 --timeout=120 -e ssh /usr/local/ZoomSight/dictionary/ <公開先サーバのユーザ>@<公開先サーバアドレス>:<公開先サーバのディレクトリパス>
The authenticity of host 'xxx.xxx.x.x (xxx.xxx.x.x)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:x:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'xxx.xxx.x.x' (RSA) to the list of known hosts.

[root@localhost ~]#

再度、同じコマンドを実行し、認証確認と警告メッセージが出力されないことを確認します。
[root@localhost ~]# /usr/local/bin/rsync -a --delete --bwlimit=2048 --timeout=120 -e ssh /usr/local/4ucms/website/ <公開先サーバのユーザ>@<公開先サーバアドレス>:<公開先サーバのディレクトリパス>
[root@localhost ~]#

以上で設定は終了です。これでプロキシサーバから音声変換サーバへパスワード無しのSSH転送が可能となります。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值