Monday, 26 April 2021

Managing Github repository for custom app

Creating Github repository

echo "# custext" >> README.md

git init

git add README.md

git commit -m "first commit"

git branch -M main

git remote add origin https://github.com/valignit/custext.git

git push -u origin main


Updating Github repository

git status

git add .

git commit -m "v-x.y"

git push


Sunday, 11 April 2021

Allowing non root users to login through putty

 vi /etc/ssh/sshd_config append last line AllowUsers erpuser

service sshd restart

mkdir /home/erpuser/.ssh

cp ~/.ssh/authorized_keys /home/erpuser/.ssh/authorized_keys

chown erpuser /home/erpuser/.ssh/authorized_keys

su erpuser

chmod 600 /home/erpuser/.ssh/authorized_keys

exit

service sshd restart

Wednesday, 31 March 2021

How to setup vncserver in

SERVER SIDE
===========
apt update
apt install xfce4 xfce4-goodies tightvncserver
apt install xfonts-base x11-xserver-utils

# Prompts to set up password for VNC server here...
vncserver

# Allow clients to connect to X server from any host
export DISPLAY=:1
xhost +
vncserver -kill :1
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak

# Creating proper config and restarting the server
cat << EOF > ~/.vnc/xstartup
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
EOF

# Creating a user account
chmod +x ~/.vnc/xstartup
export USERNAME="vncuser"
useradd --create-home $USERNAME
adduser $USERNAME sudo
passwd $USERNAME

# Copy ssh keys to new user
mkdir -p /home/$USERNAME/.ssh
cp ~/.ssh/authorized_keys /home/$USERNAME/.ssh/
chown -R $USERNAME:$USERNAME /home/$USERNAME/.ssh

# Copy VNC settings to a new user
mkdir -p /home/$USERNAME/.vnc
cp ~/.vnc/xstartup /home/$USERNAME/.vnc/
chown -R $USERNAME:$USERNAME /home/$USERNAME/.vnc/
touch ~/.Xauthority Log


# Stop command. Just in case. Ignore errors here
su $USERNAME -c "vncserver -kill :1"

# Start VNC server
su $USERNAME -c "vncserver -depth 24 -geometry 1280x800"
su vncuser -c vncserver

CLIENT SIDE
===========
Download and install tightvnc viewer
https://www.tightvnc.com/download.php
Ensure vncserver is started in server side
Launch tightc vncviewer
specify ipaddress as server-ip-address:port 
(eample:143.198.113.69:5901)
Password will be accepted

VNC TERMINAL will be launched

Friday, 24 January 2020

Tuesday, 17 December 2019

Enable SFTP on Ubuntu 16.04

AT SERVER
==========
sudo adduser ftpuser
sudo mkdir -p /var/sftp/uploads
sudo chown root:root /var/sftp
sudo chmod 755 /var/sftp
sudo chown ftpuser:ftpuser /var/sftp/uploads

vi /etc/ssh/sshd_config and append the following at the end
Match User ftpuser
ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/sftp
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

sudo systemctl restart sshd

AT FILEZILLA
===========
host = IP address of server
user = ftpuser
password = *****
port = 22