安装ssh登陆其它机器
2015-09-25 17:10
176 查看
最近做分布式抓取,需要在其它机器上安装一些软件,并运行爬虫程序。
这个时候通过ssh就很方便了
1. 在每个机器上安装openssh-server, openssh-client
命令sudo apt-get install openssh-server openssh-client
2. 在一个机子上访问其它机器 (访问局域网)
命令 ssh 192.168.8.151就进去了其它机器
3. 公司的机器一般名字都相同,这时我们想区分每台机器,就用http://askubuntu.com/questions/145618/how-can-i-shorten-my-command-line-bash-prompt提到的方法来更改bash prompt
3.1)如果只需要在当前terminal更改,使用命令PS1='\u@daidai-151:\W\$
',那么命令行名称就变成了moma@daidai-151,其中moma是用户名
3.2)如果需要永久更改,
命令sudo vi ~/.bashrc
打开.bashrc文件后,找到
改成如下
4. 简单的拷文件的方法,要把本机/home/moma/Desktop中的a.txt文件拷到机器a, b, c, d, e等中,那么我们
4.1)在本机/home/moma/Desktop下打开一个terminal,然后运行python -m SimpleHTTPServer 8888
4.2)在机器a中某个位置,输入命令wget http://192.168.8.151/a.txt 就能把151这个机子上的a.txt拷贝过来
这个时候通过ssh就很方便了
1. 在每个机器上安装openssh-server, openssh-client
命令sudo apt-get install openssh-server openssh-client
2. 在一个机子上访问其它机器 (访问局域网)
命令 ssh 192.168.8.151就进去了其它机器
3. 公司的机器一般名字都相同,这时我们想区分每台机器,就用http://askubuntu.com/questions/145618/how-can-i-shorten-my-command-line-bash-prompt提到的方法来更改bash prompt
3.1)如果只需要在当前terminal更改,使用命令PS1='\u@daidai-151:\W\$
',那么命令行名称就变成了moma@daidai-151,其中moma是用户名
3.2)如果需要永久更改,
命令sudo vi ~/.bashrc
打开.bashrc文件后,找到
if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi
改成如下
if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@daidai-151\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@daidai-151:\W\$ ' fi
4. 简单的拷文件的方法,要把本机/home/moma/Desktop中的a.txt文件拷到机器a, b, c, d, e等中,那么我们
4.1)在本机/home/moma/Desktop下打开一个terminal,然后运行python -m SimpleHTTPServer 8888
4.2)在机器a中某个位置,输入命令wget http://192.168.8.151/a.txt 就能把151这个机子上的a.txt拷贝过来
相关文章推荐
- ubuntu LVM搭建
- C# .net设置系统音量
- PostgreSQL 资源
- SecureCRT 绝佳配色方案, 保护你的眼睛
- LeetCode----Reverse Linked List
- IOS 文件管理,基础使用
- 【Maven实战】搭建Nexus伺服器
- iOS尺寸
- file_put_contents() failed to open stream: Permission denied 问题解决(生成日志文件)
- 一些黑魔法摘录
- 构造函数不能为虚函数,析构函数可为虚函数
- 安装Linux Mint 17后要做的20件事
- opencv--学习之感兴趣区域(ROI)
- -webkit-transition: all .2s ease-in-out;
- 日志挖掘Logmnr
- adb shell kill -3 pid
- Windows Server 2012 R2、Windows Server 2012、Windows 8.1 或 Windows 8 上无法启用 Microsoft .NET Framework 3.
- Windows Server 2012 R2、Windows Server 2012、Windows 8.1 或 Windows 8 上无法启用 Microsoft .NET Framework 3.
- 字符及文本处理之四:sed进阶
- 生成所有sequence Yahtzee part 1