查看“Linux命令”的源代码
←
Linux命令
跳转至:
导航
,
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
== ssh == === debug === ==== server端 ==== <source lang="shell"> # vi /etc/ssh/sshd_conf LogLevel DEBUG3 # restart sshd service sshd restart # 查看log tail -f /var/log/secure </source> == cmd == === sshpass === <source lang="shell"> # 第一次必须ssh登入一次 sshpass -p cisco123 ssh root@192.168.125.186 </source> == awk == === 打印第一行第二列 === <source lang="shell"> ps -ef | grep sshd | head -n1 | awk {'print $2'} # example [qingwyan@localhost smartphy114]$ ps -ef | grep sshd root 1405 1 0 Nov23 ? 00:00:00 /usr/sbin/sshd -D root 13092 1405 0 19:49 ? 00:00:00 sshd: qingwyan [priv] qingwyan 13108 13092 0 19:49 ? 00:00:00 sshd: qingwyan@notty qingwyan 16602 32280 0 21:07 pts/5 00:00:00 grep --color=auto sshd root 20010 1405 0 Nov28 ? 00:00:02 sshd: root@pts/19 [qingwyan@localhost smartphy114]$ ps -ef | grep sshd | head -n1 | awk {'print $2'} 1405 </source> == sed == === 替换文本里所有符合条件字符 === <source lang="shell"> sed -i 's/原来字符/替换字符/g' "替换的文件名" </source> == 用户管理 == === 添加sudo权限用户 === <source lang="shell"> adduser username passwd username usermod -aG wheel username # 修改文件 /etc/sudoers ## Allow root to run any commands anywhere root ALL=(ALL) ALL qingwyan ALL=(ALL) ALL </source>
返回至
Linux命令
。
导航菜单
个人工具
创建账户
登录
命名空间
页面
讨论
不转换
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
台灣正體
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息