Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rdnajac committed Sep 11, 2024
1 parent 57c7b89 commit 655b509
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
54 changes: 54 additions & 0 deletions docs/Tools/Linux-Command-Line.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,57 @@ sudo visudo
# Add to run any command without a password
username ALL=(ALL) NOPASSWD: ALL
```

### ssh

Make sure you have `openssh-server` installed:

```sh
sudo apt install openssh-server
```

#### Connect to a remote server

```sh
ssh username@hostname
```

#### Copy files to/from a remote server

```sh
scp username@hostname:/path/to/remote/file /path/to/local/file
scp /path/to/local/file username@hostname:/path/to/remote/file
```

#### No password ssh

First, generate a new SSH key pair:

```sh
ssh-keygen -t rsa -b 4096 -C "a comment"
```

The `-t` option specifies the type of key to create (in this case, RSA).
The `-b` option specifies the number of bits in the key (in this case, 4096).
The `-C` option specifies a comment. This is optional.

Next, copy the public key to the remote server:

```sh
ssh-copy-id -i <identity_file> username@hostname
```

and modify the `~/.ssh/config` file:

```sh
Host hostname
User username
HostName hostname
IdentityFile ~/.ssh/identity_file
```

Now you can log in without a password:

```sh
ssh username@hostname
```
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ or in a code block like the one this:
echo "Hello, world!"
```

> [!TIP]
> If you get `zsh: command not found: #` when you try to run a copied command,
> run `setopt interactivecomments` first. Read about why
> [here](https://stackoverflow.com/a/11873793/26469286).
## Contributing

This guide is open-source and welcomes contributions.
If you have a suggestion, correction, or new content to add,
you can click the "Edit this page" link at the top of each page

Happy computing!

0 comments on commit 655b509

Please sign in to comment.