create account

RE: How to secure a server with an encrypted volume to back up your home folder. by xeroc

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @l0k1/how-to-secure-a-server-with-an-encrypted-volume-to-back-up-your-home-folder

· @xeroc ·
$1.27
The major problem with your approach is the `PASSWORD` is stored in clear text on your disk. Instead of using a password, I use SSH-keys. It works like this:

1. **Create a ssh key**

       ssh-kegen

2. **Store the key in the server's authorized key**

       ssh-copy-id <user@server>

    This step adds the content of `~/.ssh/id_rsa.pub` (the public key) to the `~/.ssh/authorized_keys` file **on the server**. This file is used by the server to verify if the user is allowed to login (only if he has the corresponding private key)

3. **Login**

   SSH automates the whole process with keyesxchange and stuff so that you only need to do

       ssh <user@server>

    If everything is setup properly you don't even need to provide a password.

Have fun!
👍  , , , , , , , , , , , , ,
properties (23)
authorxeroc
permlinkre-l0k1-how-to-secure-a-server-with-an-encrypted-volume-to-back-up-your-home-folder-20160907t060107508z
categorydevelopment
json_metadata{"tags":["development"]}
created2016-09-07 06:01:06
last_update2016-09-07 06:01:06
depth1
children2
last_payout2016-10-08 05:43:09
cashout_time1969-12-31 23:59:59
total_payout_value1.270 HBD
curator_payout_value0.001 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length759
author_reputation118,819,064,085,695
root_title"How to secure a server with an encrypted volume to back up your home folder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,155,610
net_rshares2,357,723,053,966
author_curate_reward""
vote details (14)
@l0k1 · (edited)
Yeah, I think, though, what's the damn difference anyway? If someone gains control of my user account on my machine, does it actually matter if  they have the password or SSH cert for the root of my backup server? The result is the same.

It was just quicker for me to do it with a password. I don't have to remember it either, it's in my scripts. Good to remind me though, it should really be set to 700 mode. I am pretty sure they are though.

btw, i think it's **ssh-keygen** , just a little typo. I don't think you get grammar nazi status in IT for typo correcting ;)
👍  
properties (23)
authorl0k1
permlinkre-xeroc-re-l0k1-how-to-secure-a-server-with-an-encrypted-volume-to-back-up-your-home-folder-20160907t081011276z
categorydevelopment
json_metadata{"tags":["development"]}
created2016-09-07 08:10:12
last_update2016-09-07 08:12:48
depth2
children0
last_payout2016-10-08 05:43:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length571
author_reputation94,800,257,230,993
root_title"How to secure a server with an encrypted volume to back up your home folder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,156,452
net_rshares242,307,857
author_curate_reward""
vote details (1)
@realme ·
As @l0k1 pointed out, simply using keys doesn't make much difference. But what you can do to improve the security of the server, is restricting the commands that can be run. You can do this by using the option `command="..."` in the `authorized_keys` file. Then, for each command you create a separate key. The man page `sshd(8)` has some information on this in the section "AUTHORIZED_KEYS FILE FORMAT".
👍  
properties (23)
authorrealme
permlinkre-xeroc-re-l0k1-how-to-secure-a-server-with-an-encrypted-volume-to-back-up-your-home-folder-20160907t160709003z
categorydevelopment
json_metadata{"tags":["development"],"users":["l0k1"]}
created2016-09-07 16:07:12
last_update2016-09-07 16:07:12
depth2
children0
last_payout2016-10-08 05:43:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length404
author_reputation49,351,409,465
root_title"How to secure a server with an encrypted volume to back up your home folder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,160,281
net_rshares242,307,857
author_curate_reward""
vote details (1)