在ubuntu 上配置Android 系统源码编译环境

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/liuhaomatou/article/details/79484213

一.查看ubuntu 的版本信息:

cat /proc/version

lsb_release -a


二.给系统添加新的用户:  adduser  micheal

三.使用xShell 工具远程登陆服务器(新安装的ubuntu 的系统中如果没有开启ssh-server服务,是无法使用xShell 进行连接的)

sudo apt-get install openssh-server
Ubuntu缺省安装了openssh-client,所以在这里就不安装了,如果你的系统没有安装的话,再用apt-get安装上即可。
然后确认sshserver是否启动了:
ps -e |grep ssh
如果只有ssh-agent那ssh-server还没有启动,需要/etc/init.d/ssh start,如果看到sshd那说明ssh-server已经启动了。
ssh-server配置文件位于/ etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号,如222。然后重启SSH服务:

sudo /etc/init.d/ssh resar

四:给用户添加sudo 的权限(如果没有su的权限会提示:xxx不在 sudoers 文件中。此事将被报告。)

sudo vim /etc/sudoers

# User privilege specification  
root        ALL=(ALL:ALL) ALL  

username    ALL=(ALL:ALL) ALL

sudoers的权限是0440,即只有root才能读。在你用root或sudo后强行保存(wq!)即可.

五:安装git 工具:sudo apt-get install git

六:安装samba:

1.samba:   sudo apt-get install samba

2.访问权限配置:

sudo 

 vim /etc/samba/smb.conf  

[micheal]
        path = /
        writeable = yes
;       browseable = yes
;       guest ok = no

        valid users = micheal

3.创建Samba用户

smbpasswd -a micheal

4.重启samba:

sudo /etc/init.d/samba restart



七:生成公钥和私钥,添加git 服务器权限证书,ssh-keygen -t rsa -P ''

ssh-keygen -t rsa -P ‘’
-P表示密码,-P '' 就表示空密码,也可以不用-P参数,这样就要三车回车,用-P就一次回车。
它在/home/用户目录下生成.ssh目录,.ssh下有 id_rsa (这个是私钥)和 id_rsa.pub (这个是公钥)。
需要把.ssh/id_rsa.pub 添加到repo 的 repositories/gitolite-admin/keydir
在 repo 账户下repositories/gitolite-admin/conf/gitolite.conf 增加对应的账户信息






猜你喜欢

转载自blog.csdn.net/liuhaomatou/article/details/79484213