--EOF--
Results tagged “socks”
--EOF--
--EOF--
--EOF--
--EOF--
和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
zz From http://zhigang.org/wiki/SSH
目录
通过ssh建立安全隧道(ssh tunnelling,也称端口映射,Port Forwarding)
本地映射(Local Forward)
远程映射(Remote Forward)
公钥认证
配置ssh使用代理服务器,穿越企业防火墙
加快SSH连接速度方法
使用expect实现ssh自动交互
SSH保持连接(KeepAlive)
参考资料
本章记录了自己在使用SSH的过程中遇到的一些问题,及其解决方法。
通过ssh建立安全隧道(ssh tunnelling,也称端口映射,Port Forwarding)
通过ssh的端口映射功能可以方便地存取一下无法直接访问的资源。又分为本地映射(Local Forward)和远程映射(Remote Forward)。
本地映射(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端口,通过本地映射,你可以访问远程计算机上的所有服务。
远程映射(Remote Forward)
$ ssh -f -g -A -X -N -T -R 1234:remote-host2:5678 user@remote-host或者通过修改ssh的配置文件:
$ cat ~/.ssh/config
Host remote-host
Hostname x.x.x.x (your remote host IP)
RemoteForward 1234:remote-host2:5678
User user
$ ssh user@remote-host所有对remote-host的1234端口的访问都通过本机被转发到remote-host2的5678端口。通过远程映射,你可以通过家中的机子(有公网IP,可以ssh登录)来访问公司防火墙内部的计算机。
公钥认证
使用公钥认证经常遇到的问题就是一些文件的权限问题。一些问题可以通过查看/var/log/secure来发现。
要配置两台计算机使用公钥认证,可以通过分别在两台机子host1、host2上运行如下脚本:
$ ssh-keygen -t rsa -b 1024 # don't input any password
$ ssh $host1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh $host2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys # important!
配置ssh使用代理服务器,穿越企业防火墙
通过 http://zippo.taiyo.co.jp/~gotoh/ssh/connect.html 下载connect.c,编译,拷贝到系统/usr/bin目录:
$ gcc connect.c -o connect
$ sudo cp connect /usr/bin编辑ssh的配置文件~/.ssh/config,增加:
$ cat ~/.ssh/config
Host remote-host
ProxyCommand connect -H your.proxy.com:port %h %p
$ ssh user@remote-host
加快SSH连接速度方法
SSH登录时会进行DNS反查,如果你的DNS Server速度比较慢,会发生等待。知道了原因解决方法就出来了:就是提高域名解析的速度。可以将主机名写到/etc/hosts中来解决。
使用expect实现ssh自动交互
下面是使用expect实现的自动远端命令执行的脚本remote-exec:
# \
exec expect -- "$0" ${1+"$@"}
# remote-exec - execute command on remote host
# Version 0.1
# Zhigang Wang <zhigang.x.wang@oracle.com>
exp_version -exit 5.0
if {$argc!=2} {
send_user "usage: remote-exec command password\n"
send_user "Eg. remote-exec \"ssh user@host ls\\; echo done\" password\n"
send_user "or: remote-exec \"scp /local-file user@host:/remote-file\" password\n"
send_user "or: remote-exec \"scp user@host:/remote-file local-file\" password\n"
send_user "or: remote-exec \"rsync --rsh=ssh /local-file user@host:/remote-file\" password\n"
send_user "Caution: command should be quoted.\n"
exit
}
set cmd [lindex $argv 0]
set password [lindex $argv 1]
eval spawn $cmd
set timeout 120
while {1} {
expect -re "Are you sure you want to continue connecting (yes/no)?" {
# First connect, no public key in ~/.ssh/known_hosts
send "yes\r"
} -re "assword:" {
# Already has public key in ~/.ssh/known_hosts
send "$password\r"
} -re "Permission denied, please try again." {
# Password not correct
exit
} -re "kB/s|MB/s" {
# User equivalence already established, no password is necessary
set timeout -1
} -re "file list ..." {
# rsync started
set timeout -1
} -re "bind: Address already in use" {
# For local or remote port forwarding
set timeout -1
} -re "Is a directory|No such file or directory" {
exit
} -re "Connection refused" {
exit
} timeout {
exit
} eof {
exit
}
}
SSH保持连接(KeepAlive)
可以使用下面的方法:
增加下面的内容到~/.ssh/config或者/etc/ssh/ssh_config:
Host *
ServerAliveInterval 60 # in second执行下面的脚本:
while date; do sleep 10; done当要输入命令时,只需要按下ctrl-c.
参考资料
OpenSSH official site.
OpenSSH Manual Pages.
The Secure Shell(tm) Frequently Asked Questions.
SSH Tunnelling (Port Forwarding).
SSH Port Forwarding.
SSH Proxy Command -- connect.c.
Corkscrew -- tool for tunneling SSH through HTTP proxies.
SSH Host Key Protection.
SSH and ssh-agent.
The Expect Home Page.
Pexpect - a Pure Python Expect-like module.
--EOF--
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--
编译安装:
socks proxy:
ss5
antinat-0.90 依赖 expat-2.0.1
ssh server:
dropbear-0.52
lsh-2.0 依赖 liboop-1.0
注意使用编译选项:
./configure CPPFLAGS="-I/path/to/expat/include" LDFLAGS="-L/path/to/expat/lib" --prefix=xxx
--EOF--
zz From http://en.wikipedia.org/wiki/Comparison_of_SSH_servers
Comparison of SSH servers
From Wikipedia, the free encyclopedia
|
This article is incomplete and may require expansion or cleanup. Please help to improve the article, or discuss the issue on the talk page. |
SSH servers is a software program which uses the secure shell protocol to accept connections from remote computers. This article compares a selection of popular servers.
Contents[hide] |
[edit] General
Name ![]() |
Developer ![]() |
Status ![]() |
Date of first release ![]() |
Last release ![]() |
Date of last release ![]() |
License ![]() |
Official web page ![]() |
---|---|---|---|---|---|---|---|
CopSSH | Itefix | Active | 2009-01-16 | 3.0.1 | 2009-10-12 | BSD | CopSSH |
Dropbear | Matt Johnston | Active | 2003-04-06 [1] | 0.52 | 2008-11-12 | MIT | Dropbear |
F-Secure SSH Server | F-Secure | ? | 2004? | commercial | |||
freeSSHD | Kresimir Petri | ? | 1.2.6 | 2009-??-?? | ? | [1] | |
KpyM | KpyM | Active | 1.18 | 2009-08-01 [2] | BSD | [2] | |
lsh | Niels Möller | Active | 1999-05-23 [3] | 2.9-exp | 2007-04-04 | GPL | LSH |
OpenSSH | The OpenBSD project | Active | 1999-12-01 | 5.3 | 2009-10-01[4] | BSD | OpenSSH |
Reflection for Secure IT | Attachmate | Active | 7.1 | commercial | [3] | ||
Tectia | SSH Communications Security | Active | 1995 | 6.1 | commercial | SSH Communications Security | |
VShell server | VanDyke Software, Inc. | Active | 1995 | 3.6 | 2009-12-10 | commercial | VanDyke VShell |
[edit] Platform
The operating systems or virtual machines the SSH servers are designed to run on without emulation; there are several possibilities:
- No indicates that it does not exist or was never released.
- Partial indicates that while it works, the server lacks important functionality compared to versions for other OSs but may still be under development.
- Beta indicates that while a version is fully functional and has been released, it is still in development (e.g. for stability).
- Yes indicates that it has been officially released in a fully functional, stable version.
- Dropped indicates that while the server works, new versions are no longer being released for the indicated OS; the number in parentheses is the last known stable version which was officially released for that OS.
- Included indicates that the server comes pre-packaged with or has been integrated into the operating system.
The list is not exhaustive, but rather reflects the most common platforms today.
Name ![]() |
Mac OS X ![]() |
Mac OS Classic ![]() |
Windows ![]() |
Cygwin ![]() |
BSD ![]() |
Linux ![]() |
Solaris ![]() |
Palm OS ![]() |
Java ![]() |
OpenVMS ![]() |
Windows Mobile ![]() |
IBM z/OS ![]() |
AmigaOS ![]() |
AIX ![]() |
HPUX ![]() |
iPhone† / iPod Touch ![]() |
WebOS ![]() |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CopSSH | No | No | Yes | Yes | No | No | No | No | No | No | No | No | No | No | No | No | No |
Dropbear | Yes | No | No | Yes | Yes | Yes | Yes | No | No | No | No | No | No | No | No | No | Yes† |
lsh | Yes | No | No | No | Partial† | Yes | Yes | No | No | No | No | No | No | No | No | No | No |
OpenSSH | included | No | Yes† | included | included | included † | Yes | No | No | Yes | No | Yes | Yes | Yes† | Yes | Yes† | Yes† |
KpyM | No | No | Yes | No | No | No | No | No | No | No | No | No | No | No | No | No | No |
freesshd | No | No | Yes | No | No | No | No | No | No | No | No | No | No | No | No | No | No |
- ^ lsh supports only one BSD platform officially, FreeBSD.[citation needed]
- ^ The majority of Linux distributions have OpenSSH as an official package, but a few do not.
- ^ Openssh 3.4 was the first release included since AIX[citation needed]
- ^ Unless otherwise noted, iPhone refers to non-jailbroken devices.
- ^ [4]
- ^ Only for jailbroken devices.
- ^ OpenSSH and Dropbear are available as optware packages installed by PreWare (maintained by WebOS-Internals.org)
[edit] Features
Name ![]() |
SSH1 ![]() |
SSH2 ![]() |
Port forwarding ![]() |
SFTP ![]() |
SCP ![]() |
Compatible with OpenSSH authorized keys ![]() |
Privilege separation ![]() |
---|---|---|---|---|---|---|---|
CopSSH | Yes | Yes | Yes | Yes | Yes | Yes | Yes[5] |
Dropbear (software) | No | Yes | Yes | No | No[6] | Yes | ?? |
Lsh | No | Yes | Yes | Yes | Yes | ?? | ?? |
OpenSSH | Yes | Yes | Yes | Yes | Yes | Yes | Yes[7] |
[edit] See also
[edit] References
- ^ Changes in Dropbear in official web page
- ^ Changes in the official web page
- ^ Archive of lsh releases in official web page
- ^ OpenBSD changes in official web page
- ^ sshd_config(5) manual page 2008-04-05. Retrieved on 2008-04-27.
- ^ Dropbear page in nslu2-linux.org
- ^ sshd_config(5) manual page 2008-04-05. Retrieved on 2008-04-27.
--EOF--