SSH服务及花生壳域名解析

来源:互联网 发布:steam淘宝发礼物 编辑:程序博客网 时间:2024/05/16 07:24

一、安装说明(以CentOS 5为例)


1、安装必要的开发包


[root@localhost ~]# yum install gcc gcc-c++ autoconf automake


2、下载phddns-2.0.2.16556.tar.gz到某一个目录


[root@localhost ~]# wget http://download.oray.com/peanuthull/phddns-2.0.2.16556.tar.gz


3、解压所有文件


[root@localhost ~]# tar zxvf phddns-2.0.2.16556.tar.gz


4、进入目录并编译

[root@localhost ~]# cd phddns-2.0.2.16556

[root@localhost phddns-2.0.2.16556]# aclocal

[root@localhost phddns-2.0.2.16556]# autoconf

[root@localhost phddns-2.0.2.16556]# automake

[root@localhost phddns-2.0.2.16556]# ./configure

[root@localhost phddns-2.0.2.16556]# make

[root@localhost phddns-2.0.2.16556]# cd src

[root@localhost src]# ls -l phddns

-rwxr-xr-x 1 root root 80968 Aug 2 11:18 phddns


5、执行编译好的程序并配置(默认使用/etc/phlinux.conf,如果不存在这个文件则自动进入交互配置)


[root@localhost src]# ./phddns

输入服务器地址,如无特殊情况可使用默认值

Enter server address(press ENTER use phlinux3.oray.net):


输入您的Oray帐号名称

Enter your Oray account:


对应的Oray帐号密码

Password:


选择帮定的网卡,如无特殊,默认即可

Network interface(s):

eth0:192.168.141.18

lo:127.0.0.1

Choose one(default eth0):


选择日志保存到哪个文件

Log to use(default /var/log/phddns.log):


保存配置文件,选择yes则直接保存到/etc/phlinux.conf,输入other可以指定文件

Save to configuration file (/etc/phlinux.conf)?(yes/no/other):

(到默认位置可能没有权限)
接下来程序将已交互模式开始运行

192.168.141.18

NIC bind success

OnStatusChanged okConnecting

OnStatusChanged okDomainListed

OnDomainRegistered skyvense22.gicp.net

OnStatusChanged okDomainsRegistered

UserType: 0

看到上面这些就表示登录成功,这个时候可以按ctrl+c先退出程序


6、将phddns拷贝到你希望的位置

[root@localhost src]# cp phddns /usr/bin/


7、以后台模式启动花生壳并检查运行情况


[root@localhost ~]# /usr/bin/phddns -c /etc/phlinux.conf -d

phlinux started as daemon!

[root@localhost ~]# tail /var/log/phddns.log

2011/08/02 11:28:58.256| ExecuteUpdate OK, BeginKeepAlive!

2011/08/02 11:29:59.354| SendKeepAlive() 8208

2011/08/02 11:30:00.355| RecvKeepaliveResponse() Data comes, OPCODE:8272

2011/08/02 11:30:00.356| Keepalive response received, client ip: 116.231.123.96

2011/08/02 11:31:00.447| SendKeepAlive() 8208

2011/08/02 11:31:01.450| RecvKeepaliveResponse() Data comes, OPCODE:8272

2011/08/02 11:31:01.450| Keepalive response received, client ip: 116.231.123.96


8、退出花生壳


查看进程ID

[root@localhost ~]# ps -A | grep phddns

13731 ? 00:00:00 phlinux

让后台进程退出

[root@localhost ~]# kill -9 13731


9、将花生壳加到系统启动时运行

[root@localhost ~]# vi /etc/rc.local

在文件的末尾加上一行:/usr/bin/phddns -c /etc/phlinux.conf -d

二、ssh

SSH分客户端openssh-client和openssh-server
如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则sudo apt-get install openssh-client),如果要使本机开放SSH服务就需要安装openssh-server
sudo apt-get install openssh-server
然后确认sshserver是否启动了:
ps -e |grep ssh
如果看到sshd那说明ssh-server已经启动了。
如果没有则可以这样启动:sudo /etc/init.d/ssh start
ssh-server配置文件位于/ etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号,如222。
然后重启SSH服务:
sudo /etc/init.d/ssh stop    或sudo service ssh stop
sudo /etc/init.d/ssh start    或sudo service ssh start
然后使用以下方式登陆SSH:
ssh username@192.168.1.112 username为192.168.1.112 机器上的用户,需要输入密码。
断开连接:exit


原创粉丝点击