来源:http://blog.csdn.net/u010355144/article/details/45541107php
命令行方式:telnet,ssh(客户端能够用putty、SecureCRT、SSH Secure Shell Client等SSH 客户端软件,输入您服务器的IP地址,而且输入登陆的用户和密码就能够登陆了。我常选择的客户端软件是putty。)html
图像用户界面:vnc,node
1.ubuntu 下telnet服务安装配置 另参见具体设置linux
下面咱们来对Ubuntu Linux telnet的安装和设置进行一下讲解。首先咱们须要加载telnet的服务,以后对于root等有关方面进行设置。c++
在Windows系统中,telnet的配置相对简单一些。ubuntu
那么在Ubuntu Linux中的telnet的设置就相对比较麻烦了。很多朋友都对这个安装过程不熟悉。没有关系,这里咱们就来对Ubuntu Linux telnet的安装设置进行一下讲解。vim
1. sudo apt-get install xinetd telnetdwindows
2. Ubuntu Linux telnet安装后,系统也会有相应提示:安全
sudo vi /etc/inetd.conf并加入如下一行(没有这个文件就会新建一个,不要紧的,下同)服务器
telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd
3. sudo vi /etc/xinetd.conf并加入如下内容进行下一步的Ubuntu Linux telnet设置:
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/
defaults
{
# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info
instances = 60
log_type = SYSLOG authpriv
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30
}
includedir /etc/xinetd.d
4. sudo vi /etc/xinetd.d/telnet并加入如下内容:
# default: on
# description: The telnet server serves telnet sessions; it uses
# unencrypted username/password pairs for authentication.
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
5. 重启机器或重启网络服务sudo /etc/init.d/xinetd restart
6. 使用telnet客户端远程登陆便可进行非root用户访问.
7.使用root登陆:
mv /etc/securetty /etc/securetty.bak 这样root能够登陆了.也可这样:
修改/etc/pam.d/login这个文件.只需将下面一行注释掉便可.
#auth required lib/security/pam_securetty.so
8. Ubuntu Linux telnet的详细配制/etc/xinetd.d/telnet
编辑推荐
TCP/IP协议专题
TCP/IP(传输入控制地议/网际协议)是一种网络通讯协议,它规范了网络上的全部通讯设备,尤为是一个主机与..
文章摘要:下面咱们来对Ubuntu Linux telnet的安装和设置进行一下讲解。首先咱们须要加载telnet的服务,以后对于root等有关方面进行设置。
service telnet
{
disable =no
bind =192.168.1.2
only_from=192.168.1.0/24
#上面这两行说明仅提供内部网段!
Instance =UNLIMITED
Nice =0
Flags =REUSE
socket_type=stream
wait =no
user =root
#server =/usr/sbin/telnetd
server =/usr/sbin/in.telnetd
server_args =-a none
log_on_failure +=USERID
}
service telnet
{
disable =no
bind =140.116.142.196
only_from=140.116.0.0/16
no_access=140.116.32.
#上面三行设置外部较为严格的限制
instance =10
umask =022
nice =10
flags =REUSE
socket_type=stream
wait =no
user =root
#server =/usr/sbin/telnetd
server =/usr/sbin/in.telnetd
log_on_failure +=USERID
}
9.加设防火墙iptables:
若是想要针对192.168.0.0/24这个网段及61.xxx.xxx.xxx这个IP进行telnet开放,能够增长下面几行规则:
/sbin/iptables -A INPUT -p tcp -i eth0 -s 192.168.0.0/24 --dport 23 -j ACCEPT
/sbin/iptables -A INPUT -p tcp -i eth0 -s 61.xxx.xxx.xxx --dport 23 -j ACCEPT
/sbin/iptables -A INPUT -p tcp -i eth0 --dport 23 -j DROP
10.Ubuntu Linux telnet最后一项设置,加设防火墙/etc/hosts.allow(deny)机制:
上面开放了192.168.0.0/24这个网段,可是若是您只想让其中的192.168.0.1~192.168.0.5进入,能够设置以下 :
vi /etc/hosts.allow
in.telnetd:192.168.0.1,192.168.0.2,192.168.0.3,192.168.0.4,192.168.0.5:allow
转自:http://blog.csdn.net/zjf280441589/article/details/17408991
引言:
Linux大多应用于服务器,而服务器不可能像PC同样躺在办公室里,它们是放在IDC机房的,因此咱们平时登陆Linux系统都是经过远程登陆的。Linux系统中是经过ssh服务实现的远程登陆功能。默认ssh服务开启了22端口(telnet是23端口),并且当咱们安装完系统时,这个服务已经安装,而且是开机启动的。因此不须要咱们额外配置什么就能直接远程登陆linux系统。Ssh服务的配置文件为/etc/ssh/sshd_config,你能够修改这个配置文件来实现你想要的ssh服务。好比你能够更改启动端口为36000.
为何不用Telnet?telnet由于采用明文传送报文,安全性很差,不少Linux服务器都不开放telnet服务,而改用更安全的ssh方式了。
一、ssh的安装
sudoapt-get install ssh
二、生成密钥
ssh-keygen
中间过程会提示你存放密钥的地方Enterfile in which to save the key (/home/gavin/.ssh/id_rsa):咱们选择默认,直接回车;
而后会提示Enterpassphrase (empty for no passphrase):设置一个进入私钥的密码,在后边导入id_rsa到puttygen会用到,设置一个本身容易记又不会让人轻易破解的就能够了;
上述过程执行完毕后会生成两个文件,一个是id_rsa(私钥),一个是id_rsa.pub(公钥);
这里将公钥更名为authorized_keys:
cd .ssh
mv id_rsa.pub authorized_keys
三、修改配置文件(/etc/ssh/sshd_config)
sudo vim /etc/ssh/sshd_config
其中有这么一行#AuthorizedKeysFile %h/.ssh/authorized_keys,把前面的#去掉便可;
四、到windows平台将先前生成的私钥id_rsa,转换成putty所识别的格式(*.ppk),获得文件id_rsa.ppk.
(1)把linux上生成的id_rsa拷贝到windows平台下;
(2)下载puttygen.exe,(http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)而后打开,咱们要让它帮咱们作个通行证,生成id_rsa.ppk;
详细步骤:
a)选择“load”,载入以保存好的私钥文件:
b)弹出的对话框里把“文件类型”换成“全部文件”而后选中咱们从ubuntu服务器上生成的id_rsa文件;
c)接着,它会提示你输入密码,这不是你linux用户密码,而是前面下划线上的私钥密码;
d)其余的选项直接默认就行了,设置完成以后,点击"saveprivate key",注意(格式为*.ppk)由于putty只识别本身作的钥匙;
(注意:这个文件名字就直接用id_rsa.ppk就能够了,不要再改了)
五、windows上启动putty,进行以下配置
(1)Session-Logging-Hostname:填上你的linux的IP地址
(附:在Linux上用ifconfig命令获取,内容是inet以后的那一串数字)
(2)Windows-Translation-在下拉菜单里选上UTF-8。
(这儿软件通常默认的就是UTF-8,不过最好仍是确认一下,若是不是的话,登陆后将会出现中文乱码)
(3)Connection-Data - Auto login username:填上你登陆Linux时用的用户名。
(4)Connection-SSH-Auth Private key file for authentication:选上id_rsa.ppk;
而后点击open,按照提示输入私钥密码便可访问。
附:密钥认证机制远程登陆linux
SSH服务支持一种安全认证机制,即密钥认证。所谓的密钥认证,其实是使用一对加密字符串,一个称为公钥(publickey),任何人均可以看到其内容,用于加密;另外一个称为密钥(privatekey),只有拥有者才能看到,用于解密。经过公钥加密过的密文使用密钥能够轻松解密,但根据公钥来猜想密钥却十分困难。ssh的密钥认证就是使用了这一特性。服务器和客户端都各自拥有本身的公钥和密钥。
1、vnc veiw访问在vmw虚拟机上的linux
Linux服务器架设在VMware之上的虚拟机,那么能够直接使用VMware自带的vnc,而不用本身安装,只要在VMware的设置中将远程显示的选项打开,指定一个端口和密码就能够了,以下图所示:
再在windows中下载vnc veiw 地址为http://www.realvnc.com/products/free/4.1/winvncviewer.html
使用便可。
点击下载好的vnc-4_1_3-x86_win32_viewer.exe输入宿主机器的IP:桌面号或IP:5900+桌面号
在vnc veiw中输入在虚拟机设置的密码
点击OK成功后显示以下所示
到此 windows经过vnc访问在宿主机器虚拟机上的linux(fedora)完成。
2、vnc veiw访问在linux(非经过虚拟机)
vnc的安装和使用
个人环境是被控端 fedora 12 ,主控端 win xp
一、下载vnc server、vnc view
vnc server 下载地址:http://www.realvnc.com/cgi-bin/download.cgi
vnc view 下载地址 :http://www.realvnc.com/products/free/4.1/winvncviewer.html
二、安装
在linux 下安装
[root@fengge lijing]# rpm -i /home/lijing/Soft/vnc-4_1_3-x86_linux.rpm
可能提示如下错误
/Soft/compat-libstdc++-296-2.96-141.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4ebfc273
这是由于缺少依赖包的缘由,那么下载compat-libstdc++-296-2.96-141.i386.rpm
下载地址:
安装compat-libstdc++-296-2.96-141.i386.rpm后再安装vnc server
[root@fengge lijing]# rpm -i /home/lijing/Soft/compat-libstdc++-296-2.96-141.i386.rpm --force --nodeps
warning: /home/lijing/Soft/compat-libstdc++-296-2.96-141.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4ebfc273
[root@fengge lijing]# rpm -i /home/lijing/Soft/vnc-4_1_3-x86_linux.rpm
Checking for perl... [OK]
Checking for uname... [OK]
Checking for xauth... [OK]
三、执行vncserver命令:
[root@fengge lijing]# vncserver
You will require a password to access your desktops.
Password: --输入密码
Verify: 登陆vncserver密码
New 'fengge:1 (lijing)' desktop is fengge:1 注意这边的1,为桌面编号(即显示号)
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/fengge:1.log
四、在win运行vnc view (192.168.8.169:1或192.168.8.169:5901都是能够的,但192.168.8.169:5901不行(会出现connection refused的错误))
点击OK后便可登陆。
3、vnc使用及注意事项
一、vnc view登陆时提示 unable to connect to host:Connection refused(10061)
那么要设置被控机linux的远程桌面及防火墙
防火墙能够添加vnc的端口或直接关闭。
二、设置VNC的链接密码。
#vncpasswd (输入VNC链接密码)
注:若是你如今不设置密码,当你用vncserver启动vnc服务时会提示你设置密码。
三、启动VNC服务。
#vncserver (启动vnc服务器)
四、关闭VNC服务。
#vncserver -kill :1 (关闭VNC服务器)
注意:kill和:1之间有一个空格。1与上面的对应
五、启动 中止 重启
#service vncserver start/stop/restart
Ubuntu下设置VNCServer(有vnc4server和vncserver本文以vnc4server讲解)