美文网首页
Linux基本命令

Linux基本命令

作者: zycxnanwang | 来源:发表于2018-09-10 22:46 被阅读0次

    Linux的基本命令

    • 添加, 删除用户

      #创建用户命令 username是自定义的用户名
      sudo adduser  username
      
      #删除用户命令 username是自定义的用户名
      sudo userdel username #只删除用户
      sudo userdel -r username #连同用户主目录一起删除
      
    • 设置用户密码

      passwd username
      
    • 给用户添加sudo权限(必须在root权限下执行)

      • 增加sudoers文件的写权限

        chmod u+w /etc/sudoers

      • 在/etc/sudoer找到 root ALL=(ALL) ALL 在这行下边添加

        username ALL=(ALL) ALL

      • 出去sudoers文件的写权限

        chmod u-w /etc/sudoers

    • manjaro开启ssh服务命令

      systemctl enable sshd.service #开机启动
      systemctl start sshd.service #立即启动
      systemctl restart sshd.service #立即重启
      
    • 关闭开启防火墙

      #开启防火墙
      chkconfig iptables on
      #关闭防火墙
      chkconfig iptables off
      

    相关文章

      网友评论

          本文标题:Linux基本命令

          本文链接:https://www.haomeiwen.com/subject/gznegftx.html