Results matching “fastdomain”

正式启用HostUS

目前使用的12$/年的美国机房VPS方案,参考链接:12$/年VPS,还是非常划算的。

对比之前几年一直使用的FastDomain价格:一次购买3年,每个月要7$,域名每年15$,3年就要近300$,以前真是太不懂得打算直接续费了2次,现在想来确实好贵。

本来这次也是快要到FastDomain的续期时间了,但因为还是想弄个VPS,所以先是测试HostUS在香港的机房,在公司的网络下延迟只有5ms左右,爽歪歪,回到家才发现真的要绕行美国兜一大圈,而且价格还比美国机房的VPS贵一倍,果断退款,重新购买了美国机房的VPS。

购买后,完成了nginx/mysql/php/perl/mt/wp/pptp/openvpn/ss的搭建,基本把想玩的都玩了,还算挺顺利。

最后再把FastDomain上的2个域名也都迁移了过来,但设置DNS居然还闹出一出笑话:

我在HostUS的管理后台傻傻的设置了它帮助文档中提到的Nameserver,结果3天了也没生效,发起一个ticket后人家告诉我HoustUS根本不提供DNS服务,只好立即在DNSPod注册登记,然后在HostUS设置了免费的DNSPod的DNS服务器,1个小时后就生效,效果杠杠的。

--EOF--

PS1 ANSI 的重新梳理

之前已经发现有PS1的异常问题:http://www.guduo.net/2012/02/000392.html
PS1="\n\e[1;37m[\e[m\e[1;32m\u\e[m\e[1;33m@\e[m\e[1;35m\h\e[m \e[4m\`pwd\`\e[m\e[1;37m]\e[m\n\\$ "
参考:http://www.dbanotes.net/techmemo/unix_rm_-f.html 我有留言

这个PS1的设置在fastdomain的机器上允许没问题,但在当时的CentOS上实际是有异常的,今天在Raspberry Pi上也有光标的问题,重新修改了一下,目前正常了:
PS1="\n\[\e[1;37m\][\[\e[m\e[1;32m\]\u\[\e[m\e[1;33m\]@\[\e[m\e[1;35m\]\h\[\e[m \e[4m\]\`pwd\`\[\e[m\e[1;37m]\e[m\e[1;36m\]\n\[\e[m\]\\$ "
export PS1

参考信息:http://www.4ucode.com/Study/Topic/1611190
PS1="\u@\h:\w\$ " 
    但是这样设置之后显示的提示符是没有颜色的,如果希望加入颜色设置,可以这样:

PS1="\e[1;32m\u\e[m\e[1;33m@\e[m\e[1;35m\h\e[m:\w\$ " 
    此时,在终端中的显示应该是彩色的提示符了,其中的\e[1;xxm和\e[m就是改变终端字体颜色的部分,前者是修改颜色,后者是恢复到正常显示。但是 这时还会有问题,在提示符中输入第一行时,回车换行不正常,导致显示很混乱,因此,除了这个修改之外,还需要将全部非打印字符用专用的 bash 转义序列 "\[" 和 "\]" 括起来。这两个序列通知 bash,被括起来的字符不占用行上的任何空间 ,这样就使自动换行能够继续正常工作。最终版本如下(可解决带颜色提示符的不换行问题):

PS1="\[ \e[1;32m\] \u\[ \e[m\] \[ \e[1;33m\] @\[ \e[m\]\[ \e[1;35m\] \h\[ \e[m\] :\w\$ "



另外一些信息小结:
\e 和 \033类似
\e[m 和\e0m 类似


http://51nosql.com/?p=134
Linux终端输出颜色控制

文本终端的颜色可以使用"ANSI非常规字符序列"来生成:
cho -e "\033[背景;前景;光标mME \033[0m"
例:  echo -e "\033[44;37;5m ME \033[0m COOL"
上命令设置背景成为蓝色,前景白色,闪烁光标,输出字符"ME",然后重新设置屏幕到缺省设置,输出字符 "COOL"。"e"是命令 echo 的一个可选项,它用于激活特殊字符的解析器。"\033"引导非常规字符序列。"m"意味着设置属性然后结束非常规字符序列,这个例子里真正有效的字符是 "44;37;5" 和"0"。修改"44;37;5"可以生成不同颜色的组合,数值和编码的前后顺序没有关系。


可以选择的编码如下所示:
前景 背景 颜色
---------------------------------------
30 40 黑色
31 41 红色
32 42 绿色
33 43 黄色
34 44 蓝色
35 45 紫红色
36 46 青蓝色
37 47 白色

代码 意义
-------------------------
0 OFF
1 高亮显示
4 下划线
5 闪烁
7 反白显示
8 不可见

其他有趣的代码还有:
\033[2J  清除屏幕
\033[0q  关闭所有的键盘指示灯
\033[1q  设置"滚动锁定"指示灯 (Scroll Lock)
\033[2q  设置"数值锁定"指示灯 (Num Lock)
\033[3q  设置"大写锁定"指示灯 (Caps Lock)
\033[15:40H 把光标移动到第15行,40列
\007   发蜂鸣生beep

RedHat的字体和背景颜色的改变方法:
命令:
PS1="[\e[32;1m\u@\h \W]\\$"
export PS1="[\e[32;1m\u@\h \W]\\$" 两者的区别请查看环境变量的相关资料
解释:
\e[32;1m:这就是控制字体和背景颜色的转义字符,30~37是字体颜色、40~47是背景颜色
例子中的32;1m数字的位置是可以对调的如\e[1;32m,如果是在X环境下可以更换一下1的范围0~10,可能有的没用处:0或者不写(\e [0;32m或\e[;32m)显示浅颜色,1:显示高亮 4:加下划线.....如果改后的效果不好,但是又还原不了,那就不写m前面的数字,如\e[32;m,或者直接注销再登陆

\u \h \W:这是一些转义字符,下面详细解释:
\d :代表日期,格式为weekday month date,例如:"Mon Aug 1"
\H :完整的主机名称。例如:我的机器名称为:fc4.linux,则这个名称就是fc4.linux
\h :仅取主机的第一个名字,如上例,则为fc4,.linux则被省略
\t :显示时间为24小时格式,如:HH:MM:SS
\T :显示时间为12小时格式
\A :显示时间为24小时格式:HH:MM
\u :当前用户的账号名称
\v :BASH的版本信息
\w :完整的工作目录名称。家目录会以 ~代替
\W :利用basename取得工作目录名称,所以只会列出最后一个目录
\# :下达的第几个命令
\$ :提示字符,如果是root时,提示符为:# ,普通用户则为:$
\n :新建一行
字体并不局限于一个颜色,可以有多个颜色:
PS1="[\e[32;1m\u@\e[35;1m\h \e[31;1m\W]\\$"
以上两个命令在注销后再登陆就失效了,用下面方法使其永久生效:
vi /etc/profile
在"export PATH ....."下面添加一行:export PS1="[\e[32;1m\u@\h \W]\\$"
注销再登陆,就成功了,如果没生效,使用source /etc/profile 命令试试,或者直接重启机器。

颜色代码:
字背景颜色范围: 40-49 字颜色: 30-39
40: 黑 30: 黑
41: 红 31: 红
42: 绿 32: 绿
43: 黄 33: 黄
44: 蓝 34: 蓝
45: 紫 35: 紫
46: 深绿 36: 深绿
47: 白色 37: 白色
ANSI控制码:
\033[0m 关闭所有属性
\033[1m 设置高亮度
\03[4m 下划线
\033[5m 闪烁
\033[7m 反显
\033[8m 消隐
\033[30m -- \033[37m 设置前景色
\033[40m -- \033[47m 设置背景色
\033[nA 光标上移n行
\03[nB 光标下移n行
\033[nC 光标右移n行
\033[nD 光标左移n行
\033[y;xH设置光标位置
\033[2J 清屏
\033[K 清除从光标到行尾的内容
\033[s 保存光标位置
\033[u 恢复光标位置
\033[?25l 隐藏光标
\33[?25h 显示光标



http://www.cnblogs.com/RigorosLee/archive/2011/03/23/1992263.html
第二个部分是:

\[\e[1;32m\]\u@\h:\[\e[0m\e[1;34m\]\W\[\e[1;34m\]\$ \[\e[0m\]
我们先来研究第二部份,这个部分看起来比较简短。其中我们可以看到一个 PS1 里面非常基本的结构:\u@\h:\W\$ ,这个结构在我的电脑里就显示为 upsuper@upsuper-laptop:~$ 大家大概可以猜到里面是什么意思了吧。

这个基本骨架理出来,剩下的是看过去最蛋疼的那堆莫名其妙的符号了~我们看到很多 \e[ 这样的东西,事实上这个叫做 ANSI 控制码,在 Linux 和 Windows 的命令行里面都是通用的,\e 是 Escape 键的键码,\e[ 是一切 ANSI 控制码的开头。首先来到 \e[1;32m 这个控制码,这表示设置这个符号之后的字符为亮绿色,而 \e[0m 则是清除所有格式,这样看有没有一点清晰了呢?更多用法可以参考维基百科条目ANSI escape code。

之后还有两个东西不清楚,就是 \[ 和 \],这两个并不是 ANSI 控制码,而是 Bash 提供的转义符。他们的解释说实话我没看太懂,不过我的理解大概就是,夹在 \[ 和 \] 之间的部分 Bash 假定他们的宽度为0,不正确地标注这两个符号会导致 Bash 的换行错误。总之在所有控制符两侧都加上这两个就对了~



文本终端的颜色可以使用"ANSI非常规字符序列"来生成:

echo -e "\033[背景;前景;光标mME \033[0m"

举例:  echo -e "\033[44;37;5m ME \033[0m COOL"

以上命令设置背景成为蓝色,前景白色,闪烁光标,输出字符"ME",然后重新设置屏幕到缺省设置,输出字符 "COOL"。"e"是命令 echo 的一个可选项,它用于激活特殊字符的解析器。"\033"引导非常规字符序列。"m"意味着设置属性然后结束非常规字符序列,这个例子里真正有效的字符是 "44;37;5" 和"0"。修改"44;37;5"可以生成不同颜色的组合,数值和编码的前后顺序没有关系。


变为:
PS1="\e[32;40m\w> "
到现在为止,提示行尽管已经很不错了,但仍不太完美。在 bash 显示出工作目录以后,我们需要使用 "\e[0m" 序列将颜色重新设置为正常值。
PS1="\e[32;40m\w> \e[0m"
这个定义将显示一个漂亮的绿色提示行,但仍需要做一些扫尾工作。有时我们不需要包括 "40" 这个背景颜色设置,因为它将背景设置为黑色,而黑色是默认颜色。此外,绿色还很暗;我们通过添加一个 "1" 颜色代码来修正这个问题,这将启用更亮的加粗文字。除了这个修改之外,还需要将全部非打印字符用专用的 bash 转义序列 "\[" 和 "\]" 括起来。这两个序列通知 bash,被括起来的字符不占用行上的任何空间,这样就使自动换行能够继续正常工作。没有这两个转义序列,尽管我们有了一个非常漂亮的提示行,但是如果键入的命令恰好到达终端的最右端,就会造成显示混乱。下面是最终的提示行:
PS1="\[\e[32;1m\]\w> \[\e[0m\]"
我们也不用担心在同一个提示行中使用几种颜色,就像下面这样(我的颜色配置):
PS1=\[\e[36;1m\]\u@suse:\[\e[32;1m\]\w\[\e[36;1m\]> \[\e[0m\]



但是,当我们把这个配置写入.bashrc文件后,会发现一个问题,那就是terminal的标题栏变成了一个永恒不变的"Termianl"了,这可能并不是我们希望的,默认的显示用户名、主机名和当前工作路径(我比较喜欢这个默认的哈),我们可能希望把他配回来。其实配置标题栏和上面说过的配置提示符内容差不多,只是要加上:
\e]2;...\a
中间省略号就可以加我们想让标题栏显示的内容了。
例如我们把 "\e]2;This is my terminal:>\a" 加进PS1变量中(当然也需要用"\["和"\]"转义序列括起来),标题栏中就会显示  This is my terminal:>


个提示行将全部信息显示在标题栏上,而不是显示在终端上,终端对一行可以显示多少字符有限制。顺便提一句,确保用 "\[" 和 "\]" 将您的标题栏序列括起来(因为就终端而言,这个序列是非打印序列)。将大量信息放在标题栏中的问题是,如果您使用非图形终端(如系统控制台),则看不到这些信息。为了解决这个问题,可以在您的 .bashrc 中添加以下几行:
if [ "$TERM" = "linux" ]
then
#we're on the system console or maybe telnetting in
export PS1="\[\e[32;1m\]\u@\H > \[\e[0m\]"
else
#we're not on the console, assume an xterm
export PS1="\[\e]2;\u@\H \w\a\e[32;1m\]>\[\e[0m\] "
fi
这个 bash 条件语句将根据当前的终端设置动态设置提示行。为了获得一致性,您一定希望配置您的 ~/.bash_profile,以便它在启动时搜索 (source) 您的 ~/.bashrc。确保您的 ~/.bash_profile 文件中有以下这样一行:
source ~/.bashrc
这样,无论您开启一个登录 shell 还是一个非登录 shell,都会获得同样的提示行。
好了,您已掌握了提示行魔术。现在尽情享受一下,制作一个漂亮的彩色提示行吧



http://www.tuicool.com/articles/qeENNz
http://blog.csdn.net/signjing/article/details/8205785
linux ansi控制码

简介
ANSI控制码用于在字符显示系统中控制光标移动和字符色彩等,常用于BBS系统中。

ANSI ESCAPE SEQUENCES又称为VT100系列控制码,国内译为ANSI控制码。顾名思义,需要VT100系列终端的支持,当然现在已经不在局限于VT100了,包括xterm,linux都能很好完成。

ANSI控制码开始的标志都为ESC[,ESC对应ASCII码表的033(八进制),linux命令echo用-e启用转义,\033来输入ESC,\033[31m即为ESC[31m。  

格式
echo:-e 用来开启echo中的转义,\e 或 \033 来输出Esc符号

格式: echo -e "\033[字背景颜色;字体颜色m字符串\033[0m"

注意m后面紧跟字符串。

例如:

echo -e "\033[41;36m something here \033[0m"

其中41的位置代表底色, 36的位置是代表字的颜色

那些ascii code 是对颜色调用的始末

 \033[ ; m ......\033[0m



http://blog.chinaunix.net/uid-14358420-id-3408534.html

这样解析下bash版本的字串 "\e[s\e[0;$((COLUMNS-27))H$(date)\e[u" 。
\e[s  :保存光标位置
\e[0;$((COLUMNS-27))H  在终端第一行的倒数27个字符的位置开始打印字符
$(date)  打印date命令的输出
[u 恢复光标位置


http://www.4ucode.com/Study/Topic/1611190
\d :代表日期,格式为weekday month date,例如:"Mon Aug 1"
\H :完整的主机名称。例如:我的机器名称为:fc4.linux,则这个名称就是fc4.linux
\h :仅取主机的第一个名字,如上例,则为fc4,.linux则被省略
\t :显示时间为24小时格式,如:HH:MM:SS
\T :显示时间为12小时格式
\A :显示时间为24小时格式:HH:MM
\u :当前用户的账号名称
\v :BASH的版本信息
\w :完整的工作目录名称。家目录会以 ~代替
\W :利用basename取得工作目录名称,所以只会列出最后一个目录
\# :下达的第几个命令
\$ :提示字符,如果是root时,提示符为:# ,普通用户则为:$

    CentOS中关于这些:
\a     an ASCII bell character (07)
\d     the date in "Weekday Month Date" format (e.g., "Tue May
                     26")
\D{format} the format is passed to strftime(3) and the result is inserted into the prompt string; an empty format results in a locale-specific time representation. The braces are required
\e     an ASCII escape character (033)
\h     the hostname up to the first '.'
\H     the hostname
\j     the number of jobs currently managed by the shell
\l     the basename of the shell's terminal device name
\n     newline
\r     carriage return
\s     the name of the shell, the basename of $0 (the portion
                     following the final slash)
\t     the current time in 24-hour HH:MM:SS format
\T     the current time in 12-hour HH:MM:SS format
\@     the current time in 12-hour am/pm format
\A     the current time in 24-hour HH:MM format
\u     the username of the current user
\v     the version of bash (e.g., 2.00)
\V     the release of bash, version + patch level (e.g., 2.00.0)
\w     the current working directory, with $HOME abbreviated with a tilde
\W     the basename of the current working directory, with $HOME abbreviated with a tilde
\!     the history number of this command
\#     the command number of this command
\$     if the effective UID is 0, a #, otherwise a $
\nnn   the character corresponding to the octal number nnn
\\     a backslash
\[     begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt
\]     end a sequence of non-printing characters


    于是可以根据这些指定自己喜欢的命令提示符格式:

PS1="\u@\h:\w\$ " 
    但是这样设置之后显示的提示符是没有颜色的,如果希望加入颜色设置,可以这样:

PS1="\e[1;32m\u\e[m\e[1;33m@\e[m\e[1;35m\h\e[m:\w\$ " 
    此时,在终端中的显示应该是彩色的提示符了,其中的\e[1;xxm和\e[m就是改变终端字体颜色的部分,前者是修改颜色,后者是恢复到正常显示。但是 这时还会有问题,在提示符中输入第一行时,回车换行不正常,导致显示很混乱,因此,除了这个修改之外,还需要将全部非打印字符用专用的 bash 转义序列 "\[" 和 "\]" 括起来。这两个序列通知 bash,被括起来的字符不占用行上的任何空间 ,这样就使自动换行能够继续正常工作。最终版本如下(可解决带颜色提示符的不换行问题):

PS1="\[ \e[1;32m\] \u\[ \e[m\] \[ \e[1;33m\] @\[ \e[m\]\[ \e[1;35m\] \h\[ \e[m\] :\w\$ "

--EOF--

FastDomain修改Primary Domain

几年前的春节值班,无聊之下在now.cn注册了guduo.net,而后好久才又到FastDomain成功注册和购买主机空间,再后来就是把guduo.net迁移到FastDomain。

一直以来,Primary Domain都是yimutian.net,guduo.net是作为Addon Domain来管理。但几年下来,都是使用的guduo.net的域名,yimutian.net的域名没有使用,暂时也没有继续使用的计划,所以也就想把guduo.net作为Primary Domain进行管理了。

通过查询FastDomain的帮助文档,很方便的找到了相关信息:
How to change the Primary Domain

https://my.fastdomain.com/cgi/help/345

What to do before renaming your account

  1. The rename Process normally takes from 20 minutes to 5 hours, depending on the size of the account.

  2. The domain you are changing to must be associated with the account first.

  3. The current main domain can never become the main domain again.

  4. The current account's username, password, files, databases and e-mails will remain unchanged.

  5. The new primary domain will point to the public_html directory itself, the same way the main domain does currently.

  6. The website files may need to be moved into the public_html directory and out of the public_html directory, to correspond with the new primary domain and assignment of the old primary domain to a subfolder. 
    Please note that this will be your responsibility to do, and may cause some site files, scripts or other applications to break, requiring modification to work with the new site location.

  7. Custom DNS entries will be deleted for both domains involved in this change and will need to be recreated after the rename is complete.

  8. If you have an SSL certificate, please note it will only work for the main domain; if the SSL was purchased through our cPanel, it will automatically be revoked for the original domain, and re-assigned to the new primary domain. 
    Note: This most often will only take a few minutes, but could take up to a few hours.

  9. Although renaming an account should not move or delete any files on the account, we do recommend creating/downloading a backup of all files and databases prior to requesting the rename. Please Click Here for information about creating and downloading backups.

  10. The new primary domain must be registered to you. If needed, you may register new domains for $13.99 each, per year, via the Domain Manager in the cPanel.

修改之后呢,之前用子目录管理的guduo.net没法访问了,再找资料:
How to host the Primary Domain from a subfolder (.htaccess)
https://my.fastdomain.com/cgi/help/347

You will want to insert the following code block and make modifications as noted in the (#) comments. You will need to change the two instances of example.com to your domain, and the three instances of subdirectory to the folder where you want your site.

# FastDomain.com
# .htaccess main domain to subdirectory redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line.
RewriteEngine on
# Change example.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/subdirectory/
# Don't change these line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /subdirectory/$1
# Change example.com to be your main domain again.
# Change 'subdirectory' to be the directory you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ subdirectory/index.html [L]

Visitors to your Web site will not be able to tell that your main domain is using a subdirectory, they will still see the Web site address as http://www.example.com/page.html.

Note: This will not work with some website software. You will also need to modify the $base_url$live_site or other configuration settings in those to finish the process.


原来是通过.htaccess来做Rewrite

后面的事情,那就是重新好好维护这个域名和空间了。

最近一直有弄一个VPS的冲动,忍住!

http://www.ramhost.us/?page=virtual-dedicated-server

--EOF--

SSH帐号恢复,备份升级完成

1.FastDomain的工作人员的效率还是非常高,提交Ticket之后几分钟就收到了QQ Mail中的回信。
2.备份,升级过程非常顺利,实际只是升级MT的Professional Pack。
3.简单修改了一下模板,将评论部分去掉了。
4.针对类目的模版页,本来想修改一下,将默认的最近10个Post扩大一下,但发现这个和首页好像也是使用同一个变量,还是算了。

--EOF--

FastDomain shell帐号被无故关闭

好久没ssh进去了,今天准备做数据备份和做MT5.04 升级却发现无法登录,相关信息如下:

Your shell account is NOT enabled.

Please FAX the following message to +1 (801) 765-1992:

=====================================================
From: xxx@xxx.com
Subject: ENABLE SHELL xxx@guduo.net

+-------------------------+
|                         |
|                         |
|   BLOW UP OF PHOTO ID   |
|                         |
|                         |
+-------------------------+


Or, submit a ticket to our helpdesk at:
http://helpdesk.fastdomain.com/

Or scan and send your PHOTO ID as an email attachment.

现在都感觉有些担心了?为啥需要我提供这个信息?

不过比较奇怪的一点是,plink居然还是可以正常访问做ssh tunnel的。

--EOF--

FastDomain后续的使用想法:Dedicated IP

和FastDomain的多个客服线上确认,即使购买了Dedicated IP,也无法更改SSHD的访问端口,而对于我来说,这个东西实际上还是很重要的。

但经过前几天的一些探索,有了另外一个想法,直接使用ssh提供的Port Forward功能或许可以达到类似的效果,前提当然是能让我绑定很多其它端口了:)

 

https://www.fastdomain.com/cgi/dedicated_ip

 

What is a Dedicated IP Address?
An IP address is a number like 234.123.66.7 that identifies the unique server where your website can be found. In shared hosting, you share the same IP address as other web sites on your server. By upgrading to a Dedicated IP address, you can enable your site for e-commerce and other advanced capabilities, and minimize the risk of being impacted by other sites on your shared server.


Top Reasons to get a Dedicated IP:
So you can enable SSL on your web site - SSL Certificates are crucial if you have a business oriented website, especially if you want to accept secure transactions like credit card payments or sending personal information through your site. Secure SSL Certificates require your site to have a Dedicated IP in order to work.
Ability to run more software on your server - Certain programs require a dedicated IP address before they can be setup and used. With a dedicated IP you will have more options on the type of scripts you can run.
Ability to open non-standard ports - Purchasing a dedicated IP will allow us to grant you access to additional ports you may need to run special services on that are blocked for shared IPs.
So you won't be negatively impacted by the actions of others - On a shared IP, if someone else sharing your same IP happens to get blocked by IP or censored, as some countries or ISPs sometimes do. Their IP (and yours) could get banned or blacklisted, causing problems for your web site or search engine rankings.
Your website may perform better in the search engines - Although difficult to prove, many people believe that sites with a dedicated IP address rank better in the search engine results than those utilizing shared IP addresses.
You can view your web site by typing its IP address - This is handy for situations where you want to access your site, but your domain name is inaccessible, such as during domain name propagation periods.

Only $2.50 per month ($30.00 per year)*

--EOF--

ssh local port forwarding

1.公司只提供23 443 80 端口访问

2.FastDomain主机只提供22端口ssh访问

 

1.路由器设置端口转发: 443 -> 192.168.1.1:1080

2.路由器运行:ssh -N -g -L 1080:guduo.net:22 xxx@guduo.net

   转发所有访问路由器1080端口的请求到guduo.net的22端口

   ssh访问路由器1080端口时,实际就是访问guduo.net的22端口,可以看putty访问示例日志:

login as: xxx
xxx@192.168.1.1's password:
Last login: Fri Dec 25 08:07:06 2009 from fast22.fastdomain.com

[xxx@fast22 /home/xxx]
$

3.本地通过plink连接路由器再连接FastDomain建立代理访问:

d:\green_soft\putty\plink.exe -N xxx@路由器WAN -P 443 -pw "xxx_pw" -D 127.0.0.1:1080

 

如果我在FastDomain购买了Dedicated IP,是否可以通过

ssh -N -g -L 8000:localhost:22 xxx@localhost 来直接开启一个8000端口的ssh服务呢?

 

路由器上测试:


~ # ssh -N -g -L 1080:192.168.1.1:80 root@192.168.1.1
root@192.168.1.1's password:

将1080也直接指向httpd的80服务~

 

ssh -N -g -L 1080:guduo.net:22 xxx@guduo.net
所有对本地的1080端口的访问都通过guduo.net被转发到guduo.net的22端口
ssh -N -g -L 1080:guduo.net:22 root@127.0.0.1
所有对本地的1080端口的访问都通过127.0.0.1被转发到guduo.net的22端口

 

zz From http://zhigang.org/wiki/SSH

本地映射(Local Forward)
$ ssh -f -g -A -X -N -T -L 1234:remote-host2:5678 user@remote-host或者通过修改ssh的配置文件:
$ cat ~/.ssh/config
Host remote-host
     Hostname x.x.x.x (your remote host IP)
     LocalForward 1234:remote-host2:5678
     User user
$ ssh user@remote-host所有对本地1234端口的访问都通过remote-host被转发到remote-host2的5678端口。有些DMZ中只开放sshd的22端口,通过本地映射,你可以访问远程计算机上的所有服务

 

--EOF--

ssh server dropbear 测试失败

dropbear -w -F -E -p 8000 -P /home/xxx/sshd/dropbear_sshd.pid  -d /home/xxx/sshd/dropbear_dss_host_key -r /home/xxx/sshd/dropbear_rsa_host_key

 

dropbearkey -t rsa -f dropbear_rsa_host_key -s 1024
dropbearkey -t dss -f dropbear_dss_host_key -s 1024


ssh xxx@127.0.0.1 -p 8000
chsh --list-shells
chsh -s /bin/sh yimutian

 

$ chsh -s /bin/sh xxx
Changing shell for xx.
Password:


[25376] Dec 19 05:56:32 Child connection from ::ffff:127.0.0.1:58456
[25376] Dec 19 05:56:38 user 'xxx' has invalid shell, rejected

 

From FastDomain Support:

1.Can't Change Login Shell

2.Can't Change sshd port

3.What Can I Do ?

--EOF--

VPS vs Dedicated IP Address(ssh)

最新IP列表:

inet addr:74.220.199.22  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:70.40.192.43  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.192.52  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:74.220.199.100  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.107  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.113  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.123  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.180  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.185  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.200  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.209  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.231  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.246  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.249  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.55  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.56  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.74  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.75  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.81  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.87  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:74.220.199.99  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:70.40.192.91  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.192.112  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.192.158  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.193.241  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.193.79  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.193.157  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.192.53  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.192.181  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.193.226  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.192.82  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:70.40.192.59  Bcast:70.40.193.255  Mask:255.255.254.0
inet addr:74.220.199.76  Bcast:74.220.199.255  Mask:255.255.255.0
inet addr:70.40.193.95  Bcast:70.40.193.255  Mask:255.255.254.0

 

FastDomain提供的Decicated IP 2.5$/Month。

 

看看现在VPS的价格:

Xen 6$/Mon

rashost 68¥/Mon

不过目前来说FastDomain的服务我基本够用,在SD还在正常提供服务的情况下~

linode是另外一个VPS,价格稍贵。

 

--EOF--

Google 企业应用套件 试用

之前不知道什么时候绑定过guduo.net到google app,前几天再去的时候怎么也不知道密码是啥了,无奈之下不知道怎么找到了google 客服 -- 当然是邮件支持。

前天给我邮件了,重新放上去一个认证文件,然后重置了密码,爽!

目前主要测试了邮件的功能,有一下几点:

1)联系fastdomain,提交了CNAME的修改,How Do I Change DNS Settings for My MX, C NAME, A RECORD, etc ,前几天收到了回复,提交了几个子域名如mail.guduo.net到fastdomain,今天就给我回邮件说搞好了。

2)修改fastdomain的MX记录

3)测试邮件

之前mail.guduo.net修改MX设置未生效时,直接从qqmail发送邮件被退回:

无法发送到<xx at guduo.net>, 原因是:connect to guduo.net[74.220.199.22]: Connection timed out (port 25).

4)修改MX并生效后,邮件已经可以正常收到!

 

查询MX记录:

$ nslookup
> set type=mx
> guduo.net
Server:         74.220.195.41
Address:        74.220.195.41#53

Non-authoritative answer:
guduo.net       mail exchanger = 10 aspmx.l.google.com.
guduo.net       mail exchanger = 20 alt1.aspmx.l.google.com.
guduo.net       mail exchanger = 30 aspmx3.googlemail.com.

Authoritative answers can be found from:
guduo.net       nameserver = ns2.fastdomain.com.
guduo.net       nameserver = ns1.fastdomain.com.
aspmx.l.google.com      internet address = 209.85.201.27
aspmx.l.google.com      internet address = 209.85.201.114
alt1.aspmx.l.google.com internet address = 66.249.91.27
aspmx3.googlemail.com   internet address = 209.85.199.27
ns1.fastdomain.com      internet address = 74.220.195.221
ns2.fastdomain.com      internet address = 69.89.22.4

 

$ dig -t MX guduo.net

; <<>> DiG 9.2.4 <<>> -t MX guduo.net
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49289
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 2, ADDITIONAL: 6

;; QUESTION SECTION:
;guduo.net.                     IN      MX

;; ANSWER SECTION:
guduo.net.              13908   IN      MX      30 aspmx3.googlemail.com.
guduo.net.              13908   IN      MX      10 aspmx.l.google.com.
guduo.net.              13908   IN      MX      20 alt1.aspmx.l.google.com.

;; AUTHORITY SECTION:
guduo.net.              85609   IN      NS      ns1.fastdomain.com.
guduo.net.              85609   IN      NS      ns2.fastdomain.com.

;; ADDITIONAL SECTION:
aspmx.l.google.com.     212     IN      A       209.85.201.114
aspmx.l.google.com.     212     IN      A       209.85.201.27
alt1.aspmx.l.google.com. 284    IN      A       66.249.91.27
aspmx3.googlemail.com.  3125    IN      A       209.85.199.27
ns1.fastdomain.com.     171481  IN      A       74.220.195.221
ns2.fastdomain.com.     171481  IN      A       69.89.22.4

;; Query time: 0 msec
;; SERVER: 74.220.195.41#53(74.220.195.41)
;; WHEN: Sat Jan 10 18:47:07 2009
;; MSG SIZE  rcvd: 259

 

--EOF--

2  

Pages

March 2025

Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Find recent content on the main index or look in the archives to find all content.