日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

RSH的网络通信细节

發(fā)布時間:2023/12/13 综合教程 45 生活家
生活随笔 收集整理的這篇文章主要介紹了 RSH的网络通信细节 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

rsh
服務(wù)偵聽
514/TCP
口,
client
建立到
server

514/TCP
的連接。服務(wù)端會先檢查
TCP


連接的源端口是否位于
[512,1023]
區(qū)間,否則服務(wù)端進程終止。
*nix
最早要求范圍是
[1,1023]
,后來為消除一些安全隱患,改成
[512,1023]
。但這是實現(xiàn)相關(guān)的,并且各個
系統(tǒng)





man
手冊可能與其當(dāng)前實現(xiàn)不同步,某些版本
Solaris

man
手冊就有問題,應(yīng)實測。

為什么
rshd
有這個限制?一般
rsh

rcp

rlogin

設(shè)置





setuid-to-root

client
要想訪問遠端
rshd
,只能用系統(tǒng)自帶的
rsh

rcp

rlogin
,但這三個程序會如實指定
client_user
字段,不存在偽造的可能。只有
root
用戶才能使用
[1,1023]
的端口。

那么
rshd
如何檢查端口?
client

server
發(fā)送如下請求數(shù)據(jù)
:

[port]\0<client_user>\0<server_user>\0<command>\0

Port ---- ANSI
字符串形式的端口號,不是短整型形式的端口號。

client_user ----
客戶端當(dāng)前用戶名

server_user ----
試圖遠程使用的服務(wù)端用戶名

command ----

試圖遠程使用的服務(wù)端命令

port
本身是可選項。如果指定了
port
,服務(wù)端會建立到客戶端這個端口
(port)

TCP
連接,
rshd
會將
stderr
重定向到這條連接上。
*nix
要求
port

[1,1023]
上,并且成功建立連接,否則服務(wù)端進程終止。但這是實現(xiàn)相關(guān)的,
Solaris

Linux
自帶
rsh
命令,抓包表明它們都提供
port
字段,并且沒有命令行開關(guān)改變這個行為。

server

client
發(fā)送如下響應(yīng)數(shù)據(jù)
:

<ret><data>

ret
等于
0x00
表示成功,
data
對應(yīng)執(zhí)行結(jié)果,一般是
\n
分隔、結(jié)尾的文本。

ret
等于
0x01
表示失敗,
data
對應(yīng)錯誤信息,一般也是
\n
分隔、結(jié)尾的文本。

Application reaches max limit on rsh
connections

It appears from the customer's application
that it is reaching the max limit (and even going beyond) on the max allowed
number of port connections when doing repeated rsh to the server's
in.rshd,-
which allows connections only
from the "ephemeral" reserved ports (ports 512-1023).

Many Error Messages of the kind below
appear in /var/adm/messages for 5-10 minutes, and, after which connections
start to work again.
Customer is getting
these error messages at peak load times.

His ultra is a ftp/rsh/rcp server for many differnt remote client
machines.

Error msg
example: (/var/log/messages)

"Apr

1 11:07:10 asncomm rsh[16295]: can't get stderr port: Resource
temporarily unavailable"

The message isn't from xinetd throttling
too high of a connection rate. It is from rshd, due to a failure of rresvport.
Note that the EAGAIN associated error message translation is documented on the
manpage for rresvport:



“The rresvport() function returns a valid,
bound socket descriptor on success.
It
returns -1 on error with the global value errno set according to the reason for
failure.
The error code EAGAIN is
overloaded to mean ''All network ports in use.''

參考:
rsh的網(wǎng)絡(luò)通信細節(jié)

http://www.netexpert.cn/thread-3717-1-1.html



作者:zhenjing.chen


出處:http://www.cnblogs.com/zhenjing/

未注明轉(zhuǎn)載的文章,版權(quán)歸作者所有,歡迎轉(zhuǎn)載,但未經(jīng)作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接,否則保留追究法律責(zé)任的權(quán)利。

總結(jié)

以上是生活随笔為你收集整理的RSH的网络通信细节的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。