Comments (20)
@lonnywong plz help
from trzsz-ssh.
@warjiang Does openssh work properly?
from trzsz-ssh.
@warjiang Does openssh work properly?
Yeah, it works
from trzsz-ssh.
openssh supports #
without '
and "
:
Host test
LocalCommand echo Hello# World
PermitLocalCommand yes
Need to study how openssh does it. But I've been busy recently.
from trzsz-ssh.
First i should admit that i have little knowledge of openssh, even bunch of knowledge came from daily usage 🤣 .
May be it's not right time to talk further, you can recheck this when you are free. Feel free to review it 😄 .
What i want to express is that, the ssh_config
pkg cannot parse #
char in side string literal.
The test code as follow:
func main() {
configData := `Host test
LocalCommand echo Hello'#' World
PermitLocalCommand yes`
cfg, err := ssh_config.Decode(strings.NewReader(configData))
if err != nil {
panic(err)
}
v, err := cfg.Get("test", "LocalCommand")
if err != nil {
panic(err)
}
debug("value is %s", v)
}
Apart from that, i've tested in openssh client, i mock a ssh config file like following:
Host wap1
LocalCommand echo Hello'#' World
PermitLocalCommand yes
it's equla to command echo Hello'#' World
no echo Hello'
from trzsz-ssh.
what i do is that handel the #
within string literal, it's not enough, but it can work currentlly. After a brief view of openssh: https://github.com/openssh/openssh-portable/blob/master/readconf.c,
openssh lib also handle the ssh config with ast like tokenizer, lexer and so on. But the token is much more than ssh_config 😭
May we can talk it further in the futhre when free.
from trzsz-ssh.
@warjiang How about we make some changes like this:
Host comment
Key1 = Value1 # This is part of the value, not a comment
Key2 Value2 # This is a comment, not part of the value
The value of Key1
is Value1 # This is part of the value, not a comment
. And the value of Key2
is Value2
.
from trzsz-ssh.
@warjiang How about we make some changes like this:
Host comment Key1 = Value1 # This is part of the value, not a comment Key2 Value2 # This is a comment, not part of the value
The value of
Key1
isValue1 # This is part of the value, not a comment
. And the value ofKey2
isValue2
.
we should distinguish scene of #
#
in side single quote or doule quote
in this case,#
should be treated as a common literal#
not in side single quote or doule quote
in this case,#
should be treated as grammar of comment
so @lonnywong should change code as following, if you want #
as part of value
Host comment
Key1 = 'Value1 # This is part of the value, not a comment'
Key2 Value2 # This is a comment, not part of the value
from trzsz-ssh.
It's not clear whether the value 'Value1 # This is part of the value, not a comment'
contains single quotes or not.
I think =
means there is no comment at the end, which is simple and easy to distinguish. It's not exactly the same as openssh, but it's worth it.
from trzsz-ssh.
i've made serval test cases it in my local enviroment
Host wap
LocalCommand = echo Value1 # This is part of the value, not a comment
PermitLocalCommand yes
Host wap
LocalCommand echo Value1 # This is part of the value, not a comment
PermitLocalCommand yes
Conculsion: whether use equal sign, it turns out the same effect.
if wrap #
with single quote as follow:
Host wap
LocalCommand echo 'Value1 # This is part of the value, not a comment'
PermitLocalCommand yes
from trzsz-ssh.
I mean we change the code to do that.
from trzsz-ssh.
It's not clear whether the value
'Value1 # This is part of the value, not a comment'
contains single quotes or not.I think
=
means there is no comment at the end, which is simple and easy to distinguish. It's not exactly the same as openssh, but it's worth it.
maybe you are right, but it will casued some extra knowledge of another version of ssh config (like config of tssh) 😆 .
from trzsz-ssh.
I mean we change the code to do that.
i can try it, but maybe we can use option to let user to choose whehter enable this feature.
from trzsz-ssh.
how about another im tools like wechat or tg? may be we can talk it for further. the work under trzsz is very useful for me, maybe i can take part in these project in deep. 🤔
from trzsz-ssh.
i can try it, but maybe we can use option to let user to choose whehter enable this feature.
I think most people will not use =
in ssh config, even fewer use =
and add comments at the end of the line.
We just need to document the new features of =
in the new version.
how about another im tools like wechat or tg? may be we can talk it for further. the work under trzsz is very useful for me, maybe i can take part in these project in deep. 🤔
There's a QQ group at the bottom of README.
from trzsz-ssh.
I think most people will not use
=
in ssh config, even fewer use=
and add comments at the end of the line.We just need to document the new features of
=
in the new version.
that's true~ i'll try it later 🔧
from trzsz-ssh.
I've implemented this feature by add lexRReservedvalue
state. After detect equal, it will go to state of checking lexRReservedvalue
.
from trzsz-ssh.
I've implemented this feature by add
lexRReservedvalue
state. After detect equal, it will go to state of checkinglexRReservedvalue
.
for the ssh config as following:
Host comment
Key1 = Value1 # This is part of the value, not a comment
Key2 Value2 # This is a comment, not part of the value
from trzsz-ssh.
I will write the documentation and update it this weekend.
from trzsz-ssh.
done a6c64a6
from trzsz-ssh.
Related Issues (20)
- -R for serveo.net or ssh-j.com on Windows10 and Debian12 HOT 19
- My user name include a symbol '#' that i can't login destination host HOT 2
- 无法激活1password的ssh agent HOT 5
- An example of using tssh `as` a library HOT 5
- Mosh 支持 HOT 25
- 类似于xftp实现跨服务器传输文件 HOT 3
- tssh执行后面直接执行命令报错 HOT 2
- 求教一下为什么我选择列表界面不是箭头而是炸药? HOT 2
- Android 的 Termux 从v0.1.15开始没法使用 tssh HOT 6
- UDP模式闲置一小段时间就会卡住 HOT 1
- Windows下无法使用`IdentityAgent`登录 HOT 11
- 通过堡垒机连接后,使用trz上传文件存在问题 HOT 17
- 关于提供登录后自动修改窗口标题的建议 HOT 14
- Feature request: 命令行参数取代文件选择框 HOT 6
- tmux批量登录无法分屏 HOT 4
- UDP模式支持ForwardAgent不成功 HOT 7
- If the key not found in known_host then OpenSSH adds all the host keys to it. HOT 9
- [文档问题] 说明文档里描述的rzsz文件传输,怎么使用呢? HOT 4
- Windows下SSH AgentForward不起作用 HOT 13
- 用sh脚本的形式,trz上传窗口无法弹出 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trzsz-ssh.