not able to clone repo via ssh (gitea) - ubuntu-14.04

I've tried to deploy the 'gitea' on my virtual machine.
gitea version is:
$ ./gitea -v
Gitea version 1.3.2 built with: bindata, sqlite
os:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
gitea config:
SSH_DOMAIN = <ip address>
DOMAIN = <ip address>
HTTP_PORT = 3000
ROOT_URL = https://<ip address>/
DISABLE_SSH = false
SSH_PORT = 2222
LFS_START_SERVER = true
LFS_CONTENT_PATH = /home/git/data/lfs
LFS_JWT_SECRET = Sxp3S45YtJMKPzVpcQZ9OvltVkTRGzdUVd4jU95irsE
OFFLINE_MODE = false
PROTOCOL = https
CERT_FILE = /home/git/cert.pem
KEY_FILE = /home/git/key.pem
SSH_ROOT_PATH = /home/git/.ssh
START_SSH_SERVER = true
SSH_LISTER_PORT = 22
everything works fine except ssh. I mean I am able to work with repo via https,
but I have no luck in using ssh
the error is displaying:
$ ssh -T git#<ip address>
Hi there, You've successfully authenticated, but Gitea does not provide shell access.
If this is unexpected, please log in with password and setup Gitea under another user.
Can someone assist me in fixing that matter?

this issue can be fixed by disabling LFS server
root#ACA80006:/home/test# grep -i lfs_start_server /home/git/custom/conf/app.ini
LFS_START_SERVER = false

Related

ping cassandra on virtualbox guest from windows host

I'm using virtual box to act as Linux guest to Cassandra DB, and I'm trying to access it through my windows host, however, i don't know what are the right configurations to do that.
on virtual box I'm using "host only networking" to communicate from windows.
Anyone knows how to do these configurations?
Maybe, it's the network configuration of the guest.
In VirtualBox environment, if you want communicate to the guest from the host, the network type of the VM must be "bridged networking" or "host only networking".
You can find more information here : https://www.virtualbox.org/manual/ch06.html.
Access Cassandra on Guest VM from Host OS
For future reference to myself and others, this worked for me for Cassandra v3.10:
http://grokbase.com/t/cassandra/user/14cpyy7bt8/connect-to-c-instance-inside-virtualbox
Once your Guest VM is provisioned with Cassandra, I had a host only network adapter set with IP 192.168.5.10.
Then had to modify /etc/cassandra/cassandra.yaml to set:
From
rpc_address: localhost
To
rpc_address: 192.168.5.10
Then run sudo service cassandra restart and give it 15 seconds...
Then on the guest VM or on the host the following worked:
cqlsh 192.168.5.10
Hope that helps someone.
Vagrantfile for reference
Note it doesn't work for multiple nodes in a cluster yet
# Adjustable settings
## Cassandra cluster settings
mem_mb = "3000"
cpu_count = "2"
server_count = 1
network = '192.168.5.'
first_ip = 10
servers = []
seeds = []
cassandra_tokens = []
(0..server_count-1).each do |i|
name = 'cassandra-node' + (i + 1).to_s
ip = network + (first_ip + i).to_s
seeds << ip
servers << {'name' => name,
'ip' => ip,
'provision_script' => "sleep 15; sudo sed -i -e 's/^rpc_address: localhost/rpc_address: #{ip}/g' /etc/cassandra/cassandra.yaml; sudo service cassandra restart;",
'initial_token' => 2**127 / server_count * i}
end
# Configure VM server
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/xenial64"
servers.each do |server|
config.vm.define server['name'] do |x|
x.vm.provider :virtualbox do |v|
v.name = server['name']
v.customize ["modifyvm", :id, "--memory", mem_mb]
v.customize ["modifyvm", :id, "--cpus" , cpu_count ]
end
x.vm.network :private_network, ip: server['ip']
x.vm.hostname = server['name']
x.vm.provision "shell", path: "provision.sh"
x.vm.provision "shell", inline: server['provision_script']
end
end
end
provision.sh
# install Java and a few base packages
add-apt-repository ppa:openjdk-r/ppa
apt-get update
apt-get install vim curl zip unzip git python-pip -y -q
# Java install - adjust if needed
# apt-get install openjdk-7-jdk -y -q
apt-get install openjdk-8-jdk -y -q
# Install Cassandra
echo "deb http://www.apache.org/dist/cassandra/debian 310x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
sudo apt-get update
sudo apt-get install cassandra -y
sudo service cassandra start
So you are trying to connect to Cassandra from Linux guest in your virtualbox? Or is it the other way around?
Anyways, whatever the direction make sure that you IP is reachable and that the Cassandra ports are open (start with 9042).

Add existing VM to TheForeman

I recently installed the foreman on a server and I want to add an existing VM as a host in foreman, but it seems that I can't achieve this through the GUI. The only option I have found is to add a NEW host, not an existing one. My VM wasn't registered with a puppet master either. Do I need to install puppet on my VM and add it manually to the puppet master that foreman includes? Is there a simpler way to do this with foreman's GUI?
I've only been able to accomplish this by manually configuring the host.
On your VM
First install puppet on the host ( EL Example ):
yum install puppet -y
Next you will want to configure the host's puppet.conf to point to your Foreman server as the Puppet master.
NOTE: Replace foreman-hostname.domain.com with the FQDN of your Foreman server.
NOTE: The line certname =hostname` assumes your hostname is set properly on your VM.
Run this to create the puppet config:
echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
[main]
vardir = /var/lib/puppet
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = \$vardir/ssl
[agent]
pluginsync = true
report = true
ignoreschedules = true
daemon = false
ca_server = foreman-hostname.domain.com
certname = `hostname`
environment = production
server = foreman-hostname.domain.com
EOF
Configure your server to start puppet agent on reboot ( EL Example ):
chkconfig puppet on
Check in with the puppet master you just configured and generate certs etc:
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server foreman-hostname.domain.com --no-daemonize
On the Foreman Server
Under smart proxies select certificates.
The click sign by your host and your host should be added!
Run puppet agent -t again, and it should check in.
Please understand this does not give Foreman control of your VM in terms of sending delete commands to the hypervisor and stuff. This just enables control of Puppet and adding the VM to hostgroups.
This process should be pretty easy automate too!

Not able to configure remote nrpe plugins for nagios

I have installed nagios server including nrpe & nagios plugins. Its working properly.
However I am trying to install nrpe & nagios plugins for remote host monitoring using nagios server, After the configuration is done & I am running below command for testing:
/usr/local/nagios/libexec/check_nrpe -H localhost
Output:
CHECK_NRPE: Socket timeout after 10 seconds. (And for some of the services its giving)
CHECK_NRPE: Error - Could not complete SSL handshake.
The port 5666 is listening on that server.
Can anyone please let me know what other changes to be made to get proper results of the above command.
Also please let me know if you need any more details about the configurations.
Sometimes this might also mean that the server is trying to perform a check with SSL while the NRPE daemon is not running with the SSL option (or the other way around).
Could you try running the check like below ?
/usr/local/nagios/libexec/check_nrpe -H localhost -n
You may need to check firewall.
Also make sure that both nagios and nrpe daemons are running.
You should have the openssl and openssl-devel installed
aptitude install openssl openssl-devel
Are you using Xinetd?
If you are, you should check the service configuration in /etc/xinetd.d/nrpe
You shoud have something like this:
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 127.0.0.1 <YouNagiosServerIP>
}
And Finally:
service xinetd restart

Making a user in Samba - Debian 6 32bit - No commands working?

I'm not very literate with Linux, so my terminology isn't great.
I purchased an offshore server I'm using to hold my files, it has Linux - Debian 6 32bit on it and I have installed and setup Samba.
I can access the Guest Share dir.
However, for operations I wanted to make it so I required a username and password, so I tried to manipulate it.
I have tried:
useradd samba-user -m -G users - Nothing happened
I'm unsure of the creation steps behind this and do not understand any of the guides (Due to me not following the terminology of it).
Any help would be much appreciated
Solution:
Setup
Apt-get upgrade
sudo apt-get install samba smbfs
sudo mkdir –m 0777 /pathofdrive
Editing the samba config
sudo vi /etc/samba/smb.conf
Copy this:
# Global parameters
[global]
workgroup = HOME
netbios name = SAMBA
server string = Samba Server %v
map to guest = Bad User
log file = /var/log/samba/log.%m
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
preferred master = No
local master = No
dns proxy = No
security = User
# Share
[Data]
path = /disk2/data
valid users = joel
read only = No
create mask = 0777
directory mask = 0777
Adding a user:
# useradd -c "Joel Nahrgang" joel
# smbpasswd -a joel
New SMB password: secret
Reenter SMB password: secret
Added user joel
Restarting Samba:
sudo /etc/init.d/samba restart

Can't clone a github repo on Linux via HTTPS

I'm trying to do a simple git clone https://github.com/org/project.git on a CentOS box but get:
error: The requested URL returned error: 401 while accessing
https://github.com/org/project.git/info/refs
fatal: HTTP request failed
It never prompts me for my username/password, just fails.
I can make the exact same call on my Mac no problem- what am I missing?
The answer was simple but not obvious:
Instead of:
git clone https://github.com/org/project.git
do:
git clone https://username#github.com/org/project.git
or (insecure)
git clone https://username:password#github.com/org/project.git
(Note that in the later case, your password will may be visible by other users on your machine by running ps u -u $you and will appear cleartext in your shell's history by default)
All 3 ways work on my Mac, but only the last 2 worked on the remote Linux box. (Thinking back on this, it's probably because I had a global git username set up on my Mac, whereas on the remote box I did not? That might have been the case, but the lack of prompt for a username tripped me up... )
Haven't seen this documented anywhere, so here it is.
You can manual disable ssl verfiy, and try again. :)
git config --global http.sslverify false
I met the same problem, the error message and OS info are as follows
OS info:
CentOS release 6.5 (Final)
Linux 192-168-30-213 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
error info:
Initialized empty Git repository in /home/techops/pyenv/.git/
Password:
error: while accessing https://waterdrops#github.com/pyenv/pyenv.git/info/refs
fatal: HTTP request failed
git & curl version info
git info :git version 1.7.1
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
debugging
$ curl --verbose https://github.com
About to connect() to github.com port 443 (#0)
Trying 13.229.188.59... connected
Connected to github.com (13.229.188.59) port 443 (#0)
Initializing NSS with certpath: sql:/etc/pki/nssdb
CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
NSS error -12190
Error in TLS handshake, trying SSLv3...
GET / HTTP/1.1
User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Host: github.com
Accept: /
Connection died, retrying a fresh connect
Closing connection #0
Issue another request to this URL: 'https://github.com'
About to connect() to github.com port 443 (#0)
Trying 13.229.188.59... connected
Connected to github.com (13.229.188.59) port 443 (#0)
TLS disabled due to previous handshake failure
CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
NSS error -12286
Closing connection #0
SSL connect error
curl: (35) SSL connect error
after upgrading curl , libcurl and nss , git clone works fine again, so here it is. the update command is as follows
sudo yum update -y nss curl libcurl
Make sure you have git 1.7.10 or later, it now prompts for user/password correctly. (You can download the latest version here)
I had to specify user name to work on 1.7.1 git version:
git remote set-url origin https://username#github.com/org/project.git
As JERC said, make sure you have an updated version of git. If you are only using the default settings, when you try to install git you will get version 1.7.1. Other than manually downloading and installing the latest version of get, you can also accomplish this by adding a new repository to yum.
From tecadmin.net:
Download and install the rpmforge repository:
# use this for 64-bit
rpm -i 'http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm'
# use this for 32-bit
rpm -i 'http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm'
# then run this in either case
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
Then you need to enable the rpmforge-extras. Edit /etc/yum.repos.d/rpmforge.repo and change enabled = 0 to enabled = 1 under [rpmforge-extras]. The file looks like this:
### Name: RPMforge RPM Repository for RHEL 6 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
mirrorlist = http://mirrorlist.repoforge.org/el6/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/extras
mirrorlist = http://mirrorlist.repoforge.org/el6/mirrors-rpmforge-extras
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
enabled = 0 ####### CHANGE THIS LINE TO "enabled = 1" #############
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/testing
mirrorlist = http://mirrorlist.repoforge.org/el6/mirrors-rpmforge-testing
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-testing
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
Once you've done this, then you can update git with
yum update git
I'm not sure why, but they then suggest disabling rpmforge-extras (change back to enabled = 0) and then running yum clean all.
Most likely you'll need to use sudo for these commands.
I was able to get a git 1.7.1 to work after quite some time.
First, I had to do disable SSL just so I could pull:
git config --global http.sslverify false
Then I could clone
git clone https://github.com/USERNAME/PROJECTNAME.git
Then after adding and committing i was UNABLE to push back.
So i did
git remote -v
origin https://github.com/USERNAME/PROJECTNAME.git (fetch)
origin https://github.com/USERNAME/PROJECTNAME.git (push)
to see the pull and push adresses:
These must be modified with USERNAME#
git remote set-url origin https://USERNAME#github.com/USERNAME/PROJECTNAME.git
It will still prompt you for a password, which you could add with
USERNAME:PASSWORD#github.....
But dont do that, as you save your password in cleartext for easy theft.
I had to do this combination since I could not get SSH to work due to firewall limitations.
This is the dumbest answer to this question, but check the status of GitHub. This one got me :)
I had the same problem and error. In my case it was the https_proxy not set.
Setting the https_proxy environment variable fixed the issue.
$ export https_proxy=https://<porxy_addres>:<proxy_port>
Example:
$ export https_proxy=https://my.proxy.company.com:8000
Hope this help somebody.

Resources