易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux客户端使用SSH的命令管理linux服务器






<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
TD P { margin-bottom: 0cm }
A:link { so-language: zxx }
-->
登陆:ssh [hostname] 
输入密码:*****

陆以后就可以像控制自己的机器一样控制它了,不过没有可视化的界面。不过现在
我所使用过的两个版本Linux(SUSE
和FC5)
中有可以使用类似FTP
界面的工具。使用工具连接时,选择SSH
,端口是填服务器的SSH
端口,默认是22
,但是还是要手工填写。连接上以后FTP
界面和shell
同时使用可以
提高工作效率。

# visudo
%wheel ALL=(ALL) ALL
# gpasswd -a user1 wheel
4)
限制 ssh

使用者名单
# vi /etc/pam.d/sshd
auth required
pam_listfile.so item=user sense=allow file=/etc/ssh_users ōnerr=fail
# echo user1 >>
/etc/ssh_users
5)
封锁 ssh

联机并改用 web
控管清单
# iptables -I INPUT -p tcp
--dport 22 -j DROP
# mkdir
/var/www/html/ssh_open
# cat >
/var/www/html/ssh_open/.htaccess < AuthName "ssh_open"
AuthUserFile
/var/www/html/ssh_open/.htpasswd
AuthType basic
require valid-user
END
# htpasswd -c
/var/www/html/ssh_open/.htpasswd user1
(
最好还将 SSL

设起来,
或只限
https
联机更佳,

我这里略过 SSL
设定,

请读者自补.)
(
如需控制联机来源,

那请再补 Allow/Deny

项目,
也请读者自补.)
# cat >
/var/www/html/ssh_open/ssh_open.php < //Set dir path for ip list
$dir_path=".";
//Set filename for ip list
$ip_list="ssh_open.txt";
//Get client ip
$user_ip=$_SERVER['REMOTE_ADDR'];
//allow specifying ip if
needed
if (@$_GET['myip']) {
$user_ip=$_GET['myip'];
}
//checking IP format
if
($user_ip==long2ip(ip2long($user_ip))) {
//Put client ip to a file
if(@!($file =
fopen("$dir_path/$ip_list","w+")))
{
echo "Permission
denied!!
";
echo "Pls Check your
rights to dir $dir_path or file $ip_list";
}
else
{
fputs($file,"$user_ip");
fclose($file);
echo "client
ip($user_ip) has put into $dir_path/$ip_list&quo


相关文档:

Linux iptable文档

总览
用iptables -ADC 来指定链的规

,-A添加 -D删除 -C 修改
iptables - [RI] chain rule num rule-specification[option]
用iptables - RI 通过规则的顺序指定
iptables -D chain rule num[option]
删除指定规则
iptables -[LFZ] [chain][option]
用iptables -LFZ 链名 [选项]
iptables -[NX] chain
用 -NX ......

linux 设置固定IP


一、使用命令设置ubuntu的ip地址
1.修改配置文件blacklist.conf禁用IPV6:
sudo vi /etc/modprobe.d/blacklist.conf
2.在文档最后添加 blacklist ipv6,然后查看修改结果:
cat /etc/modprobe.d/blacklist.conf
3.设置IP(设置网卡eth0的IP地址和子网掩码)
sudo ifconfig eth0 192.168.2.1 netmask 255.255.255.0 ......

在LINUX环境下用nat方式上网与五笔安装

在win主机上用ipconfig查看VMnet8的IP地址,
一般是192.168.X.1/255.255.255.0,
此时VMnet8的设置应该是自动获取IP,现在改成静态IP,并把此IP直接填入VMnet8里,不设网关。 
同时在VM网络设置里的NAT项中查看VMnet8,一般是192.168.X.2/255.255.255.0
这个地址就是VMnet8,NAT的网关 
现在在LINUX下把网卡I ......

Linux中的SSH终端乱码问题的解决

1.vi /etc/sysconfig/i18n
将内容改为
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16
这样中文在SSH,telnet终端就可以正常显示了。
2.安安装Linux的时候选择的是中文字,但是使用的时候出现了乱码解决方法是 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号