SSH Chroot jails

为了不给各种仅使用ssh tunnel的人访问vps的信息,把SSH的chroot jail配好了。

准备工作

假定Chroot根目录为 /var/jail, 定义为

添加用户组

配置sshd_config

修改 /etc/ssh/sshd_config 添加下列配置

创建Jail

其实不创建也行,客户端ssh时开-N就好

添加用户

SSH Chroot jails by @sskaje: https://sskaje.me/2015/05/ssh-chroot-jails/

英文OSX Terminal SSH无法输入中文

新电脑系统用了英文。
安装了两台debian 7的开发机,SSH上去之后发现Bash下中文输入不了,输入完成后Terminal会闪一下,输入不成功,但是vim里可以。
对比其他的VPS、服务器,CentOS,Ubuntu都一切正常。

为了排除字体,locale的可能,把中文字体装了,中文的locale也全加上了,依旧输入不了。

直到我想到这篇文章,然后退出SSH,本地看了眼这个session下的locale

执行

就好了

英文OSX Terminal SSH无法输入中文 by @sskaje: https://sskaje.me/2015/04/%e8%8b%b1%e6%96%87osx-terminal-ssh%e6%97%a0%e6%b3%95%e8%be%93%e5%85%a5%e4%b8%ad%e6%96%87/

Incoming search terms:

ssh_exchange_identification: Connection closed by remote host

Google tells me that I am blocked because of something like /etc/hosts.deny or some other reason, I did everything but problem remains there.

Until I checked the audit.log and found there many attempts of ssh login.

So I add ListenAddress line in /etc/ssh/sshd_config, everything works well now.
This is because I have an local IP address like 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, but if I only have a public IP, I may choose to change ssh running at another port.

ssh_exchange_identification: Connection closed by remote host by @sskaje: https://sskaje.me/2014/05/ssh_exchange_identification-connection-closed-remote-host/