惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
H
Help Net Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
T
Troy Hunt's Blog
宝玉的分享
宝玉的分享
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Schneier on Security
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
B
Blog
The GitHub Blog
The GitHub Blog
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
The Register - Security
The Register - Security
F
Fortinet All Blogs
爱范儿
爱范儿
L
LINUX DO - 热门话题
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
Schneier on Security
Schneier on Security
N
News and Events Feed by Topic
Last Week in AI
Last Week in AI
D
Docker
Application and Cybersecurity Blog
Application and Cybersecurity Blog
阮一峰的网络日志
阮一峰的网络日志
C
Cybersecurity and Infrastructure Security Agency CISA
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Spread Privacy
Spread Privacy
The Hacker News
The Hacker News
Hacker News: Ask HN
Hacker News: Ask HN
Project Zero
Project Zero
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
P
Privacy International News Feed
O
OpenAI News
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
Securelist
Google Online Security Blog
Google Online Security Blog
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
Martin Fowler
Martin Fowler

SSH

有没有能断线重连,并自动运行脚本的 SSH 工具? - V2EX 我不理解几乎所有 SSH 加固都提到配置公钥 - V2EX Mac 上找不到能替代 MobaXterm 的 SSH 工具,求推荐! - V2EX 为什么关了密码登录, auth.log 里还有账号密码登录错误的记录,难道不是直接断开吗? warp windows 版本出了 代理软件开启 tun 模式的时候 Termius 就没办法 ssh 了 - V2EX mosh ssh 问题 - V2EX 求一个 mac 下的 ssh 终端管理软件,刚需多开和广播输入 - V2EX Tabby 终于又可以云同步了,超级简单! - V2EX 通过 OSC 52 在 SSH 中调用本地 clipboard 有什么能很好管理 ssh 连接的工具吗 - V2EX 求助 请教一个 ssh 问题 - V2EX SSHD 配置问题 通过 frp 内网穿透 ssh 连接家里本子 - V2EX iTerm2 更新重启, session 居然不会断的?什么原理 - V2EX mac 的 SSH 连接可以套代理吗? - V2EX 求大佬指条路,提供一个能让学校服务器访问 hugging face 的手段 - V2EX 请教个的 ssh 连接不上的问题, SSH2_MSG_KEXINIT sent 后马上关闭了 - V2EX 2024 年了, macOS 上最好用的 SSH 工具是啥? - V2EX 有什么对 ssh 证书登录支持比较好的免费工具吗? - V2EX 1panel 自带的终端 当 web SSH 很好用,有单独 docker 版吗? - V2EX 请问下 v 友们,用 ssh 连接国外服务器卡顿有什么解决方法吗? - V2EX 如何同步远程 SSH 机器粘贴板的内容 - V2EX wrap 终端要怎么保存 ssh 会话? - V2EX 求推荐 SSH 工具 - V2EX 有个疑惑,新机器连接服务器如何添加密钥?复制原来密钥? - V2EX 救一下,电脑连手机热点能连上 ssh,回家连 wifi 后就不行。 - V2EX 求推荐能保存密码的 ssh comand line tools - V2EX 22 端口无法使用 - V2EX 同一个 wifi 下,手机可以 ssh 顺利连上,电脑端却卡在连接中,求解惑 - V2EX iTerm2 中如何添加 CloudFlare Tunnel 的 SSH Profile - V2EX 公司电脑装了加密软件后, openssh 用不了了 - V2EX 如何配置~/.ssh/config 使得同一主机不同端口可以使用不同的策略登录 - V2EX wsl2 无法 ping 通网线连接的 ip - V2EX mobaxterm 是世界上最好用的 ssh 工具 - V2EX ssh chat - V2EX 桌面原生的 gui 程序嵌入命令行程序或者实现一个命令行控件,该从哪方面入手? - V2EX 如何禁止 ssh 走路由器 clash 流量 - V2EX 关于 ssh 命令下 t 参数 - V2EX 关于 ssh 日志/var/log/secure 的攻击日志 - V2EX 通过 frp 使用 ssh 连接终端总是一段时间就断开,有什么解决办法? - V2EX 两个可以互相访问的内网机器, A 能访问外网, B 不能,能通过设置 SSH 代理让 B 也能访问外网吗 - V2EX SSH 端口转发给我看迷糊了 - V2EX 由于经常换电脑,求推荐一个 windows 下轻量的 portable ssh 客户端,能够支持公钥登录 - V2EX V2EX V2EX 有没有这样的一个 ssh 命令行工具 - V2EX 遇到一个有趣的 ssh 的问题 - V2EX 下个月要外出,求可行的内网 SSH 方案 - V2EX
ssh 执行时$PATH 变量未替换 - V2EX
thunderbuddy · 2023-10-28 · via SSH

这是一个创建于 960 天前的主题,其中的信息可能已经有所发展或是发生改变。

后台方式执行命令时,PATH 变量为"$PATH:/usr/local/bin",导致很多命令找不到

ssh 登入后再执行,PATH 就正常了,请大家帮忙看看问题在哪呢

aaron@Aaron-PC:~$ ssh 192.168.2.11 'export'
declare -x HOME="/var/services/homes/aaron"
declare -x LOGNAME="aaron"
declare -x MAIL="/var/mail/aaron"
declare -x OLDPWD
declare -x PATH="\$PATH:/usr/local/bin"
declare -x PWD="/volume2/homes/aaron"
declare -x SHELL="/bin/ash"
declare -x SHLVL="1"
declare -x SSH_CLIENT="192.168.2.97 57086 22"
declare -x SSH_CONNECTION="192.168.2.97 57086 192.168.2.11 22"
declare -x USER="aaron"
adoal

1

adoal      2023 年 10 月 28 日   ❤️ 1

$PATH 前面那个 \ 很可疑

julyclyde

3

julyclyde      2023 年 10 月 28 日

login shell 和 non interactive shell 的区别?

adoal

7

adoal      2023 年 10 月 28 日

看看是不是某个 rc 文件里写 PATH="$PATH:/usr/local/bin" 的时候用了单引号

thunderbuddy

8

thunderbuddy      2023 年 10 月 29 日

我的是群晖的系统,环境变量检查过了,/etc/profile ,/etc.defaults/.bashrc_profile ,以及~/.zshrc 文件,PATH 变量是正常的,没有包含单引号

执行环境是非登录非交互,没有设置$BASH_ENV 变量,找不出问题了 o(╥﹏╥)o
aaron@Aaron-PC:~$ ssh 192.168.2.11 'echo $-;shopt login_shell'
hBc
login_shell off

@adoal @julyclyde @Al0rid4l @liangkang1436

julyclyde

12

julyclyde      2023 年 10 月 30 日

那要不你开个 strace -f 吧,从 sshd listen 、accept 、fork 开始看看到底它从哪儿引入这个环境变量的

(我就是觉得有点高射炮打蚊子)

thunderbuddy

13

thunderbuddy      2023 年 11 月 3 日

感谢各位大佬,找到问题了,原来是.ssh 目录下的 environment 文件中定义了这个变量(也不知道啥时候创建的这个文件)捂脸。。