0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【メモ】ワークステーションとローカルの環境の間でのディレクトリの通信コマンド

0
Posted at

ワークステーション(WS)とローカルの環境(ここではM1macbookを想定)の間でディレクトリなどのやり取りをする際のコマンドをメモリしておきます。

WS -> local

scp -i path/to/the/id_rsa -r user名@WSのIPアドレス:path/to/the/directory path/to/the/directory

よくない例

name@WS's name:~/pyed$ scp -i ~/.ssh/id_rsa -r user名@WSのIPアドレス:/path/to/dir /Users/pcのuser名/
Enter passphrase for key '/home/sakurai/.ssh/id_rsa': 

identity_sign: private key /home/user名/.ssh/id_rsa contents do not match public
user名@WSのIPアドレス: Permission denied (publickey).

原因

  1. WS内部でコマンドを実行している。
  2. コピー先のディレクトリが書いていない

なので、WS->localの通信であっても、localでコマンドを実行します。

local -> WS

scp -i ~/.ssh/id_rsa -r /Users/pcのusr名/path/to/the/directory user名@WSのIPアドレス:~
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?