I believe that everyone has been in touch with GI when learning the Ubuntu system, but did not go into it. Is it true that many people still do n’t know how to install Gi on Ubuntu Server?
Then the editor will introduce the method of installing Gi on Ubuntu Server.
First install SSH Server:
Open the Ubuntu Server terminal and enter the following code:
sudo apt-get install openssh-server
Generate RSA Key (please su to normal user to execute this command):
ssh-keygen -t rsa
Modify the configuration file / etc / ssh / sshd_config:
Port 22 # Change to the login port you want, such as 2222
PermitRootLogin no # Disable root user login
StrictModes yes # Check whether the user and permissions of the key are correct, it is enabled by default
RSAAuthentication yes # enable RSA authentication
PubkeyAuthentication yes # Enable public key authentication
PasswordAuthentication no # Disable password authentication, the default is open
ServerKeyBits 1024 # changed to this state after modification, the ServerKey strength is changed to 1024 bits
PermitEmptyPasswords no # After modification, it will change to this state, forbid login with blank password
Copy the id_rsa file to the ~ / .ssh / directory on the client side, copy id_rsa.pub to the ~ / .ssh / directory on the server side, rename it to authorized_keys, and restart the SSH service:
sudo /etc/init.d/ssh restart
Install Git software:
sudo apt-get install git-core
Install Gitosis:
mkdir ~/src
cd ~/src
git clone git://http://eagain.net/gitosis
cd gitosis
sudo python setup.py install
Add git user:
sudo adduser –system –shell /bin/sh –gecos ‘git version control’ –group –disabled-password –home /home/git git
Initialize the git directory, USER refers to the user on the current server:
sudo -H -u git gitosis-init < /home/USER/.ssh/authorized_keys
sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update
Execute on the client side:
git clone git@YOUR_SERVER:gitosis-admin.git
cd gitosis-admin
Add in the gitosis.conf configuration file:
[group myapp]
members = vince@urbanpuddle
writable = myapp
Then submit:
git commit -a -m “created a new repository”
git push
Create directory and submit files
mkdir myapp
cd myapp
Edit .gitignore to add the file to be ignored
.DS_Store
Then execute:
cd myapp
git init
git remote add origin git@YOUR_SERVER:myapp.git
git add .
git commit -a -m “initial import”
git push origin master:refs/heads/master
The above is a small editor to introduce how to install Gi on Ubuntu Server, although we have mastered many skills,
But when using it, there are still many points to pay attention to
163.197.192.21
163.197.192.22
163.197.192.23
163.197.192.24
163.197.192.25
163.197.192.26
163.197.192.27
163.197.192.28
163.197.192.29
163.197.192.30
163.197.192.31
163.197.192.32
163.197.192.33
163.197.192.34
163.197.192.35
163.197.192.36
163.197.192.37
163.197.192.38
163.197.192.39
163.197.192.40
163.197.192.41
163.197.192.42
163.197.192.43
163.197.192.44
163.197.192.45
163.197.192.46
163.197.192.47
163.197.192.48
163.197.192.49
163.197.192.50
163.197.192.51
163.197.192.52
163.197.192.53
163.197.192.54
163.197.192.55
163.197.192.56
163.197.192.57
163.197.192.58
163.197.192.59
163.197.192.60
163.197.192.61
163.197.192.62
163.197.192.63
163.197.192.64
163.197.192.65
163.197.192.66
163.197.192.67
163.197.192.68
163.197.192.69
163.197.192.70
163.197.192.71
163.197.192.72
163.197.192.73
163.197.192.74
163.197.192.75
163.197.192.76
163.197.192.77
163.197.192.78
163.197.192.79
163.197.192.80
163.197.192.81
163.197.192.82
163.197.192.83
163.197.192.84
163.197.192.85
163.197.192.86
163.197.192.87
163.197.192.88
163.197.192.89
163.197.192.90
163.197.192.91
163.197.192.92
163.197.192.93
163.197.192.94
163.197.192.95
163.197.192.96
163.197.192.97
163.197.192.98
163.197.192.99
163.197.192.100
163.197.192.101
163.197.192.102
163.197.192.103
163.197.192.104
163.197.192.105
163.197.192.106
163.197.192.107
163.197.192.108
163.197.192.109
163.197.192.110
163.197.192.111
163.197.192.112
163.197.192.113
163.197.192.114
163.197.192.115
163.197.192.116
163.197.192.117
163.197.192.118
163.197.192.119
163.197.192.120
163.197.192.121
163.197.192.122
163.197.192.123
163.197.192.124
163.197.192.125
163.197.192.126
163.197.192.127
163.197.192.128
163.197.192.129
163.197.192.130
163.197.192.131
163.197.192.132
163.197.192.133
163.197.192.134
163.197.192.135
163.197.192.136
163.197.192.137
163.197.192.138
163.197.192.139
163.197.192.140
163.197.192.141
163.197.192.142
163.197.192.143
163.197.192.144
163.197.192.145
163.197.192.146
163.197.192.147
163.197.192.148
163.197.192.149
163.197.192.150
163.197.192.151
163.197.192.152
163.197.192.153
163.197.192.154
163.197.192.155
163.197.192.156
163.197.192.157
163.197.192.158
163.197.192.159
163.197.192.160
163.197.192.161
163.197.192.162
163.197.192.163
163.197.192.164
163.197.192.165
163.197.192.166
163.197.192.167
163.197.192.168
163.197.192.169
163.197.192.170
163.197.192.171
163.197.192.172
163.197.192.173
163.197.192.174
163.197.192.175
163.197.192.176
163.197.192.177
163.197.192.178
163.197.192.179
163.197.192.180
163.197.192.181
163.197.192.182
163.197.192.183
163.197.192.184
163.197.192.185
163.197.192.186
163.197.192.187
163.197.192.188
163.197.192.189
163.197.192.190
163.197.192.191
163.197.192.192
163.197.192.193
163.197.192.194
163.197.192.195
163.197.192.196
163.197.192.197
163.197.192.198
163.197.192.199
163.197.192.200
163.197.192.201
163.197.192.202
163.197.192.203
163.197.192.204
163.197.192.205
163.197.192.206
163.197.192.207
163.197.192.208
163.197.192.209
163.197.192.210
163.197.192.211
163.197.192.212
163.197.192.213
163.197.192.214
163.197.192.215
163.197.192.216
163.197.192.217
163.197.192.218
163.197.192.219
163.197.192.220
163.197.192.221
163.197.192.222
163.197.192.223
163.197.192.224
163.197.192.225
163.197.192.226
163.197.192.227
163.197.192.228
163.197.192.229
163.197.192.230
163.197.192.231
163.197.192.232
163.197.192.233
163.197.192.234
163.197.192.235
163.197.192.236
163.197.192.237
163.197.192.238
163.197.192.239
163.197.192.240
163.197.192.241
163.197.192.242
163.197.192.243
163.197.192.244
163.197.192.245
163.197.192.246
163.197.192.247
163.197.192.248
163.197.192.249
163.197.192.250
163.197.192.251
163.197.192.252
163.197.192.253
163.197.192.254
163.197.192.255