CentOS/Fedora/RedHat
Add sudo privileges
usermod -a -G wheel LinuxUsername
remove
sudo deluser username wheel
Ubuntu/Debian
Add sudo privileges
usermod -a -G sudo LinuxUsername
remove
sudo deluser username sudo
CentOS/Fedora/RedHat
Add sudo privileges
usermod -a -G wheel LinuxUsername
remove
sudo deluser username wheel
Ubuntu/Debian
Add sudo privileges
usermod -a -G sudo LinuxUsername
remove
sudo deluser username sudo
Install qemu-img
dnf install qemu-img -y
Convert the image. Change vmimage to your image name.
qemu-img convert -f qcow2 -O vmdk vmimage.qcow2 vmimage.vmdk
The reason is probably because the chrooted environment can’t resolve DNS.
Test it with
ping incredigeek.com
If it is not resolving, edit “/etc/resolv.conf” and change/add your nameserver. Or just replace everything in it with
echo "nameserver 4.2.2.2" > /etc/resolv.conf
It should now be able to resolve and you should be able to use yum, or dnf.
yum update
Debian / Ubuntu
sudo apt-get install -y openssh-server
RPM based Distros, Fedora / CentOS / RedHat
sudo dnf install -y openssh-server
or use yum
sudo yum install -y openssh-server
Start ssh service
sudo systemctl start sshd
By default the SSH service should start when the system starts, but if not try the following command to enable the service on boot up.
Debian / Ubuntu
systemctl enable ssh
Fedora, CentOS, RedHat
systemctl enable sshd
Change SSH port
Not necessary, but it is a good idea to change the default ssh port. To change the port edit the sshd file.
vi /etc/ssh/sshd_config
If you change the port, you’ll need to allow it in the firewall (firewalld, iptables) and if SELinux is enabled, semanage.
By default iptables firewall stores its configuration at /etc/sysconfig/iptables file. You need to edit this file and add rules to open port number.
Note: if you have SELinux enabled, you’ll need to allow the port with semanage.
To open a different port just enter the port number.
Open flle /etc/sysconfig/iptables:
# vi /etc/sysconfig/iptables
Append rule as follows:
A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Save and close the file. Restart iptables:
# /etc/init.d/iptables restart
or,
#service iptables restart
Verify that port is open
Run the following command:
netstat -tulpn | less
Make sure iptables is allowing the port you enabled:
iptables -L -n
If you need more info you can refer to the man page:
man iptables