海康威视(Hikvision)是一家全球领先的视频监控设备和解决方案提供商,其产品包括网络视频录像机(NVR)以及摄像头、监视器、存储设备、软件和其他安全监控相关的产品。
海康NVR(Network Video Recorder)是一种专门用于数字监控系统的设备,可对各种通用类型的网络视频设备进行实时监控、录制、回放和管理。具备如下特点:
SSH是专为远程登录会话和其他网络服务提供安全性的协议,利用SSH协议可以有效防止远程管理过程中的信息泄露问题。
海康NVR启用SSH模式后,只有通过SSH协议连接并输入正确的用户名和密码,才能进行远程访问和管理,可以有效提供远程管理过程中的数据安全性。
海康NVR启用SSH模式后,可能会对设备的性能产生一定影响,如传输速度变慢、设备运行缓慢等。
另外,如果设备启用了SSH,但未及时更新或升级SSH,可能会被黑客攻击,从而导致数据泄露、设备损坏等问题。
首先从WEB界面登录海康NVR,如下图所示,依次点击“系统-安全管理-安全服务”,勾选“启用SSH”,然后点击“保存”。
SSH工具登录NVR
三次连续SSH登录失败,会自动关闭SSH登录,需要重新回到Web网页勾选“启用SSH”的功能
SSH登录后,进入shell模式,不过默认进来时protect shell(psh)模式,这个模式下,很多shell指令无法执行或者无权限。
- Protect Shell (psh)
- Enter 'help' for a list of DVR/NVR system commands.
-
- #
- #
-
比如,show用户信息时,该指令会提示权限被拒绝。
- # showUserInfo
- Permission denied.
- #
-
如果不清楚shell 指令,可以通过"help"提供帮助
1,GetAnrCfgInfo
可以获取通道信息,包括主码流,子码流等。
- # GetAnrCfgInfo
- -------------------------------------------------------------------------------
- | Idx | chan | chanType | recordType | MInChan | record | recordCommand |
- |-------------------------------------------------------------------------------|
- | 1 | 1 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 2 | 2 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 3 | 3 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 4 | 4 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 5 | 5 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 6 | 6 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 7 | 7 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 8 | 8 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 9 | 9 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 10 | 10 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 11 | 11 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 12 | 12 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 13 | 13 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 14 | 14 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
- | 15 | 15 | IPC | VIDEO | -1 | OFF | TIMING_REC |
- |-------------------------------------------------------------------------------|
-
-
2,日志信息输出
- # dvrLogInfo
- dvrLogInfo
- dvrLogInfo showold
- dvrLogInfo shownew
- dvrLogInfo setmask value
- dvrLogInfo del dbfileName: del dbfileName log
- dvrLogInfo NEW_ALARM faceSnapModelingStart/faceSnapModelingStop
- dvrLogInfo LOGINSERT
- dvrLogInfo LOGHD
- dvrLogInfo FULLTEST
- #
-
根据提示,我们进一步输入dvrLogInfo shownew查看最新的日志
- # dvrLogInfo shownew
- LOG-RUNINFO1: init 1,startTime 129,now 1836675,bAddTask 0
- LOG-RUNINFO2: uiBitMask 0,DevAbNorTime 0, file NONE,line 0,time 0
- LOG-CFGINFO1: Mode System,cycleDay 90,DiskNo 0,DiskType (-1)HDD,uuid 00000000-0000-0000-0000-000000000000
- LOG-CFGINFO2: Ctrl 0,Drive 0,Part 0,DiskNo 1
- LOG-InsertErrInfo: InsertErr 0,NoTaskLost 0
- LOG-SendGetInfo: sendCount 536021,SendLen 55972072(53 MB),GetCout 535919,GetLen 55958728(53 MB)
- LOG-DataCountInfo: Insert 0,Len 0(0 MB),Alarm 0,Len 0(0 MB),Info 0,Len 0(0 MB)
- Search-CtrlInfo: normaSearch 0,ExSearch 0,maxExport 1024 MB
- Alarm-CtrlInfo:iAddCnt 0,iDelCnt 0,bLogAlarm 1,bLogDbErr 0,full 0,maxfile 8,maxfilenum 64
- #
-
3,显示网络IPC信息showNetIpcmInfo
这个shell指令可以输出当前NVR连接的IPC信息
- # showNetIpcmInfo
- s_DeviceDebug [0][0][0][19807259][19807259][656][656][0][0][0]
- s_StreamingDebug [0][0][0][0][0][0][0][0]
- AlarmS: thPool: [alive:(0) idle:(0) max:(64) items:(0) timeout(30000)]
- RouterMode [FALSE]
-
- Id Chan IfName Ip:Port User Input Stream Online Transmode Mode
- 25 12 bond0 192.168.1.19:8000 admin 1:1 2 Y Y rtsp TCP
- 26 6 bond0 192.168.1.14:8000 admin 1:1 2 Y Y rtsp TCP
- 27 23 bond0 192.168.2.16:8000 admin 1:1 2 Y Y rtsp TCP
- 28 26 bond0 192.168.2.19:8000 admin 1:1 2 Y Y rtsp TCP
- 29 27 bond0 192.168.2.20:8000 admin 1:1 2 Y Y rtsp TCP
- 30 25 bond0 192.168.2.18:8000 admin 1:1 2 Y Y rtsp TCP
- 31 8 bond0 192.168.1.17:8000 admin 1:1 2 Y Y rtsp TCP
- 32 11 bond0 192.168.1.21:8000 admin 1:1 2 Y Y rtsp TCP
- 33 1 bond0 192.168.1.18:8000 admin 1:1 2 Y Y rtsp TCP
- 34 3 bond0 192.168.1.11:8000 admin 1:1 2 Y Y rtsp TCP
- 35 4 bond0 192.168.1.12:8000 admin 1:1 2 Y Y rtsp TCP
- 36 29 bond0 192.168.2.22:8000 admin 1:1 2 Y Y rtsp TCP
- 37 30 bond0 192.168.2.23:8000 admin 1:1 2 Y Y rtsp TCP
- 38 20 bond0 192.168.2.13:8000 admin 1:1 2 Y Y rtsp TCP
- 39 22 bond0 192.168.2.15:8000 admin 1:1 2 Y Y rtsp TCP
- 40 17 bond0 192.168.2.10:8000 admin 1:1 2 Y Y rtsp TCP
- 41 7 bond0 192.168.1.15:8000 admin 1:1 2 Y Y rtsp TCP
- 42 9 bond0 192.168.1.16:8000 admin 1:1 2 Y Y rtsp TCP
- 43 31 bond0 192.168.2.24:8000 admin 1:1 2 Y Y rtsp TCP
- 44 32 bond0 192.168.2.25:8000 admin 1:1 2 Y Y rtsp TCP
- 45 5 bond0 192.168.1.13:8000 admin 1:1 2 Y Y rtsp TCP
- 46 14 bond0 192.168.1.23:8000 admin 1:1 2 Y Y rtsp TCP
- 47 28 bond0 192.168.2.21:8000 admin 1:1 2 Y Y rtsp TCP
- 48 19 bond0 192.168.2.12:8000 admin 1:1 2 Y Y rtsp TCP
- 49 24 bond0 192.168.2.17:8000 admin 1:1 2 Y Y rtsp TCP
- 50 2 bond0 192.168.1.10:8000 admin 1:1 2 Y Y rtsp TCP
- 51 16 bond0 192.168.1.25:8000 admin 1:1 2 Y Y rtsp TCP
- 52 21 bond0 192.168.2.14:8000 admin 1:1 2 Y Y rtsp TCP
- 53 10 bond0 192.168.1.20:8000 admin 1:1 2 Y Y rtsp TCP
- 54 13 bond0 192.168.1.22:8000 admin 1:1 2 Y Y rtsp TCP
- 55 15 bond0 192.168.1.24:8000 admin 1:1 2 Y Y rtsp TCP
- 56 18 bond0 192.168.2.11:8000 admin 1:1 2 Y Y rtsp TCP
- #
-
列出更详细的shell指令
- # helpm
- helpm brAU getDbgCtrl
- setDbgCtrl outputOpen outputClose
- pthreadInfo memDbgInfo mutexInfo
- outputCloseAll outputRedirect errputOpen
- errputClose ucDbg brInfo
- brClear t1 t2
- beepTest closeCoaxTest wdda
- wddaDebug wddaVersion showSadpInfo
- showShareSvcInfo showSadpCActivateInfo showSadpSInfo
- SadpSearchAsy SadpActivateAsy showSpareWorkStatus
- GetAnrProcess GetAnrRecordList GetAnrCfgInfo
- showNetIpcmInfo dvrLogInfo guiStatus
- guiPrtScr guiChkCfg setSimMouseStatus
- guiSavePic setMouseStatus showGuiInfo
- guiRefreshmenu guiMessageTest printPart
- showTagSysInfo recorderFileInfo recorderStatus
- recorderParam recorderMediaInfo recorderChanInfo
- recorderPAllocFile streamRecorderTrace recorderPStartSeg
- recorderFileKeyFrame recorderSegExtraInfo recorderHDIdle
- recorderSegmentInfo showIpcMemInfo clearDisksMode
- showRaidInfo raidDbgCtrl showRaidCreatelog
- createRaid deleteRaid dbRecTest
- dbProgresBar dbDelFile dbAddHd
- dbDelHd dbPrintFileInfo dbVersionTest
- dbFaceLibCountTest dbFaceLibCheckTest dbDelDbFile
- dbShowMemInfo dbFileIdxInfo dbDbgCtrl
- dbChangeDbFile dbRebuild enablePlanMode
- getMode getLockFileSpace setLastWeekData
- getPeriod setRecPlanCfg getRecPlanCfg
- getRecMigPercent getBandWidth getFileNum
- getTime setTime setBitRate
- getHdLock planTest PrintMigInfo
- delSegInfo getShmInfo getSimpleShmInfo
- shmDbg hdLoadCtrl dbprintsearchid
- setPicDelay getPicDelay getSsdCapacity
- formatSsd dbdrop dbgendata
- formatSsdfat dbfreq catchPerformance
- searchAcrossTimeZone getJpegInfo raidreplace
- raidAndGroup dvdstatus printJpgHd
- iomonitor hktransDbg showHdTask
- runStorDbg showSearchParam dbDbgOpen
- hdTrim triggerAlarm showAlarmMap
- csscdbginfo getIp setIp
- getPort setPort getAbiExcel
- getGateway getAbiExcel setGateway
- getNetInterface getInetTraffic getHardInfo
- getFlashEraseInfo OpenCloseSameSource getability
- rebootDev enableHB disableHB
- enableWatchdog disableWatchdog resetPasswd
- GetDspMem FreeDspMem ShowPicCapLockInfo
- showCurPlayChanFileInfo showCurPlayChanFileInfo showDevTemp
- showPlayFileIframe savePlayData setPlayTestCtrl
- setBandWidthParaCtrl showPlayStatus showPlayChanStatus
- showPlayClipFile getPlayTestCtrl showPlayTime
- showPlayScreenInfo recorderSegExtraInfo playdebug
- showPreviewInfo showNetLinksInfo showAlarmInfo
- showPlatformInfo ShowIpcAbility ShowPoeInfo
- ShowPwdSyncInfo ss setCivilLbs
- setCivilAlarm getCivilStatus turnOffCivil
- setCivilDebugLevel showSipSession showIpcSipSession
- setDbgLevel showUserInfo showAlarmGuidInfo
- testAlarmUpFailLog showSdkIPIDInfo showSdkIpArmIOInfo
- flushSdkIPIDInfo showSessionUserInfo checkProSockfdInfo
- showIntellSearchUserInfo showNetIotmInfo iotAddChan
- iotGetInfo iotGetCount iotDelChan
- iotModChan iotGetInnerChans iotGetFacDesc
- iotSetListenStatus iotGetListenStatus iotGetFacMacro
- setVoIpcStreamNo showWHSession setCloudPassword
- dspStatus dspdump showDevCapa
- showChanCapa enablePID tcp_proxy
- cfg_debug testipc ipchanStatus
- signalModeSetCmd ctrlArchDebug snapstaus
- anasnapstaus dspdecodestatus adjGuardLevel
- setDetectAbnormal getDetectAbnormal iptables
- ip dsplog disableBeep
- GetDevMemInfo npqdebug npqpb
- npqpbspeed npqprev npqpbwor
- getDspInfo printTaskStatus setDspDebugInfo
- getWriteParam openCoaxialPrintfInfoCmd setPocTest
- setPocNegaVoltage controlAntiChanging signFast
- searchInfo cloudModeChange accessDvrSwitch
- enableHik264 disableHik264 getLastErrorInfo
- showSpareWorkStatus guiEnterMenuCount channelPlayback
- showDeviceTemp beepTest sataLedTest
- sendCoaxialTranscmd closeCoaxTest switchAd
- openLocalAudio watchdogreset showIpcAddr
- GetAnrRecordList GetAnrProcess GetAnrCfgInfo
- showDevMemInfo getARPtable getNetstatus
- startPCAP setMtu i2cWrite
- i2cRead showIsapiStorPicTokenInfo freeIsapiStorPicToken
- getDevDebugInfo setVoutIdx setSignalDetectMode
- dspStoreStat triggerIot lsIptablesRules
- GroupAlarmCfg setCertSn testHDExcp
- outputRedirect outputReClose setDspDebugInfo
- ezvizSnapshot
-