Press "Enter" to skip to content

Month: March 2016

配置Xmanager连接Ubuntu 14.04远程桌面

Xmanager默认使用XDMCP协议连接远程桌面, 因此这里我们需要启用XDMCP协议.

$ sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
[SeatDefaults]
user-session=mate     #将其改为mate, 并添加如下几行
allow-guest=false
greeter-show-manual-login=true
greeter-hide-users=true

[XDMCPServer]
enabled=true


$ sudo service lightdm restart

$ netstat -anp  |grep :177     #确保UDP的177端口启动成功(XDMCP使用UDP 177端口)
udp        0      0 0.0.0.0:177             0.0.0.0:*                           -               
udp6       0      0 :::177                  :::* 

接下来是安装mate桌面

$ sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
$ sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate
$ sudo apt-get update

mate官方WIKI针对Ubuntu 14.04给出了三种安装方式

$ sudo apt-get install mate-desktop-environment-core   #安装一个最小化的mate桌面
$ sudo apt-get install mate-desktop-environment        #安装一个完整的mate桌面
$ sudo apt-get install mate-desktop-environment-extras #安装一个完整的mate桌面(包含推荐的软件包)

本文这里使用了第一种方式安装.

然后就可以在Xmanager里输入IP地址, 方法选择”XDMCP Query”即可连接.

2 Comments

Linux系统安装obfuscated-openssh

1,安装obfuscated-openssh server

obfuscated-openssh可以代替系统的OpenSSH服务,如果在安装过程中不指定–prefix选项,它将替换系统openssh-server的二进制程序和配置文件. 本文指定了安装目录,并不会与系统自带的openssh服务冲突.

yum install zlib openssl                     #适用Redhat/CentOS系统
sudo apt-get install zlib1g-dev libssl-dev   #适用Ubuntu系统

wget -O ofcssh.tar.gz https://github.com/brl/obfuscated-openssh/tarball/master

tar zxvf ofcssh.tar.gz

cd brl-obfuscated-openssh-ca93a2c/

./configure --prefix=/usr/local/obfus  #如果遇到错误请参考下文处理方法
make
make install

sed -i "s/Port /#Port /g" /usr/local/obfus/etc/sshd_config      #22端口被正常的SSH服务使用,这里不需要
sed -i "s/UsePAM /#UsePAM /g" /usr/local/obfus/etc/sshd_config  #obfuscated-openssh不支持UsePAM选项
echo "ObfuscatedPort 32" >> /usr/local/obfus/etc/sshd_config              #指定监听端口
echo "ObfuscateKeyword fuckthegfw" >>  /usr/local/obfus/etc/sshd_config   #指定混淆密钥

运行:
/usr/local/obfus/sbin/sshd -f /usr/local/obfus/etc/sshd_config &


设置开机自启(写入/etc/rc.local)
echo 'nohup /usr/local/obfus/sbin/sshd -f /usr/local/obfus/etc/sshd_config >> /var/log/obfus.log 2>&1 &' >> /etc/rc.local
Leave a Comment

获取China大陆IP段的范围

这里有几个网站提供了大陆的IP段范围。别问我要这个列表干什么,我也不知道。

http://www.ip2location.com/blockvisitorsbycountry.aspx
老牌网站,国内很多人应该都知道,可以选择任意一个国家的IP段,然后可以输出多种格式。

https://www.countryipblocks.net/country_selection.php
跟上面的那个一样,多一个备份。

http://www.ipdeny.com/ipblocks/
一样是列出了所有国家的IP段文件,提供下载。

1 Comment

删除文件以后,XFS分区的可用容量并未增加?

今天接到一同事报告,在分区里删除了一些大体积文件以后,使用df -hT看到该分区的Avail容量并未增加。我的第一反应就是肯定是XFS文件搞的鬼!经过谷歌以后证明了确实是XFS文件系统的问题。

XFS is designed to support highly parallel operation and massive dynamically expanding file system sizes. Both are supported by dynamic allocation of inodes.

XFS被设计为支持高度并行运算和海量动态扩展文件系统大小。两者都是由inode的动态分配支持。

XFS dynamically allocates space for inodes as they are created, this is different from many other filesystems where inode space is statically allocated at mkfs time. While inode space is dynamically allocated, it is never freed – up until now that is.

When ikeep is specified, XFS does not delete empty inode clusters and keeps them around on disk. When noikeep is specified, empty inode clusters are returned to the free space pool.

Leave a Comment