mirror of
https://github.com/tiyn/wiki.git
synced 2025-04-19 22:17:45 +02:00
Compare commits
No commits in common. "6524d5a7e95312640697cc26ca1fd43089b1313f" and "5c56fde08417384b58d1ba3fae254cbda592a733" have entirely different histories.
6524d5a7e9
...
5c56fde084
39
wiki/git.md
39
wiki/git.md
@ -13,7 +13,10 @@ The client is pretty simple to understand.
|
|||||||
With only a handfull of commands you should be able to get your versioning going.
|
With only a handfull of commands you should be able to get your versioning going.
|
||||||
For servers with web interfaces there are different cli tools to control it
|
For servers with web interfaces there are different cli tools to control it
|
||||||
without using a browser.
|
without using a browser.
|
||||||
For most linux distributions it is packaged with the `git` package.
|
For most linux distributions it is packaged with the `git` package
|
||||||
|
|
||||||
|
There is also an interactive
|
||||||
|
[fixup guide by Seth Robertson](https://sethrobertson.github.io/GitFixUm/fixup.html).
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
|
|
||||||
@ -42,9 +45,6 @@ If you don't need a bloated web-interface a more basic approach is more than eno
|
|||||||
|
|
||||||
This section addresses various use cases and problems solvable with git.
|
This section addresses various use cases and problems solvable with git.
|
||||||
|
|
||||||
There is also an interactive
|
|
||||||
[fixup guide by Seth Robertson](https://sethrobertson.github.io/GitFixUm/fixup.html).
|
|
||||||
|
|
||||||
### Ignore files having local changes
|
### Ignore files having local changes
|
||||||
|
|
||||||
If you need to make changes to a file that are local you can run
|
If you need to make changes to a file that are local you can run
|
||||||
@ -53,34 +53,3 @@ Following this the file won't show up as having changes from the upstream.
|
|||||||
Note that files tagged with this command are checked out sparsly, so you need
|
Note that files tagged with this command are checked out sparsly, so you need
|
||||||
to watch out for changes yourself if there are any.
|
to watch out for changes yourself if there are any.
|
||||||
To revert this run `config update-index --no-skip-worktree <file>`.
|
To revert this run `config update-index --no-skip-worktree <file>`.
|
||||||
|
|
||||||
### Authentication via SSH
|
|
||||||
|
|
||||||
Authentication by default is done via a username and a password.
|
|
||||||
For some services such as Github.
|
|
||||||
it is not possible to use password as an authentication method.
|
|
||||||
The other possibility to authenticate to git is by using
|
|
||||||
[SSH](/wiki/linux/ssh.md).
|
|
||||||
|
|
||||||
For this a
|
|
||||||
[SSH certificate has to be created](/wiki/linux/ssh.md#generate-new-keys) and
|
|
||||||
[added to the authentication agent](/wiki/linux/ssh.md#adding-keys-to-authentication-agent).
|
|
||||||
Afterwards it the public SSH key to be added to the git server.
|
|
||||||
For Github there is
|
|
||||||
[a guide on that topic](https://docs.github.com/en/get-started/getting-started-with-git/why-is-git-always-asking-for-my-password).
|
|
||||||
|
|
||||||
Following these the git repositories have to be cloned in a special way to use
|
|
||||||
SSH instead of password and username.
|
|
||||||
The following shows both the normal way and the SSH way to clone git
|
|
||||||
repositories.
|
|
||||||
|
|
||||||
```ssh
|
|
||||||
git clone ssh://git@github.com:tiyn/wiki
|
|
||||||
git clone https://github.com/tiyn/wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
By using the SSH config file the clone command can be shortened to
|
|
||||||
`git clone github:tiyn/wiki`.
|
|
||||||
For this follow the
|
|
||||||
[corresponding section in the SSH entry](/wiki/linux/ssh.md#shorten-ssh-connection-commands).
|
|
||||||
Set `Host` to `github`, `HostName` to `github.com` and `User` to `git`.
|
|
||||||
|
@ -5,32 +5,17 @@ In this article it is assumed that `openssh` is used.
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Generate New Keys
|
### Generate new keys
|
||||||
|
|
||||||
To generate new ssh keys simply run `ssh-keygen -t ed25519` or
|
To generate new ssh keys simply run `ssh-keygen -t ed25519` or
|
||||||
`ssh-keygen -t rsa -b 4096`.
|
`ssh-keygen -t rsa -b 4096`.
|
||||||
|
|
||||||
The keys can then be added to the authentication agent by as described in the
|
### Enable root login via SSH
|
||||||
[corresponding article](#adding-keys-to-authentication-agent)
|
|
||||||
|
|
||||||
### Adding Keys to Authentication Agent
|
|
||||||
|
|
||||||
The following line will add a key to the authentication agent.
|
|
||||||
|
|
||||||
```ssh
|
|
||||||
ssh-add id_rsa
|
|
||||||
```
|
|
||||||
|
|
||||||
Depending on the name of the certificate inside the `~/.ssh` folder the name
|
|
||||||
`id_rsa` can vary.
|
|
||||||
For example `id_ed25519` is the name if the first generation option was chosen.
|
|
||||||
|
|
||||||
### Enable Root Login via SSH
|
|
||||||
|
|
||||||
Edit the `/etc/ssh/sshd_config` and change the line containing `PermitRootLogin`
|
Edit the `/etc/ssh/sshd_config` and change the line containing `PermitRootLogin`
|
||||||
to `PermitRootLogin yes`.
|
to `PermitRootLogin yes`.
|
||||||
|
|
||||||
### Add Login via SSH Public Key
|
### Add login via SSH public key
|
||||||
|
|
||||||
To enable easy login without password you can add the contents of the file
|
To enable easy login without password you can add the contents of the file
|
||||||
`~/.ssh/id_rsa.pub` from your local machine to the file `~/.ssh/authorized_keys`
|
`~/.ssh/id_rsa.pub` from your local machine to the file `~/.ssh/authorized_keys`
|
||||||
@ -41,7 +26,7 @@ You can use the modified command below for ease of use:
|
|||||||
cat ~/.ssh/id_rsa.pub | ssh username@server 'cat >> ~/.ssh/authorized_keys'
|
cat ~/.ssh/id_rsa.pub | ssh username@server 'cat >> ~/.ssh/authorized_keys'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Mount Directory With SSHFS
|
### Mount directory with sshfs
|
||||||
|
|
||||||
To mount a directory (in this case called `directory`) from a remote server
|
To mount a directory (in this case called `directory`) from a remote server
|
||||||
(in this case called `server` also can be substituted by something like
|
(in this case called `server` also can be substituted by something like
|
||||||
@ -50,14 +35,3 @@ To mount a directory (in this case called `directory`) from a remote server
|
|||||||
```sh
|
```sh
|
||||||
sshfs server:/directory mountpoint
|
sshfs server:/directory mountpoint
|
||||||
```
|
```
|
||||||
|
|
||||||
### Shorten SSH Connection Commands
|
|
||||||
|
|
||||||
By adding the following lines to the file `~/.ssh/config` the command of an SSH
|
|
||||||
connection can be shortened from `ssh user@server.tld` to `ssh server`.
|
|
||||||
|
|
||||||
```txt
|
|
||||||
Host server
|
|
||||||
HostName server.tld
|
|
||||||
User user
|
|
||||||
```
|
|
||||||
|
19
wiki/vpn.md
19
wiki/vpn.md
@ -59,22 +59,3 @@ WireGuard clients can be found for many devices.
|
|||||||
For Android for example there is
|
For Android for example there is
|
||||||
[Wireguard for Android in the F-Droid store](https://f-droid.org/de/packages/com.wireguard.android/).
|
[Wireguard for Android in the F-Droid store](https://f-droid.org/de/packages/com.wireguard.android/).
|
||||||
For most linux distributions there is a package called `wireguard`.
|
For most linux distributions there is a package called `wireguard`.
|
||||||
|
|
||||||
### Usage (WG)
|
|
||||||
|
|
||||||
Wireguard clients connect to servers by using a `.conf` file.
|
|
||||||
For mobile devices often times a QR-code can also be used.
|
|
||||||
|
|
||||||
In Linux based operating systems the `.conf` can be placed at
|
|
||||||
the path `/etc/wireguard/wg0.conf`.
|
|
||||||
Afterwards wireguard can be started and stopped by running the following
|
|
||||||
commands.
|
|
||||||
|
|
||||||
```
|
|
||||||
wg-quick up wg0
|
|
||||||
wg-quick down wg0
|
|
||||||
```
|
|
||||||
|
|
||||||
When using multiple `.conf` files the number behind `wg` can be incremented.
|
|
||||||
When starting and stopping wireguard with `wg-quick` the corresponding number
|
|
||||||
should be used.
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user