Categories
Uncategorized

Virtual box: share folders between Windows host and Ubuntu guests

Virtual box ver: 5.22

Create a folder in windows, i.e c:\shared
Open virtualbox.
Select your guest OS, i.e Ubuntu
Click settings
click Shared Folders, and add c:\shared  (enable auto mount)
Click OK
Start your guest OS (Ubuntu)
Login to your guest OS
Click Devices, click “Insert Guest Additions CD image…”
If the installation fails, install linux-headers with the following command
[su_note] sudo apt-get install linux-headers-$(uname -r) [/su_note]
Try again, click Devices,  “Insert Guest Additions CD image…”

Now check what shares are available.
[su_note] sudo VBoxControl sharedfolder list [/su_note]
You should see:
[su_note] 1. shared [/su_note]

Mount it:
First create a folder on your linux host, i.e mkdir  winfolder
then mount it.
[su_note] sudo mount -t vboxsf shared  ~/winfolder [/su_note]

Categories
Uncategorized

a start job is running for raise network interfaces

1.- edit, then reboot
[su_note]  /etc/systemd/system/network-online.targets.wants/networking.service [/su_note]
change timeout from 5 min to 1min
[su_note] TimeoutStartSec=5min [/su_note]

Categories
Uncategorized

Passwordless ssh login to a server

1.- on the client side, generate the public ssh key
Press enter at each prompt.
[su_note]ssh-keygen[/su_note]

2.- Transfer pub key to remote server
[su_note]ssh-copy-id -i ~/.ssh/id_rsa.pub username@remotehost [/su_note]

3.- now test, it, from the client side

[su_note] ssh username@remote [/su_note]
or if the username on the remote server is the same as the username on the client side, use
[su_note]ssh remoteserver [/su_note]

Categories
Uncategorized

Configure NIS client with NFS share on Ubuntu 16.04

1.- Edit /etc/hosts and and nis server host/ip
[su_note]
#localhost is your linux client hostname
127.0.1.1  localhostname.domain.com  localhost
192.168.1.10  mynisvr.test.com
[/su_note]
2.- install portmap, ypbind, nfs-common and nis
[su_note] apt-get install nfs-common nis -y [/su_note]

2.1 to mount nfs home dirs install autofs5
[su_note] apt install autofs5 [/su_note]
2.a) Enter your nis domain, i.e tempnet or whatever your nis domain server is. To find out the domain name, from another client computer that’s already connected to a nis server, do [su_note] cat /etc/defaultdomain [/su_note]
3. Edit /etc/yp.conf
[su_note] ypserver 192.168.1.11
ypserver 192.167.1.12[/su_note]
4. Edit /etc/passwd,  /etc/group and /etc/shadow and add the following at the end of the file.
For passwd with six :[su_note] +::::::[/su_note]
For  group with 3 :[su_note]+:::[/su_note]
For shadow with 8 : [su_note]+::::::::[/su_note]
5: edit /etc/nsswitch.conf
[su_note]
automount:  files nis
netgroup:      nis
[/su_note]
6. Configure Ubuntu for manual login by creating a nis file:  This only works for  the gnome desktop.
/etc/lightdm/lightdm.conf.d/nis.conf
[su_note]
[SeatDefaults]
greeter-show-manual-login=true
user-session=true
[/su_note]

For Unity, the file location is sudo /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
[su_note]
[SeatDefaults]
greeter-show-manual-login=true
guest-session=false
[/su_note]

6: Troubleshooting:
6.1 Test connection using ypwhich fails, export firewall from a known client.
[su_note]iptables-save > firewallclientconfig.txt[/su_note]
now import on new client
[su_note] itables-restore < firewallclientconfig.txt[/su_note]
6.2 With Ubuntu 16.04 the rpcbind daemon won’t start before the nis service. Run the following to fix it.
[su_note]sudo systemctl add-wants multi-user.target rpcbind.service[/su_note]
You should get a message that says
[su_note]Created symlink from /etc/systemd/system/multi-user.target.wants/rpcbind.service to /lib/systemd/system/rpcbind.service[/su_note]

Another troubleshooting step: do a
[su_note] su – remoteusername [/su_note]
if it complains about “cannot execute /bin/tcsh no such file or directory”, do
[su_note] apt-get install tcsh [/su_note]

If you cannot login using your nis credentials. Press Alt + F2. Use your local credentials to login and then add your nis username to the sudoers list.
[su_note]
sudo adduser nisusername sudo
[/su_note]

Log out and log back using your nis credentials. You should be able to check the logs for further troubleshooting /var/log/syslog   /var/log/auth.log   /var/log/lightdm/lightdm.log

If you are upgrading from Trusty (14.04) to Xenial (16.04), you may need to install gnome desktop.
[su_note]
sudo apt install ubuntu-gnome-desktop
[/su_note]

Check if mount points are ok.
[su_note] showmount -e NFS-server-IP-addr [/su_note]