2,187
edits
(→Commands: Added tar) |
(Added "SCP") |
||
Line 59: | Line 59: | ||
|<code> tar czf file.tgz folder </code> || Tar contents of folder to file | |<code> tar czf file.tgz folder </code> || Tar contents of folder to file | ||
|} | |} | ||
== SCP == | |||
In order to be able to copy files from one machine to the other... | |||
<code> scp user@server:/remote/server/path/file /local/server/path/ | |||
In order to be able to copy files within a script (and not get prompted for a user password, the public key of the machine running the script needs to be authorised on the remote server. | |||
# On the local machine, be logged in as the same user as will be running the script | |||
# Create public key on local machine (just hit return to accept default options) | |||
#* <code> ssh-keygen -t rsa </code> | |||
# Copy the public key for local machine user to the remote machine | |||
#* EG <code> scp /root/.ssh/id_rsa.pub server:/home/user/ </code> | |||
# On the remote machine, check if the following file already exists | |||
#* <code> /root/.ssh/authorized_keys </code> | |||
# If so, append the contents of the copied key to the file | |||
# If not, copy the file | |||
== VI Editor == | == VI Editor == |