1

enter image description here

I'm working locally on win10 with git-bash. I'm interested in setting up some basic security on an ubuntu 16.4 vps that I'm working on. I'm reading through https://www.codelitt.com/blog/my-first-10-minutes-on-a-server-primer-for-securing-ubuntu/ and http://plusbryan.com/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers.

Based on this I did:

 vim /etc/default/ufw

then:

IPV6=yes
sudo ufw allow OpenSSH
sudo ufw allow 80
sudo ufw allow 443

I then reset it.

I have a python fabric script which I have used successfully before on this server before making the security changes:

@roles('production')
def dir():
# env.key_filename = '~/.ssh/id_rsa'
# env.key_filename = 'E:\.ssh\id_rsa.pem.ppk'
env.key_filename = 'E:\.ssh\id_rsa_private'
local("pip freeze > requirements.txt")
local("git add . --all && git commit -m 'fab'")
local("git push myproject master")
run('pwd')
run('ls')
code_dir = '/home/deploy/myproject/'

with cd(code_dir):
    run('pwd')
    run('git reset --hard master')
    run('ls -la') 

Now when I run it I get :

debug1: Connecting to xx.xx.xx.xx [xx.xx.xx.xx] port 22.
debug1: connect to address xx.xx.xx.xx port 22: Connection refused
ssh: connect to host xx.xx.xx.xx port 22: Bad file number
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Fatal error: local() encountered an error (return code 128) while executing 'git push mysite master'

I turned on the windows 10 telnet client and ran "telnet xxx.xx.xx.xx 22" got:

Could not open connection to the host, on port 22: Connect failed 

But I believe port 22 is open because I can login with putty.

I've checked and on my vps my /home/deploy/.ssh/authorized _keys contains my id_rsa public key. I've tried various versions of the private key on the fabric script because I suspect that this is a key related problem.

One issue is that I now have a passphrase for my key but fabric does not pause to ask for this.

How can I get this working?

0

You must log in to answer this question.

Browse other questions tagged .