Konfigurasi SSH Ubuntu: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| 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="bash"> | |||
ssh user@server | |||
</syntaxhighlight> | |||
Uses a specific port declared in sshd_config | |||
<syntaxhighlight lang="shell"> | |||
ssh user@server -p other_port | |||
</syntaxhighlight> | |||
Runs a script on a remote server | |||
<syntaxhighlight lang="shell"> | |||
ssh user@server script_to_run | |||
</syntaxhighlight> | |||
Compresses and downloads from a remote server | |||
<syntaxhighlight lang="shell"> | |||
ssh user@server "tar -cvzf - ~/source" > output.tgz | |||
</syntaxhighlight> | |||
Specifies other ssh key for connection | |||
<syntaxhighlight lang="shell"> | |||
ssh -i -/.ssh/specific_ssh_fkey | |||
</syntaxhighlight> | |||
Latest revision as of 20:48, 14 November 2022

Connect to a server (default port 22)
ssh user@server
Uses a specific port declared in sshd_config
ssh user@server -p other_port
Runs a script on a remote server
ssh user@server script_to_run
Compresses and downloads from a remote server
ssh user@server "tar -cvzf - ~/source" > output.tgz
Specifies other ssh key for connection
ssh -i -/.ssh/specific_ssh_fkey