zoukankan      html  css  js  c++  java
  • SSH到VirtualBox里面的CentOS

    这段时间用到了虚拟机,为了上网我选择了NAT模式,但那个IP是固定的,而且外面不能访问,可我想ssh进去,无奈之下想其它方法了:

    1hostonly模式,通过共享上网;

    2NAT下端口转发;

    方法1是我用VMware时经常用的,VirtualBox下没成功过,pass掉;方法2没试过,我之前的一篇文章(http://www.cnblogs.com/MikeZhang/archive/2012/03/07/socketRedirect.html )提到过端口重定向的问题,应该可以;再不行就换VMWare……

    我选择了方法2,步骤如下:

    1、设置端口转发:

    2putty测试:

    执行效果:

    3、终端下ssh测试

    命令:ssh 192.168.18.113 -p 2222

    执行效果:

    顺便试下传文件:

    scp -P 2221 timer1 root@192.168.18.113:/root/Downloads/

    执行效果:

    哈哈,成功了!

    好,就这些了,希望对你有帮助。

  • E-Mail : Mike_Zhang@live.com
  • 转载请注明出处,谢谢!
查看全文
  • 相关阅读:
    Solution SQL Server 2008 Configuration Manager Cannot open problem.
    Grant, Revoke, Deny
    Solution: 无法察看SQL Server 数据库属性 错误: "There is no row at position 0. (System.Data)"
    SQL SMO 学习
    恢复误删的桌面 回收站
    SQL Server Security Understanding.
    SQL Server 中的 Schema, User, Login, Role
    形而上学 辩证法
    文档归档的配置发送
    无法从服务器加载工作流操作
  • 原文地址:https://www.cnblogs.com/MikeZhang/p/sshVBoxCentOS.html
  • Copyright © 2011-2022 走看看