LoginSignup
28
19

More than 5 years have passed since last update.

ssh の設定ファイルを使って rsync で簡単にファイル転送

Last updated at Posted at 2013-10-31

sshのログインを簡単に - Qiita [キータ]
http://qiita.com/ironsand/items/1910c49bc3ebef870a8d

で書いたように

~/.ssh/config
Host sakura
  HostName servername
  User username
  Port 10022

こんな感じに設定しておくと ssh sakura だけでサーバーに接続できるようになって便利なんですが、
rsyncを使うときには

rsync -e "ssh -p 10022"

のようにめんどくさい事を今までやってました。

解決策

rsync foo.txt sakura:/home/ironsand/

でOKだったそうです。簡単!

参考

How to use ~/.ssh/config setting for each server by rsync - Unix & Linux Stack Exchange
http://unix.stackexchange.com/questions/94421/how-to-use-ssh-config-setting-for-each-server-by-rsync

28
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
19