Skip to content

Instantly share code, notes, and snippets.

@luxixing
Created June 22, 2013 15:31
Show Gist options
  • Save luxixing/5841286 to your computer and use it in GitHub Desktop.
Save luxixing/5841286 to your computer and use it in GitHub Desktop.
一些常用sh命令收集
#将本地生成的公匙写入到远端服务器的验证文件中,实现无密码登录
cat ~/.ssh/id_rsa.pub | ssh user@host "cat - >> ~/.ssh/authorized_keys"
#生成ssh密匙命令在当前用户家目录
ssh-keygen
#显示系统有多少用户
cat /etc/passwd | cut -d: -f1
#ssh登陆之后执行一个命令
ssh -t [email protected] "cd /data ; bash"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment