从vmware模板克隆linux的操作

 1 选择模板,进行克隆

2 进入欢迎页面,“下一步“

3 选择克隆源

4 克隆类型“完整克隆”

5 输入虚拟机名称以及保存的路径

6 点击“完成”,完成克隆操作

克隆完后,网络,机器名会有很多问题,真正使用需要如下解决

7 使网络可用

7.1 查看网卡的mac地址

    

 7.2 查看设备名

[root@centos65-template ~]# vi /etc/udev/rules.d/70-persistent-net.rules

  7.3 修改网卡配置

  [root@centos65-template ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

  

    注意hwaddr地址和1,2步骤处对应,device和2步骤处对应,ip地址设置网络唯一地址

 8 增加业务用户(假设hadoop用户)

[root@centos65-template ~]# groupadd hadoop
[root@centos65-template ~]# useradd hadoop -g hadoop
[root@centos65-template ~]# passwd hadoop

9 设置用户为sudo

出现如下问题

Linux下is not in the sudoers file解决方法

我们使用sudo命令切换用户的时候可能会遇到提示以下错误:xxx is not in the sudoers file. This incident will be reported,xxx是你当前的用户名,究其原因是用户没有加入到sudo的配置文件里

9.1 切换到root用户,运行visudo命令

9.2 在打开的配置文件中,找到root ALL=(ALL) ALL,在下面添加一行

xxx ALL=(ALL) ALL 其中xxx是你要加入的用户名称

9.3 输入:wq保存并退出配置文件,再次使用sudo命令就不会有上面的提示了。

10、设置SSH不需无密码就登录
10.1 创建目录和生成秘钥
[hadoop@centos65-template ~]$ cd
[hadoop@centos65-template ~]$ mkdir .ssh
[hadoop@centos65-template ~]$ ssh-keygen -t rsa

10.2 拷贝秘钥文件到authorized_keys.设置ssh目录的权限

 

[hadoop@centos65-template ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
[hadoop@centos65-template ~]$ chmod 700 .ssh
[hadoop@centos65-template ~]$ chmod 600 .ssh/*

10.3 ssh严格模式设置为no

[root@slave2 hadoop]# sudo vi /etc/ssh/sshd_config
改为
 
10.4 安装SSH-client
[hadoop@centos65-template ~]$ sudo yum install -y openssh-clients
10.5 修改主机名(djt11)
[hadoop@centos65-template ~]$ sudo vi /etc/hosts
10.6 验证无密码登陆
 
 
posted @ 2017-04-27 00:51  天空之家  阅读(2113)  评论(0编辑  收藏  举报