From 29463878401499672150f2a3469bf8e8b9bff17b Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Fri, 21 Oct 2016 17:06:40 +0100 Subject: gitolite and gitweb revision --- tools/openssh.html | 63 ++++++++++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 35 deletions(-) (limited to 'tools/openssh.html') 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 @@

2.1. Install Public Keys

-

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;

+

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;

-        # install -o admin -g admin /home/bob/.ssh/gitolite.pub /home/admin/.ssh/gitolite.pub
-        
- -

If the server is on remote a remote machine;

- -
-        $ 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
         
-

In case of bob public key for normal ssh login, admin can - add his public key to authorized keys;

+

Login on remote as admin and add bob public key to authorized keys;

-        $ cat bob_rsa.pub >> ~/.ssh/authorized_keys
+        $ cat ~/.ssh/bob_rsa.pub >> ~/.ssh/authorized_keys
         
+

Now bob can login as admin on remote server using publik key + athentication;

+
-        $ ssh -P 2222 bob@remote.org
+        $ ssh -P 2222 admin@remote.org
         

2.2. Configure Identities

@@ -230,53 +227,49 @@ -i flag. Create or edit ~/.ssh/config

-        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
         
-

Now you can just type;

+

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;

-        $ ssh box
+        $ ssh git-admin
         
-

On remote start tmux - and detach from the session with ctrl + b d

- -

Create alias on ~/.profile;

+

To take advantage of tmux first login on remote and start + tmux, detach from the session + with ctrl + b d. On change ~/.profile and add alias;

-        alias boxtmux="ssh servername -t tmux a"
+        alias core-server="ssh core -t tmux a"
         

Source it and attach to remote;

-        $ boxtmux
+        $ source ~/.profile
+        $ core-server
         
-

Logout just detach from session with ctrl + b d

+

To logout just detach from tmux session with ctrl + b d

3. Reverse connection

-- cgit