由于您不允許以粗體顯示,我假設您希望在SSH客戶端進行某種運行時拒絕,以防止端口綁定.所以,我已經為您挖掘了源代碼:
serverloop.c:
/* check permissions */
vim反向查找。if (!options.allow_tcp_forwarding ||
no_port_forwarding_flag ||
(!want_reply && listen_port == 0)
#ifndef NO_IPPORT_RESERVED_CONCEPT
進入端口,|| (listen_port != 0 && listen_port < IPPORT_RESERVED &&
pw->pw_uid != 0)
#endif
) {
linux、success = 0;
packet_send_debug("Server has disabled port forwarding.");
} else {
/* Start listening on the port */
centos7修改默認ssh端口、success = channel_setup_remote_fwd_listener(
listen_address,listen_port,&allocated_listen_port,options.gateway_ports);
}
不幸的是,正如您所看到的,除了標準端口之外,沒有多少條件可以阻止端口轉發.
centos修改ssh端口號?我打算在iptables中推薦使用mod_owner的相同建議,但杰夫已經打敗了我.
您最干凈的解決方案就是修改此文件(例如,您可以使用pw-> pw_uid來獲取用戶連接的uid,并將其映射到正確的端口)并重新編譯SSH服務器,但這取決于如何你很舒服.
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态