Open SSH: Difference between revisions
From WickyWiki
mNo edit summary |
|||
| Line 40: | Line 40: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
For example: | For example, ping for 30 seconds to localhost: | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
Latest revision as of 14:39, 23 March 2019
Note: having Ubuntu Server in a virtual machine it is best to access it from a terminal with ssh. This way you will have basic copy and paste functionality with your host.
Install
sudo apt-get install openssh-server openssh-client
Login
When you login with SSH for the first time, it will validate and store a key.
ssh 192.168.1.10 -l someuser
Copy files
SSH copy dir1 from the host (192.168.1.8) to the current directory within the SSH session:
scp -r hostuser@192.168.1.8:/home/ubuntu/dir1 .
Text editor
Nano is a easy to use text editor that you can use in a terminal. Alternatives are vi and ed.
nano /dir1/file1
Run a Command or Shell-Script Even after You Logout
nohup <command-with-options> &
For example, ping for 30 seconds to localhost:
nohup ping -w 30 localhost &
Output is written to the file 'nohup.out':
cat nohup.out