aboutsummaryrefslogtreecommitdiffstats
path: root/tools/openssh.html
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2016-10-21 17:06:40 +0100
committerSilvino Silva <silvino@bk.ru>2016-10-25 18:20:52 +0100
commit29463878401499672150f2a3469bf8e8b9bff17b (patch)
tree6c557e0fb4d6d093f2ecf715e82a7c3f15f37388 /tools/openssh.html
parent5ee07ffcbfa431d4e3d66d53a91927927459a02d (diff)
downloaddoc-29463878401499672150f2a3469bf8e8b9bff17b.tar.gz
gitolite and gitweb revision
Diffstat (limited to 'tools/openssh.html')
-rw-r--r--tools/openssh.html63
1 files changed, 28 insertions, 35 deletions
diff --git a/tools/openssh.html b/tools/openssh.html
index d0a549c..12e5827 100644
--- a/tools/openssh.html
+++ b/tools/openssh.html
@@ -196,31 +196,28 @@
<h3 id="sshpubkey">2.1. Install Public Keys</h3>
- <p>Send gitolite.pub public key to server. In this example
- bob (administrator of gitolite) is on same host,
- first copy is public key to admin home directory;</p>
+ <p>Example how to give ssh access to bob user to admin account
+ using public key authentication. Is necessary to make user public
+ key available in the server, this can be done by several ways, in
+ this example the public key will be copied using scp;</p>
<pre>
- # install -o admin -g admin /home/bob/.ssh/gitolite.pub /home/admin/.ssh/gitolite.pub
- </pre>
-
- <p>If the server is on remote a remote machine;</p>
-
- <pre>
- $ scp /home/bob/.ssh/gitolite.pub admin@core.privat-network.net:/home/admin/.ssh/
+ $ scp /home/bob/.ssh/id_rsa.pub admin@core.privat-network.net:/home/admin/.ssh/
bob@core.privat-network.net's password:
- gitolite.pub 100% 390 0.4KB/s 00:00
+ id_rsa.pub 100% 390 0.4KB/s 00:00
</pre>
- <p>In case of bob public key for normal ssh login, admin can
- add his public key to authorized keys;</p>
+ <p>Login on remote as admin and add bob public key to authorized keys;</p>
<pre>
- $ cat bob_rsa.pub &gt;&gt; ~/.ssh/authorized_keys
+ $ cat ~/.ssh/bob_rsa.pub &gt;&gt; ~/.ssh/authorized_keys
</pre>
+ <p>Now bob can login as admin on remote server using publik key
+ athentication;</p>
+
<pre>
- $ ssh -P 2222 bob@remote.org
+ $ ssh -P 2222 admin@remote.org
</pre>
<h3 id="sshid">2.2. Configure Identities</h3>
@@ -230,53 +227,49 @@
-i flag. Create or edit ~/.ssh/config</p>
<pre>
- Host admin
+ Host core
Hostname core.privat-network.net
IdentityFile ~/.ssh/id_rsa
Port 2222
User admin
- Host gitolite
- Hostname core.privat-network.net
- IdentityFile ~/.ssh/gitolite
- Port 2222
- User gitolite
-
- Host box
+ Host git
Hostname core.privat-network.net
IdentityFile ~/.ssh/id_rsa
Port 2222
- User bob
+ User gitolite
- Host devbox
+ Host git-admin
Hostname core.privat-network.net
- IdentityFile ~/.ssh/id_rsa
+ IdentityFile ~/.ssh/gitolite
Port 2222
User gitolite
</pre>
- <p>Now you can just type;</p>
+ <p>Now you can just type ssh core to connect core.privat-network.net on
+ port 2222 with ~/.ssh/id_rsa as identity, or to connect to git server as
+ gitolite admin;</p>
<pre>
- $ ssh box
+ $ ssh git-admin
</pre>
- <p>On remote start <a href"../systools/tmux.html">tmux</a>
- and detach from the session with ctrl + b d</p>
-
- <p>Create alias on ~/.profile;</p>
+ <p>To take advantage of tmux first login on remote and start
+ <a href"../systools/tmux.html">tmux</a>, detach from the session
+ with ctrl + b d. On change ~/.profile and add alias;</p>
<pre>
- alias boxtmux="ssh servername -t tmux a"
+ alias core-server="ssh core -t tmux a"
</pre>
<p>Source it and attach to remote;</p>
<pre>
- $ boxtmux
+ $ source ~/.profile
+ $ core-server
</pre>
- <p>Logout just detach from session with ctrl + b d </p>
+ <p>To logout just detach from tmux session with ctrl + b d </p>
<h2 id="reverse">3. Reverse connection</h2>