RH401第四章 使用SVN管理变化的文件 【练习一】 « Rednat Linux网络日志平台_linux集群_gfs文件系统_iscsi存储配置_ldap服务加密_rac负载均衡_data guard异地备份_ogg流复制技术_rman备份恢复 
首页 » 红帽培训 » RH401第四章 使用SVN管理变化的文件 【练习一】

RH401第四章 使用SVN管理变化的文件 【练习一】

时间:2011-07-18作者:felix.chan分类:红帽培训评论:0

RH401课程实验网络环境说明:

Server:server1.example.com   提供X机redhat5.4系统的yum安装源,以及rhn装程序、RHN证书和频道文件,一个网卡eth0 IP为:192.168.0.254

X机:   station14.example.com  该机为RHN服务器,redhat5.4的系统,网卡eth0 Ip为:192.168.0.14,和服务器网络通讯。网卡eth1 ip为:10.100.14.14,和Y机直连交叉线通讯

Y机:   station1.private14.com 该机为RHN服务器管理的client,redhat5.1的系统,网卡eth0 ip为:10.100.14.1 和X机直接连接,未经过交换机。

 

在本章暂用X机做SVN服务器,Y机做客户机。

 

Lab:4.1

1:用root用户登陆并且安装subversion到X机,在X机上创建仓库为/var/local/svn

2:在X机上,创建一个组为svnuser,其group id 为60000,修改subversion仓库目录权限让全部属于这个组的用户都能够建立和修改项目文件。

3:在X机创建用户为oliver和stan,密码都设置为password。

对这些账户做些必要的调整,使他们能够从任意的主机登陆上来。当两个账户账户从Y机登陆后能够不需要输入密码就能传送变更的文件到svn仓库中。

 

具体配置步骤如下:

在X机上进行以下操作:

[root@localhost /]# yum install subversion –y   #安装svn

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Resolving Dependencies

–> Running transaction check

—> Package subversion.i386 0:1.4.2-4.el5_3.1 set to be updated

–> Finished Dependency Resolution

 

Dependencies Resolved

 

================================================================================

Package           Arch        Version                   Repository        Size

================================================================================

Installing:

subversion        i386       1.4.2-4.el5_3.1           rhel-Base       2.3 M

 

Transaction Summary

================================================================================

Install      1 Package(s)

Update       0 Package(s)

Remove       0 Package(s)

 

Total download size:2.3 M

Downloading Packages:

subversion-1.4.2-4.el5_3.1.i386.rpm                      | 2.3 MB     00:01

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing     : subversion                                               1/1

 

Installed:

subversion.i386 0:1.4.2-4.el5_3.1

 

Complete!

[root@localhost /]# svnadmin create /var/local/svn   #创建SVN仓库

[root@localhost /]# groupadd svnuser -g 60000      #创建SVN用户组

[root@localhost home]# useradd oliver

[root@localhost home]# useradd stan

[root@localhost home]# echo password |passwd –stdin oliver

Changing password for user oliver.

passwd: all authentication tokens updated successfully.

[root@localhost home]# echo password |passwd –stdin stan

Changing password for user stan.

passwd: all authentication tokens updated successfully.

[root@localhost home]# usermod -a -G svnuser oliver

[root@localhost home]# usermod -a -G svnuser stan

[root@localhost home]# echo “export EDITOR=vim”>>/home/stan/.bash_profile

[root@localhost home]# echo “export EDITOR=vim”>>/home/oliver/.bash_profile

 

 

在Y机上进行如下操作:

[root@localhost home]# useradd oliver

[root@localhost home]# useradd stan

[root@localhost home]# echo password |passwd –stdin oliver

Changing password for user oliver.

passwd: all authentication tokens updated successfully.

[root@localhost home]# echo password |passwd –stdin stan

Changing password for user stan.

passwd: all authentication tokens updated successfully.

[root@localhost home]# echo “export EDITOR=vim”>>/home/stan/.bash_profile

[root@localhost home]# echo “export EDITOR=vim”>>/home/oliver/.bash_profile

 

[root@localhost home]# su – oliver

[oliver@localhost ~]$ ssh-keygen -t dsa      #创建ssh公钥 指定用dsa加密算法

Generating public/private dsa key pair.

Enter file in which to save the key (/home/oliver/.ssh/id_dsa):   #不用输入,直接回车

Created directory ‘/home/oliver/.ssh’.

Enter passphrase (empty for no passphrase):    #输入私钥密码(自己定义)

Enter same passphrase again:        #再次输入私钥密码(同上)

Your identification has been saved in /home/oliver/.ssh/id_dsa.

Your public key has been saved in /home/oliver/.ssh/id_dsa.pub.

The key fingerprint is:

30:29:53:6b:5d:14:2f:26:e9:a8:64:8b:79:d6:5a:0e oliver@station1.private14.com

[oliver@ station14.example.com ~]$ ssh-copy-id -i ~/.ssh/id_dsa.pub station14.example.com  #将公钥放到远程计算机上

28

The authenticity of host station14.example.com (10.100.14.14)’ can’t be established.

RSA key fingerprint is 6d:0d:21:fc:de:42:eb:7d:d6:2d:18:03:69:ce:f2:aa.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘localhost’ (RSA) to the list of known hosts.

oliver@localhost’s password:    #输入之前创建的账户密码password

Permission denied, please try again.   #再次输入之前创建的账户密码password

oliver@localhost’s password:

Now try logging into the machine, with “ssh ‘ station14.example.com ‘”, and check in:

 

.ssh/authorized_keys

 

to make sure we haven’t added extra keys that you weren’t expecting.

 

 

[oliver@localhost ~]$ exit

logout

 

[root@localhost home]# su – stan

[stan@localhost ~]$ ssh-keygen -t dsa

Generating public/private dsa key pair.

Enter file in which to save the key (/home/stan/.ssh/id_dsa):

Created directory ‘/home/stan/.ssh’.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/stan/.ssh/id_dsa.

Your public key has been saved in /home/stan/.ssh/id_dsa.pub.

The key fingerprint is:

c2:26:a8:56:f8:79:8c:ef:a5:4b:05:9c:41:bb:2e:b0 stan@station1.private14.com

[stan@localhost ~]$ ssh-copy-id -i ~/.ssh/id_dsa.pub station14.example.com

26

The authenticity of host ‘ station14.example.com (10.100.14.14)’ can’t be established.

RSA key fingerprint is 6d:0d:21:fc:de:42:eb:7d:d6:2d:18:03:69:ce:f2:aa.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘localhost” (RSA) to the list of known hosts.

stan@localhost’s password:

Now try logging into the machine, with “ssh ‘ station14.example.com ‘”, and check in:

 

.ssh/authorized_keys

 

to make sure we haven’t added extra keys that you weren’t expecting.

 

好了,现在在Y机上用oliver和stan用户ssh到X机不在需要输入密码了。

 

后续内容:RH401第四章 使用SVN管理变化的文件【练习二】

原创文章,转载请注明: 转载自红防联盟www.rednat.com

本文链接地址: RH401第四章 使用SVN管理变化的文件 【练习一】

|2|right
Tags: , ,
0 条评论

暂时没有评论!

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>