Openwrt 串口多用户访问

参考:http://wiki.openwrt.org/doc/howto/secure.access

一、编译配置
1、make menuconfig

Administration --->
   <*> sudo ... ...

Utilities --->
   <*> shadow-groupadd ... ...
   <*> shadow-useradd ... ...
   <*> shadow-usermod ... ...

二、添加用户

useradd win
passwd win
mkdir -p /home/win

vim /etc/passwd
win:x:1000:1000::/home/win:/bin/ash

三、赋予root权限三种方法

①全面开放root权限
visudo

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
Defaults targetpw  # Ask for the password of the target user
ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'

②给win加上root特权
visudo

##                                                               
## User privilege specification
##                                                                      
root ALL=(ALL) ALL                                                      
win ALL=(ALL) ALL    //添加此行

③创建sudo组
visudo

## Uncomment to allow members of group sudo to execute any command
%sudo   ALL=(ALL) ALL

添加sudo 组
groupadd --system sudo
将win加入sudo 组
usermod -a -G sudo win

四、测试


可以使用sudo vi  /etc/config/wireless这样的方式执行root权限,此时输入root密码。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值