Jump to content

Konfigurasi SSH Ubuntu: Difference between revisions

From Wiki
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 22)
Connect to a server (default port <code>22</code>)<syntaxhighlight lang="shell">
ssh user@server
ssh user@server
 
</syntaxhighlight>Uses a specific port declared in sshd_config<syntaxhighlight lang="shell">
Uses a specific port declared in sshd_config
ssh user@server -p other_port
ssh user@server -p other_port
</syntaxhighlight>Runs a script on a remote server<syntaxhighlight lang="shell">
 
ssh user@server script_to_run
Runs a script on a remote server
</syntaxhighlight>Compresses and downloads from a remote server<syntaxhighlight lang="shell">
ssh user@server script_to_run
ssh user@server "tar -cvzf - ~/source" > output.tgz
 
</syntaxhighlight>Specifies other ssh key for connection<syntaxhighlight lang="shell">
Compresses and downloads from a remote server
ssh -i -/.ssh/specific_ssh_fkey
ssh user@server "tar -cvzf - ~/source" > output.tgz
</syntaxhighlight>
 
Specifies other ssh key for connection
ssh -i -/.ssh/specific_ssh_fkey

Revision as of 11:14, 26 August 2022

Source: twimg.com

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