openwrt firewall

本文详细介绍了Dropbear SSH服务器的配置选项,包括启动设置、端口配置、认证方式等,并提供了免密码SCP传输的方法及防火墙相关操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/etc/config/dropbear

Sections

The dropbear configuration contains settings for the dropbear SSH server in a single section.

Dropbear

The dropbear section contains these settings:

Name Type Required Default Description
enable boolean no 1 Set to 0 to disable starting dropbear at system boot.
verbose boolean no 0 Set to 1 to enable verbose output by the start script.
BannerFile string no (none) Name of a file to be printed before the user has authenticated successfully.
PasswordAuth boolean no 1 Set to 0 to disable authenticating with passwords.
Port integer no 22 Port number to listen on.
RootPasswordAuth boolean no 1 Set to 0 to disable authenticating as root with passwords.
RootLogin boolean no 1 Set to 0 to disable SSH logins as root.
GatewayPorts boolean no 0 Set to 1 to allow remote hosts to connect to forwarded ports.
Interface string no (none) Tells dropbear to listen only on the specified interface.1)
rsakeyfile file no (none) Path to RSA file
dsskeyfile file no (none) Path to DSS/DSA file
SSHKeepAlive integer no 300 Keep Alive
IdleTimeout integer no 0 Idle Timeout

This is the default configuration:

config dropbear
        option PasswordAuth 'on'
        option RootPasswordAuth 'on'
        option Port         '22'

免密码SCP传输文件

将电脑的id_rsa.pub拷贝到路由器/etc/dropbear目录下,

cat id_rsa.pub >> authorized_keys

chmod 600 authorized_keys





关闭防火墙且禁止自启动,否则客户端无法用ssh连到dropbear server

/etc/init.d/firewall stop 

/etc/init.d/firewall disable


关于firewall:

/etc/init.d/firewallSyntax:

/etc/init.d/firewall

[command]Available commands:     

start  Start the service

stop Stop the service

restart     Restart the service

reload Reload configuration files (or restart if that fails)

enable Enable service autostart

disable Disable service autostart


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值