Ubuntu Server上如何安装Gi

相信大家在学习Ubuntu系统的时候都接触过GI,但是并没有去深究,对于Ubuntu Server上如何安装Gi是不是很多人都还不会呢?

那么小编就为大家介绍Ubuntu Server上安装Gi的方法。

首先安装SSH Server:

打开Ubuntu Server终端,输入如下代码:

sudo apt-get install openssh-server

生成RSA Key(请su到普通用户来执行此命令):

ssh-keygen -t rsa

修改配置文件/etc/ssh/sshd_config:

Port 22 # 修改成你想要的登陆端口,如2222

PermitRootLogin no # 禁止root用户登陆

StrictModes yes # 检查密钥的用户和权限是否正确,默认打开的

RSAAuthentication yes # 启用 RSA 认证

PubkeyAuthentication yes # 启用公钥认证

PasswordAuthentication no # 禁止密码认证,默认是打开的

ServerKeyBits 1024 # 修改后变为此状态,将ServerKey强度改为1024比特

PermitEmptyPasswords no # 修改后变为此状态,禁止空密码进行登录

将id_rsa文件拷贝到Client端的~/.ssh/目录下,将id_rsa.pub拷贝到Server端的~/.ssh/目录下,改名为authorized_keys,重启SSH服务:

sudo /etc/init.d/ssh restart

安装Git软件:

sudo apt-get install git-core

安装Gitosis:

mkdir ~/src

cd ~/src

git clone git://

cd gitosis

sudo python setup.py install

增加git用户:

sudo adduser –system –shell /bin/sh –gecos ‘git version control’ –group –disabled-password –home /home/git git

初始化git目录,USER指在当前服务器的用户:

sudo -H -u git gitosis-init < /home/USER/.ssh/authorized_keys
sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update

在Client端执行:

git clone git@YOUR_SERVER:gitosis-admin.git

cd gitosis-admin

在gitosis.conf配置文件中增加:

[group myapp]
members = vince@urbanpuddle
writable = myapp

然后提交:

git commit -a -m “created a new repository”

git push

创建目录并提交文件

mkdir myapp

cd myapp

编辑.gitignore加入要忽略的文件

.DS_Store

然后执行:

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

上文就是小编为大家介绍Ubuntu Server上如何安装Gi的内容,虽然我们已经掌握了不少技巧,

但是在使用的时候还是要注意很多的地方

 

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

Ubuntu Server上如何安装Gi

上一篇:linux基础知识以及虚拟机安装、基础操作


下一篇:建立VNC Linux服务器的步骤