Using Nomachine through ssh tunner
Nomachine uses port 4000, however, the server may not have that port opened to your local IP. However, as long as you can ssh the server, you can use the following ssh tunnel to use Nomachine – securely and fast:
- From a ssh client, do: ssh -L <port>:localhost:4000 -N -f <username>@<nomachine_server>
- From your nomachine client, set host localhost, port of the port number as <port>
Here you go.
Scponly cannot chroot
Scponly from CentOS 7 cannot chroot. Problem is that /sbin/scponlyc does not have corrent SUID. Do a
chmod 4755 /sbin/scponlyc
resolves it.
Seagate NAS make no_root_squash
Seagate NAS create NFS shares as root_squash. This makes is inconvenient to use it as linux backup device. By remounting / as rw, editing /usr/lib/python2.7/site-packages/unicorn/sharing/nfs.py, change root_squash to no_root_squash, reboot, problem saved.
Ganglia under php7
Ganglia web interface cannot display charts in CentOS7, if php is updated to version 7.
This is because /usr/share/ganglia/cluster_view.php in line 34, $context_metrics[] was originally initialized as “”, in line 26.
If changing line 26 to
$context_metrics = [];
The problem is fixed.
ssh login slow, stuck on “pledge: exec” if -v
ssh to a linux box slow after keyed in password, taking 10+ seconds. If using ssh -v, found all the waiting spend on debug info:
debug1: pledge: exec
This usually happen when something stuck on the systemd-logind service.
Restart this service by running
systemctl restart systemd-logind
usually resolves this without rebooting the box.
When systemctl cannot start/stop services
This happens when systemd attemps to reload some previously saved state but was not able to. By “kill -1 1” to let it reload itself, systemctl works again without rebooting.
Rename an ethernet port
ip link set <name> down
ip link set <name> name <newname>
ip link set <newname > up
tar gzip a folder with progress bar
tar cf – folder_name -P | pv -s $(du -sb folder_name | awk ‘{print $1}’) | gzip > folder_zip.tgz
If build cannot find lib
export LIBRARY_PATH=/path
SSH tunnel
ssh -f username@remote.host -R <The IP of the interface you want to bind the port>:<port_on_remote_host>:localhost:22 -N
Without “The IP of the interface you want to bind the port”, it will only bind on loopback interface 127.0.0.1
To enable binding on other than loopback interface, you have to add
GatewayPorts clientspecified
in your /etc/ssh/sshd_config
and reload sshd.