Konfigurasi SSH Ubuntu: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
[[File:Ssh config 11.jpeg|thumb|300px|Source: [https://pbs.twimg.com/media/FKwuWmVUcAEt-0F?format=jpg&name=medium twimg.com]]] | [[File:Ssh config 11.jpeg|thumb|300px|Source: [https://pbs.twimg.com/media/FKwuWmVUcAEt-0F?format=jpg&name=medium twimg.com]]] | ||
Connect to a server (default port <code>22</code>)<syntaxhighlight lang=" | Connect to a server (default port <code>22</code>) | ||
<syntaxhighlight lang="bash"> | |||
ssh user@server | ssh user@server | ||
</syntaxhighlight>Uses a specific port declared in sshd_config<syntaxhighlight lang="shell"> | </syntaxhighlight> | ||
Uses a specific port declared in sshd_config | |||
<syntaxhighlight lang="shell"> | |||
ssh user@server -p other_port | ssh user@server -p other_port | ||
</syntaxhighlight>Runs a script on a remote server<syntaxhighlight lang="shell"> | </syntaxhighlight> | ||
Runs a script on a remote server | |||
<syntaxhighlight lang="shell"> | |||
ssh user@server script_to_run | ssh user@server script_to_run | ||
</syntaxhighlight>Compresses and downloads from a remote server<syntaxhighlight lang="shell"> | </syntaxhighlight> | ||
Compresses and downloads from a remote server | |||
<syntaxhighlight lang="shell"> | |||
ssh user@server "tar -cvzf - ~/source" > output.tgz | ssh user@server "tar -cvzf - ~/source" > output.tgz | ||
</syntaxhighlight>Specifies other ssh key for connection<syntaxhighlight lang="shell"> | </syntaxhighlight> | ||
Specifies other ssh key for connection | |||
<syntaxhighlight lang="shell"> | |||
ssh -i -/.ssh/specific_ssh_fkey | ssh -i -/.ssh/specific_ssh_fkey | ||
</syntaxhighlight> | </syntaxhighlight> | ||