Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet418/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   414   415   416   417   418   419   420   421   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 320 
]
With this example, we're assuming that 
myfile.txt
 is located in the 
home
 directory 
for the user 
jdoe
. This command will copy that file to the current working directory 
of our local machine, since I designated the local path as a 
single period
 (which 
corresponds to our current working directory). Using 
scp
 in reverse isn't always 
practical, since you have to already know where the desired file is stored on the 
target before transferring it.
With our previous 
scp
 examples, we've only been copying a single file. If we want to 
transfer or download an entire directory and its contents, we will need to use the 
-r
 
option, which allows us to do a recursive copy:
scp -r /home/jdoe/downloads/linux_iso jdoe@192.168.1.50:downloads 
With this example, we're copying the local folder 
/home/jdoe/downloads/linux_iso
 
to remote machine 
192.168.1.50
. Since we used the 
-r
 option, 
scp
 will transfer the 
linux_iso
 folder and all of its contents. On the remote end, we're again connecting 
via the user 
jdoe
. Notice that the target path is simply 
downloads
. Since 
scp
 defaults 
to the user's 
home
 directory, this will copy the 
linux_iso
 directory from the source 
machine to the target machine under the 
/home/jdoe/downloads
 directory. The 
following command would've had the exact same result:
scp -r /home/jdoe/downloads/linux_iso jdoe@192.168.1.50:/home/jdoe/
downloads 
The 
home
 directory is not the only assumption the 
scp
 command makes. It also 
assumes that SSH is listening on port 
22
 on the remote machine. Since it's possible to 
change the SSH port on a server to something else, port 
22
 may or may not be what's 
in use. If you need to designate a different port for 
scp
 to use, use the 
-P
 option:
scp -P 2222 -r /home/jdoe/downloads/linux_iso 
jdoe@192.168.1.50:downloads 
With that example, we're connecting to the remote machine via port 
2222
. If you've 
configured SSH to listen on a different port, change the number accordingly.
Although port 
22
 is always the default for OpenSSH, it's common 
for some administrators to change it to something else. While 
changing the SSH port doesn't add a great deal of benefit in regard 
to security (an intensive port scan will still find your SSH daemon), 
it's a relatively easy change to make, and making it even just a little 
bit harder to find is beneficial. We'll discuss this further in 
Chapter 
21

Securing Your Server
.


Chapter 12

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   414   415   416   417   418   419   420   421   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish