diff options
| author | srdusr <[email protected]> | 2023-03-01 07:46:26 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2023-03-01 07:46:26 +0200 |
| commit | 4b3c87dd367c97ea2462a11d80d92d27d350ac9d (patch) | |
| tree | 5df5e355acb1c274f50a51188b16aee9d1858581 | |
| parent | e47a64b4358672305849aa6fa2652351e0940d55 (diff) | |
| download | notes-4b3c87dd367c97ea2462a11d80d92d27d350ac9d.tar.gz notes-4b3c87dd367c97ea2462a11d80d92d27d350ac9d.zip | |
Fix syntax of some lines by including "$" sign in bash commands
| -rw-r--r-- | tools/ssh.md | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/tools/ssh.md b/tools/ssh.md index ca8b2d8..a52a415 100644 --- a/tools/ssh.md +++ b/tools/ssh.md @@ -1,38 +1,38 @@ ### SSH (Secure Shell Protocol) * Find out your username -`whoami` +`$ whoami` * Check ip address -`ifconfig` -`nmcli -p device show` +`$ ifconfig` +`$ nmcli -p device show` * Termux install openssh -`pkg in openssh` +`$ pkg in openssh` * Termux make sure user/root password is set -`passwd <user> # root does not need to be specified` +`$ passwd <user> # root does not need to be specified` * Generate your ssh key pair on remote host machine, not on server machine -`ssh-keygen` +`$ ssh-keygen` * Accessing termux user environment from other consoles -`scp [email protected]:~/.ssh/id_rsa.pub ~/.ssh/authorized_keys` +`$ scp [email protected]:~/.ssh/id_rsa.pub ~/.ssh/authorized_keys` * Second Option How do I add SSH Keys to authorized_keys file? -`cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"` +`$ cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"` * Start server in machine that will ssh into -`sshd` +`$ sshd` * Android remote host into desktop server, assuming default port 8022 -`ssh [email protected] -p 8022` +`$ ssh [email protected] -p 8022` * Desktop remote host into android server, assuming default port 8022 -`ssh [email protected]` +`$ ssh [email protected]` * To view the log output from the server process. -`logcat -s 'syslog:*'` +`$ logcat -s 'syslog:*'` #### Copying files @@ -47,21 +47,21 @@ scp file <remote_username>@<IPorHost>:<PathToFile> <LocalFileLocation> How to SSH File Transfer from Remote to Local 1. Copy single file from local to remote using scp. -$ `scp myfile.txt remoteuser@remoteserver:/remote/folder/` +`$ scp myfile.txt remoteuser@remoteserver:/remote/folder/` 2. scp from remote to local using a single file. -$ `scp remoteuser@remoteserver:/remote/folder/remotefile.txt localfile.txt` +`$ scp remoteuser@remoteserver:/remote/folder/remotefile.txt localfile.txt` * Copy multiple files from remote to local: -$ `scp [email protected]:/some/remote/directory/\{a,b,c\} ./` +`$ scp [email protected]:/some/remote/directory/\{a,b,c\} ./` * Copy multiple files from local to remote: - $ `scp foo.txt bar.txt [email protected]:~` - $ `scp {foo,bar}.txt [email protected]:~` - $ `scp *.txt [email protected]:~` + `$ scp foo.txt bar.txt [email protected]:~` + `$ scp {foo,bar}.txt [email protected]:~` + `$ scp *.txt [email protected]:~` * Copy multiple files from remote to remote: - $ `scp [email protected]:/some/remote/directory/foobar.txt \` + `$ scp [email protected]:/some/remote/directory/foobar.txt \` |