现在的位置: 首页 > 综合 > 正文

linux工具安装

2017年10月08日 ⁄ 综合 ⁄ 共 1682字 ⁄ 字号 评论关闭

ubuntu下远程登录工具的安装和配置

一、ssh远程登录工具

1、安装步骤

a、ubuntu下安装

apt-get install  openssh-server

b、启动sshd

/usr/sbin/sshd

c、如果出现如下错误 

/usr/sbin/sshd Missing privilege separation directory: /var/run/sshd

d、需要创建sshd目录

mkdir /var/run/sshd

E、查看sshd 运行状态 

ps axu | grep sshd

出现如下信息表示sshd安装成功

root      4090  0.0  0.0   6684  2428 ?        Ss   14:27   0:00 /usr/sbin/sshd -D

root      4606  0.0  0.0   4392   808 pts/3    S+   14:49   0:00 grep --color=auto sshd

F、查看ssh状态  

ps -e | grep ssh

出现如下信息

 1875 ?        00:00:00 ssh-agent

 4090 ?        00:00:00 sshd

 

2、使用方法

ssh ip -l name (ip: 远程电脑的IP,如果在同一个局域网,就输入局域网IP地址,如果是不同局域网,需要输入对方的公网IP地址)

例如: (在命令行下登录)

    ssh 113.91.10.100 -l yue

 

3、putty工具登录

 

 

二、 Ubuntu下开启Telnet服务

1、安装 

sudo apt-get install xinetd telnetd

2、安装成功后,系统也会有相应提示,
sudo vim /etc/inetd.conf并加入以下一行

telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd

 

 

3.、sudo vim /etc/xinetd.conf并加入以下内容:

 

# 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 vim /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

telnet 192.168.1.105 

输入账号密码

7、远程测试(用putty) 默认端口为23

8、设置putty

 

登录成功之后输入账号和密码即可

 

 

抱歉!评论已关闭.