Daniel Leidert: Rsync files between two machines over SSH and limit read access
From time to time I need to get contents from a remote machine to my local workstation. The data sometimes is big and I don't want to start all over again if something fails. Further the transmission should be secure and the connection should be limited to syncing only this path and its sub-directories. So I've setup a way to do this using rsync and ssh and I'm going to describe this setup. Consider you have already created a SSH key, say ~/.ssh/key_rsa together with ~/.ssh/key_rsa.pub, and on the remote machine there is an SSH server running allowing to login by a public key and rsync is available. Lets further assume the following:
- the remote machine is rsync.domain.tld
- the path on the remote machine that holds the data is /path/mydata
- the user on the remote machine being able to read /path/mydata and to login via SSH is remote_user
- the path on the local machine to put the data is /path/mydest
- the user on the local machine being able to write /path/mydest is local_user
- the user on the local machine has the private key ~local_user/.ssh/key_rsa and the public key ~local_user/.ssh/key_rsa.pub
[..]):
ssh-rsa [..]= user@domain.tldNow I would like to limit the abilities for a user logging in with this key to only rsync the special directory /path/mydata. I therefor preceed the key with a
command prefix, which is explained in the manual page sshd(8). The file then looks like this:command="/usr/bin/rsync --server --sender -vlogDtprze . /path/mydata",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa [..]= user@domain.tldI then can rsync the remote directory to a local location over SSH by running:
rsync -avz -P --delete -e 'ssh remote_user@rsync.domain.tld' rsync.domain.tld:/path/mydata/ /path/mydestThat's it.
Hello, World
Been a while since my last blog post - things have been a bit hectic lately, and I ve not really had the time.
Now that things have settled down a bit I m in DC! I ve moved down south to join the rest of my colleagues at
Apparently, people care when you, as privileged person (white, male,
long-time Debian Developer) throw in the towel because the amount of
crap thrown your way just becomes too much. I guess that's good, both
because it gives me a soap box for a short while, but also because if
enough people talk about how poisonous the well that Debian is has
become, we can fix it.
This morning, I resigned as a member of the systemd maintainer team.
I then proceeded to leave the relevant IRC channels and announced this
on twitter. The responses I've gotten have been almost all been
heartwarming. People have generally been offering hugs, saying thanks
for the work put into systemd in Debian and so on. I've greatly
appreciated those (and I've been getting those before I resigned too,
so this isn't just a response to that). I feel bad about leaving the
rest of the team, they're a great bunch: competent, caring, funny,
wonderful people. On the other hand, at some point I had to draw a
line and say "no further".
Debian and its various maintainer teams are a bunch of tribes (with
possibly Debian itself being a supertribe). Unlike many other
situations, you can be part of multiple tribes. I'm still a member of
the DSA tribe for instance. Leaving pkg-systemd means leaving one of
my tribes. That hurts. It hurts even more because it feels like a
forced exit rather than because I've lost interest or been distracted
by other shiny things for long enough that you don't really feel like
part of a tribe. That happened with me with debian-installer. It was
my baby for a while (with a then quite small team), then a bunch of
real life thing interfered and other people picked it up and ran with
it and made it greater and more fantastic than before. I kinda lost
touch, and while it's still dear to me, I no longer identify as part
of the debian-boot tribe.
Now, how did I, standing stout and tall, get forced out of my tribe?
I've been a DD for almost 14 years, I should be able to weather any
storm, shouldn't I? It turns out that no, the mountain does get worn
down by the rain. It's not a single hurtful comment here and there.
There's a constant drum about this all being some sort of conspiracy
and there are sometimes flares where people wish people involved in
systemd would be run over by a bus or just accusations of
incompetence.
Our code of conduct says, "assume good faith". If you ever find
yourself not doing that, step back, breathe. See if there's a
reasonable explanation for why somebody is saying something or
behaving in a way that doesn't make sense to you. It might be as
simple as your native tongue being English and their being something
else.
If you do genuinely disagree with somebody (something which is
entirely fine), try not to escalate, even if the stakes are high.
Examples from the last year include talking about this as a war and
talking about "increasingly bitter rear-guard battles". By using and
accepting this terminology, we, as a project, poison ourselves.
I was not much at home during the last two weeks, so not much to report
about RC bug activities. some general observations:
Big changes are always a complicated thing to get done and can be the harder the bigger or more diverse an organization is it is taking place in.
Transparency
Ideally every change is well communicated early and openly.
Leaving people in the dark about what will change and when means people have much less time to feeling comfortable about it or arranging with it mentally.
Especially bad can be extending the change later or or shortening transition periods.
Letting people think they have some time to transition only to force them to rush later will remove any credibility you have and severely reduce their ability to believe you are not crossing them.
Making a new way optional is a great way to create security (see below), but making that obligatory before the change even arrives as optional with them will not make them very willing to embrace change.
Take responsibility
Every transformation means costs.
Even if some change did only improve and did not make anything worse once implemented (the ideal change you will never meet in reality), the deployment of the change still costs:
processes have adapted to it, people have to relearn how to do things, how to detect if something goes wrong, how to fix it, documentation has to be adopted and and and.
Even as the change causes more good than costs in the whole organization (let's hope it does, I hope you wouldn't try to do something if the total benefit is negative), the benefits and thus the benefit to cost ratio will differ for the different parts of your organization or the different people within it.
It's hardly avoidable that for some people there will not be much benefit, much less perceived benefit compared to the costs they have to burden for it.
Those are the people whose good will you want to fight for, not the people you want to fight against.
They have to pay with their labor/resources and thus their good will for your benefit the overall benefit.
This is much easier if you acknowledge that fact.
If you blame them for having the costs, claim their situation does not even exist or even ridicule them for not embracing change you only prepare yourself for frustration.
You might be able to persuade yourself that everyone that is not willing to invest in the change is just acting out of malevolent self-interest.
But you will hardly be able to persuade people that it is evil to not help your cause if you treat them as enemies.
And once you ignored or played down costs that later actually happen, your credibility in being able to see the big picture will simply cease to exist at all for the next change.
Allow different metrics
People have different opinions about priorities, about what is important, about how much something costs and even about what is a problem.
If you want to persuade them, try to take that into account.
If you do not understand why something is a reason, it might be because the given point is stupid. But it might also be that you miss something. And often there is simple a different valuation of what is important, what the costs are and what are problems.
If you want to persuade people, it is worth to try to understand those.
If all you want to do is persuade some leader or some majority then ridiculing their concerns might get you somewhere.
But how do you want to win people over if you do not even appear to understand their problems.
Why should people trust you that their costs will be worth the overall benefits if you tell them the costs that they clearly see do not exist? How credible is referring to the bigger picture if the part of the picture they can see does not match what you say the bigger picture looks like?
Don't get trolled and don't troll
There will always be people that might be unreasonable or even try to provoke you. Don't allow being provoked. Remember that for successful changes you need to win broad support. Feeling personally attacked or feeling presented a large amount of pointless arguments easily results in not bringing proper responses or actually looking at arguments.
If someone is only trolling and purely malevolent, they will tease you best if they bring actual concerns of people in a way you likely degrade your yourself and your point in answering.
Becoming impertinent with the troll is like attacking the annoying little goblin hiding next to the city guards with area damage.
When not being able to persuade people, it is also far to easy to consider them in bad faith and/or attacking them personally. This can only escalate even more. Worst case you frustrate someone in good faith. In most cases you poison the discussion so much that people actually in good faith will no longer contribute the discussion. It might be rewarding short term because after some escalation only obviously unreasonable people will talk against you, but it makes it much harder to find solutions together that could benefit anyone and almost impossible to persuade those that simply left the discussion.
Give security
Last but not least, remember that humans are quite risk-averse. In general they might invest in (even small) chances to win, but go a long way to avoid risks.
Thus an important part of enabling change is to reduce risks, real and perceived ones and give people a feeling of security.
In the end, almost every measure boils down to that:
You give people security by giving them the feeling that the whole picture is considered in decisions (by bringing them early into the process, by making sure their concerns are understood and part of the global profit/cost calculation and making sure their experiences with the change are part of the evaluation).
You give people security by allowing them to predict and control things (by transparency about plans, how far the change will go and guaranteed transitions periods, by giving them enough time so they can actually plan and do the transition).
You give people security by avoiding early points of no return (by having wide enough tests, rollback scenarios,...).
You give people security by not letting them alone (by having good documentation, availability of training, ...).
Especially side-by-side availability of old and new is an extremely powerful tool, as it fits all of the above:
It allows people to actually test it (and not some little prototype mostly but not quite totally unrelated to reality) so their feedback can be heard. It makes it more predictable as all the new ways can be tried before the old ones no longer work. It is the ultimate role-back scenario (just switch off the new). And allows for learning the new before losing the old.
Of course giving the people a feeling of security needs resources. But it is a very powerful way to get people to embrace the chance.
Also in my experience people only fearing for themselves will usually mostly be passive by not pushing forward and trying to avoid or escape the changes.
(After all, working against something costs energy, so purely egoistic behavior is quite limiting in that regard).
Most people actively pushing back do it because they fear for something larger than only them. And any measure to making them fear less that you ruin the overall organization, not only avoids unnecessary hurdles rolling out the change but also has some small chance to actually avoid running into disaster with closed eyes.
A common way to build a firewall ruleset is to run a shell script
calling
I've been crap about blogging lately. Let's see if I can fix
that.
Back in February and March, Jo and I went on vacation for 2 weeks
touring California and Nevada. We had an awesome time and we got to
see and do lots of fun stuff. I'm not going to go into all the
details, as it's a long time ago now...! I've got a massive set
of
I guess I'm not the only one who's been annoyed by shower curtains
sticking to me in the shower, but I'd not really paid much thought to
it until now. Suddenly, as of maybe 18 months ago I'm seeing most
hotel bathrooms replacing the straight curtain track with a curved
one, to stop that happening. This photo shows that process with both
tracks visible...
Waterproof/washable TV remotes
This one really surprised me. As Jo will attest, I
have a little bit of an obsession with TVs and set-top boxes in hotel
rooms. This dates from my time working for Amino where we made set-top
boxes, and I got into the habit of checking what products were in the
hotels I stayed in. I've seen a range of weird and wonderful setups
over the years, but never this one before. In two of the hotels on our
trip, they had replaced the normal TV remotes with washable/wipe-down
ones. Weird...
I left Debian. I don't really have a lot to say about why, but I do
want to clear one thing up right away. It's not about systemd.
As far as systemd goes, I agree with my friend John Goerzen:
