Comments (10)
I guess the logic would have to be:
- Check if the host has a user
- Check if the ssh_options define a user
- Fallback to local_user (or whatever is used currently to determine the local user)
from airbrussh.
Thanks for the report!
I don't quick understand what you mean in your third point: "fallback to local_user". Do you mean the equivalent of running whoami
on the remote host? I don't know if there is precedence for that in SSHKit.
I can definitely check the ssh_options
, though, which should fix this particular issue.
from airbrussh.
If no user is specified, sshkit uses either the user from ~/.ssh/config
, or if not defined, the current local user, just like ssh example.com
would do.
Maybe there's a way to ask sshkit for the actual user it is going to use?
from airbrussh.
The user is determined by net-ssh, which is the underlying library that SSHKit uses. If we had access to the net-ssh Session
object, we could probably get the user from it, but the session is not currently exposed by SSHKit's logging facility.
If you think there is a strong case to be made for logging the actual user (as implied by ~/.ssh/config
, for example), I suggest you open an SSHKit issue requesting it.
In the meantime, do you think checking for ssh_options[:user]
is an acceptable interim fix?
from airbrussh.
Yes I think it is.
Falling back to the local user, if we're not sure it is actually correct is probably a bad ideaβ¦
from airbrussh.
This is a bit tricker than I thought (see my failed attempt in PR #66), so I am going to put this on the back-burner for now. Addressing this issue means Airbrussh will have to make some assumptions about how net-ssh works, which makes me a little uncomfortable.
@felixbuenemann if you want to take a stab at a PR I will consider merging it.
from airbrussh.
Hmm, can't you access the global ssh_options from inside the formatter?
from airbrussh.
@felixbuenemann I think my PR will work after all. Let's move the conversation over to #66.
from airbrussh.
Fixed by #66.
This will be included in Airbrussh 0.8.0 (release date TBD).
from airbrussh.
Released today in Airbrussh 0.8.0.
from airbrussh.
Related Issues (20)
- AppVeyor CI (Windows) builds failing with net-ssh 4.0.0
- command_output HOT 9
- Colors in the capistrano.log file HOT 3
- Circular dependency warning
- Empty console output HOT 9
- Customize output to show server hostname HOT 1
- Mocha::NotInitializedError on stubbed tests when running minitest locally HOT 2
- "invalid byte sequence in UTF-8" when rsyncing files with international character
- Make rake a gem dependency HOT 3
- Make ConsoleFormatter's context configurable HOT 5
- Console error only when using Spring HOT 1
- Test on ruby 3
- Travis-CI builds are no longer working HOT 3
- Replace Travis with CircleCI HOT 1
- "Last 20 lines" of log file should not be truncated to console width
- Colorize LogMessages again HOT 3
- IO.console can be nil
- Vague and unhelpful error message if log cannot be created HOT 4
- Hostname in output HOT 1
- Tests fail under Ruby 2.4.0
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 airbrussh.