\r\n[root@server1 ~]# yum list golang\r\nRepository AppStream is listed more than once in the configuration\r\nRepository extras is listed more than once in the configuration\r\nRepository PowerTools is listed more than once in the configuration\r\nRepository centosplus is listed more than once in the configuration\r\nAvailable Packages\r\ngolang.x86_64 1.14.12-1.module_el8.3.0+605+410c5674 AppStream\r\n<\/pre>\n
\n\u53d1\u73b0\u5728AppStream\u6e90\u4e2d\u6709golang\u5b89\u88c5\u5305\uff0c\u4e0b\u9762\u5f00\u59cb\u5b89\u88c5\u5427\uff1a<\/p>\n
\r\n[root@server1 ~]# yum -y install golang\r\n<\/pre>\n\u4e3a\u4e86\u4f7f\u7528 Go \u8bed\u8a00\uff0c\u8bf7\u5728\u7528\u6237\u4e3b\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u5de5\u4f5c\u7a7a\u95f4\u3002Go \u8bed\u8a00\u4f1a\u5c06\u6240\u6709\u6587\u4ef6\u4fdd\u5b58\u5728\u8fd9\u91cc\uff1a<\/p>\n
\r\n[root@server1 ~]# mkdir -p ~\/go_proj\/bin\r\n<\/pre>\n\u8bbe\u7f6e GOPATH \u548c GOBIN \u73af\u5883\u53d8\u91cf\u3002GOPATH \u662f\u9879\u76ee\u5de5\u4f5c\u533a\uff0c\u5c06\u4e0b\u9762\u4e24\u884c\u5185\u5bb9\u6dfb\u52a0\u5230~\/.bashrc<\/code>\u914d\u7f6e\u6587\u4ef6\u4e2d\uff1a<\/p>\n\r\n[root@server1 ~]# vim ~\/.bashrc \r\n\r\nexport GOPATH=$HOME\/go_proj\r\nexport GOBIN=$GOPATH\/bin\r\n<\/pre>\n<\/p>\n
\u5b89\u88c5rtop<\/strong><\/div>\n\u8fd0\u884cgo get<\/code>\u547d\u4ee4\u6765\u6784\u5efartop\u3002rtop\u4e8c\u8fdb\u5236\u6587\u4ef6\u81ea\u52a8\u4fdd\u5b58\u5728$GOPATH\/bin<\/code>\u4e0b\u3002\u8fd0\u884cgo get\u4e4b\u524d\uff0c\u786e\u4fdd\u7cfb\u7edf\u5b89\u88c5\u4e86git<\/code>\u5de5\u5177\uff1a<\/p>\n\r\n[root@server1 ~]# yum -y install git\r\n[root@server1 ~]# go get github.com\/rapidloop\/rtop\r\npackage git:\/github.com\/rapidloop\/rtop: git:\/github.com\/rapidloop\/rtop: invalid import path: malformed import path \"git:\/github.com\/rapidloop\/rtop\": invalid char ':'\r\n[root@server1 ~]# go get github.com\/rapidloop\/rtop\r\npackage golang.org\/x\/crypto\/ssh: unrecognized import path \"golang.org\/x\/crypto\/ssh\": https fetch: Get \"https:\/\/golang.org\/x\/crypto\/ssh?go-get=1\": dial tcp 216.239.37.1:443: connect: connection refused\r\npackage golang.org\/x\/crypto\/ssh\/agent: unrecognized import path \"golang.org\/x\/crypto\/ssh\/agent\": https fetch: Get \"https:\/\/golang.org\/x\/crypto\/ssh\/agent?go-get=1\": dial tcp 216.239.37.1:443: connect: connection refused\r\npackage golang.org\/x\/crypto\/ssh\/terminal: unrecognized import path \"golang.org\/x\/crypto\/ssh\/terminal\": https fetch: Get \"https:\/\/golang.org\/x\/crypto\/ssh\/terminal?go-get=1\": dial tcp 216.239.37.1:443: connect: connection refused\r\n<\/pre>\n\u8fd0\u884cgo get\u4e4b\u540e\uff0c\u53d1\u73b0\u4e0d\u80fd\u4e0b\u8f7d\u4f9d\u8d56\u5305\u3002
\n
\n\u6309\u7167\u4e0b\u9762\u64cd\u4f5c\uff0c\u521b\u5efa\u76ee\u5f55\uff0c\u5e76\u624b\u52a8git\u4e0b\u8f7d\u76f8\u5173\u4f9d\u8d56\uff1a<\/p>\n
\r\n[root@server1 ~]# mkdir -p $GOPATH\/src\/golang.org\/x\/\r\n[root@server1 x]# git clone https:\/\/github.com\/golang\/crypto.git\r\n[root@server1 x]# git clone https:\/\/github.com\/golang\/term.git\r\n[root@server1 x]# git clone https:\/\/github.com\/golang\/sys.git\r\n<\/pre>\n
\n\u4e0b\u9762\u518d\u6b21\u8fd0\u884cgo get<\/code>\u5c31\u53ef\u4ee5\u4e86\uff1a<\/p>\n\r\n[root@server1 x]# go get github.com\/rapidloop\/rtop\r\n<\/pre>\n\u4e0b\u9762\u53ef\u4ee5\u770b\u5230rtop<\/code>\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\u4e86\u3002
\n<\/p>\n\u5982\u4f55\u4f7f\u7528rtop<\/strong><\/div>\nrtop \u4e8c\u8fdb\u5236\u6587\u4ef6\u5b58\u5728\u4e8e $GOPATH\/bin \u4e2d\uff0c\u56e0\u6b64\u53ea\u9700\u8fd0\u884c $GOBIN\/rtop<\/code>\u5c31\u53ef\u4ee5\u3002\u53ea\u9700\u6dfb\u52a0\u8fdc\u7a0b\u4e3b\u673a\u4fe1\u606f\uff0c\u7136\u540e\u4f7f\u7528 rtop \u547d\u4ee4\u8fdb\u884c\u76d1\u63a7\u3002\u5237\u65b0\u95f4\u9694\u9ed8\u8ba4\u4e3a5\u79d2\u949f\u3002<\/p>\n\r\n[root@server1 ~]# $GOBIN\/rtop root@192.168.43.131\r\n<\/pre>\n
\n\u624b\u52a8\u8bbe\u7f6e\u5237\u65b0\u95f4\u9694\u4ee5\u66f4\u597d\u5730\u76d1\u63a7\u3002\u8fd9\u91cc\u8bbe\u7f6e\u4e862\u79d2\u5237\u65b0\u95f4\u9694\u3002<\/p>\n
\r\n[root@server1 ~]# $GOBIN\/rtop root@192.168.43.131 2\r\n<\/pre>\n
\n<\/p>\n
\u603b\u7ed3<\/strong><\/div>\n]rtop \u662f\u4e00\u4e2a\u7b80\u5355\u7684\u3001\u65e0\u4ee3\u7406\u7684\u8fdc\u7a0b\u670d\u52a1\u5668\u76d1\u63a7\u5de5\u5177\uff0c\u53ef\u901a\u8fc7 SSH \u8fd0\u884c\u3002\u5b83\u4e0d\u9700\u8981\u5728\u8fdc\u7a0b\u673a\u5668\u4e0a\u5b89\u88c5\u4efb\u4f55\u4ee3\u7406\u8f6f\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u5b83\u7684\u5de5\u4f5c\u539f\u7406\u662f\u5efa\u7acb\u4e00\u4e2a SSH \u4f1a\u8bdd\uff0c\u5e76\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u547d\u4ee4\u6765\u6536\u96c6\u7cfb\u7edf\u4fe1\u606f\uff0c\u4f8b\u5982 CPU\u3001\u78c1\u76d8\u3001\u5185\u5b58\u3001\u7f51\u7edc\u3002 […]<\/p>\n","protected":false},"author":309,"featured_media":221731,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-221730","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/221730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=221730"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/221730\/revisions"}],"predecessor-version":[{"id":221741,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/221730\/revisions\/221741"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/221731"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=221730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=221730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=221730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}