SCP (Secure Copy Güvenli Kopyalama), bir ağdaki iki bilgisayar arasında dosya kopyalamanızı sağlar. Bağlantı sırasında SSH kullandığı için dosya aktarımı şifreli ve güvenlidir. SCP'yi kullanabilmeniz için SSH Client (SSH istemcisi) bilgisayarınızda kurulu olmalıdır.

SCP ile Dosya Transferi

Yine Linux sistemlerinin hemen hemen hepsinde bu standart olarak gelmektedir. Yinede yüklemek isterseniz ;

 

sudo apt-get install ssh-client

 

komutuyla yükleme yapabilirsiniz.
Gelelim dosya transferine, genel kullanım şeklini önce yazalım :

 

scp GönderilecekDosya NereyeGönderilecek

 

Şimdi iki örnek ile olayı açıklığa kavuşturalım :

  • Diyelim ki aynı ağda bulunan başka bir bilgisayara kendi makinanızdaki bir dosyayı atmak istiyorsunuz. Göndereceğiniz dosya /home/go/soap.zip olsun. Göndereceğiniz yer ise 192.168.1.7 iç ip sine sahip ve lingo kullanıcısı olan bilgisayar olsun. o zaman karşıdaki lingo kullanıcısının /home/lingo/Documents/ klasörünün içine dosyayı atmak istiyorsanız :
scp /home/go/soap.zip lingo@192.168.1.7:/home/lingo/Documents/

 

komutu ile başlayıp ondan sonra lingo kullanıcısının şifresini girmeniz yeterli olacaktır.

Diyelim ki başka bir serverdan makinanıza dosya indireceksiniz o zaman da yapmanız gereken şey şu :

 

scp lingo@linuxipuclari.com:/home/lingo/Documents/soap.zip /home/go/

 

komutu sizin için söz konusu yerden dosyayı makinanıza atmanızı sağlayacaktır.

 

Eğer karşı tarafa bir port üzerinden bağlanıyorsanız:

scp -P 1453 ahmet@95.85.10.150:/var/yedekler/14.06.04.rar /home/ret

 

Copy the file "foobar.txt" from a remote host to the local host

$ scp [email protected]:foobar.txt /some/local/directory

Copy the file "foobar.txt" from the local host to a remote host

$ scp foobar.txt [email protected]:/some/remote/directory

Copy the directory "foo" from the local host to a remote host's directory "bar"

$ scp -r foo [email protected]:/some/remote/directory/bar

Copy the file "foobar.txt" from remote host "rh1.edu" to remote host "rh2.edu"

$ scp [email protected]:/some/remote/directory/foobar.txt
[email protected]:/some/remote/directory/

Copying the files "foo.txt" and "bar.txt" from the local host to your home directory on the remote host

$ scp foo.txt bar.txt [email protected]:~

Copy the file "foobar.txt" from the local host to a remote host using port 2264

$ scp -P 2264 foobar.txt [email protected]:/some/remote/directory

Copy multiple files from the remote host to your current directory on the local host

$ scp [email protected]:/some/remote/directory/{a,b,c} .
$ scp [email protected]:~/{foo.txt,bar.txt} .