monitor local file excution/access history triggered by a remote server - ssh

My question is somewhat similar to this, but a little different from that:
I want to monitor the file execution/access history on a CentOS 7.2 machine. I know that a remote server is calling some files on my local machine through SSH in order to finish some tasks, so I want to find out what files on my local machine that the server is calling.
I tried to use the terminal command:
ls -lu
but it didn't show any invocation history that was triggered by the remote server through SSH. Later I learned about inotify. But I also heard that it's not available on Centos 7. Is it true? If not, how should I use it? I didn't find a dirty and quick inotify tutorial for centos. Is there any system logs that records this type of information? Any other ideas on how to achieve my goal?

Related

Can I run one WSL2 virtual machine instance on two system?

I'm new to the WSL2 and wondering if it's possible to run the same WSL2 ubuntu instance on both my desktop and laptop.
Now I am able to use wsl --export and wsl --import method to save and load the system to/from my portable hard drive. But these methods takes a long time.
I notice that wsl --import load a file named ext4.vhdx. Is there a way to load straightly from this file?
Update v2.0:
I was able to get a workaround and it works great.
Thanks to Booting from vhdx here, I was able to load straightly from my vhdx file on my portable hard disk. Windows track down its subsystem with regedit, So we can write our own(p.s: make sure to get BasePath right, it starts with "\\\\?", or you will not be able to access the subsystem' filesystem on your host system.):
Windows Registry Editor Version 5.00
[HKEY_USERS\【your SID here】\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{【UUID here】}]
"State"=dword:00000001
"DistributionName"="distribution name"
"Version"=dword:00000002
"BasePath"="vhdx folder path" 【 e.g. "\\\\?\\E:\\S061\\WSL\\ubuntu-20"】
"Flags"=dword:0000000f
"DefaultUid"=dword:000003e8
I suppose the best way to do this would be to store ext4.vhd on a network storage device accessible to both devices.
I have previosly mentioned how to move ext4.vhd. You can check that out here
Basically you need to export from one machine and import it while making sure the vhd file is configured for wsl to access from the network storage
Since this should *officially* not supported expect some performance hits
Another way would be to run WSL on one computer and ssh/remote desktop to it from another device on the network
I'm of the strong belief that sharing the same ext4 vhd between two VM's simultaneously would be a bad idea. See this and this Unix & Linux StackExchange, including the part about ...
note that sharing LVs/partitions on a single disk between the servers at the same time is NOT very safe. You should only access whole disks from any of the servers at one time.
However, as dopewind's answer mentioned, you can access the WSL instance on one computer (probably the desktop) from another (e.g. the laptop). There are several techniques you can use:
If you have Windows 10 Professional or Enterprise on one of the computers, you can enable Remote Desktop, which allows you to access pretty much everything on one computer from another. RDP ("Remote Desktop Protocol") even works from other devices such as an iPad or Android tablet (or even a phone, although that's a bit of a small screen for a "desktop"). That said, there are better, more idiomatic solutions for WSL ...
You could enable SSH server on the Windows 10 computer with the WSL instance (instructions). This may sound counterintuitive to some people, since Linux itself running in the WSL instance also includes an SSH server (by default). But by SSH'ing from (for example) your laptop into your desktop's Windows 10, you can then launch any WSL instance you have installed (if you choose to install more than one) via wsl -d <distroName>. You also avoid a lot of the network unpleasantness in the next option ...
You could, as mentioned above, enable SSH on the WSL instance (usually something like sudo service ssh start) and then ssh directly into it. However, note that WSL2 instances are NAT'd, so there's a whole lot more hackery that you have to do to get access to the network interface. There's a whole huge thread on the WSL Github about it. Personally, I'd recommend the "Windows SSH Server" option mentioned about to start out with, then you can worry about direct SSH access later if you need it.
Side note: Even though I have SSH enabled on my WSL instances, I still use Windows SSH to proxy to them, to avoid these networking issues.

Remote interaction via VNC+Expect?

I've being doing a installation process in several machines in virtualbox and I'd like to try automated this process. I can do a expect script (see below), however I can't connect through ssh because this script will configure the network stuff after some other processes.
Where I work now, we use the vmware esxi and I am trying to discover if it's possible to automated the installation process that I said if I setup the vnc viewer in the guest machine. I can do the all process if I do it manually, but I'd like try to automated it. Although I think a expect script will be fine, I'm not connecting by ssh. Is it possible?? I started to think that maybe expect is not my answer here.
The processes is something like this:
Receives "Choose a option: ", sends "1\n"
Receives "Press any key", sends "\n"
Repeat step 2 more two times.
Receives "Do you agree (y/n)?", sends "y\n"
And so on.
The host as I said is a vmware esxi, the guest is similar to a linux and my machine is a fedora 20 (I'm saying this because I dont like the idea of install stuff on esxi).

Configure SVN on WIndows 8

I am new in SVN configuration. I have Windows 8 with 4 drives. I am planing to configure TortoiseSVN 1.7.12 on one of drive and will do the checkout from another drive.
I have installed it but unable to configure it as SVN server.
How can i configure it?
Appreciate you help on this.
Thanks in advance.
You can't get TortoiseSVN configured as a server because it's not a server. TortoiseSVN is a client.
If you wish to run a server, you need to acquire & install Apache (if you want to use HTTP access) and a Win32 command-line build of Subversion (no matter what). You may find this easier via one of the pre-built packages such as CollabNet Subversion Edge, VisualSVN Server, or uberSVN
If you're going to be sharing with someone else, get a separate server set up and managed properly - don't run it off your desktop (what happens when your hard drive crashes, or you go away on vacation?).
The current stable version of TortoiseSVN is 1.7.13. You might consider using that.
Server configuration is an activity which you should do after careful preparation.
You may read the details here:
http://svnbook.red-bean.com/en/1.7/svn.serverconfig.html

Remote Profiling Jprofiler

Hi i am very new to Jprofiler & Linux.
I am trying to Monitor my Apache Tomcat server installed on a linux machine from Jprofiler remote profiling which is installed on windows machine. Kindly help me in the procedure in detail.
I tried all the Help i could get from google but still stuck..any help will is appreciated. Thanks in advance.
In any case, you should extract the JProfiler tar.gz file for Linux on the remote machine. No further configuration is required on the remote side. On the local side you need a full installation of JProfiler.
There are two ways to get remote profiling to work:
A. Attach to the running Tomcat process
Execute the command line utility bin/jpenable in the JProfiler distribution on the remote machine and select the Tomcat process. The JVM will then be ready for profiling. If the profiled JVM is not listed, execute jpenable as the same user that runs the Tomcat JVM. If that does help, use alternative B.
On the local machine, create a session of type "Attach to profiled JVM (local or remote)", specify the host name of the remote machine and the profiling port that was set with jpenable.
When you start session, the JProfiler GUI will connect to the remote machine and you will see profiling data.
B. Use the integration wizard
Execute the command line uutility bin/jpintegrate in the JProfiler distribution on the remote machine and select your application server and follow the subsequent steps.
Then, proceed as in alternative A. This option is actually preferable to alternative A and unless you have to profile an already running JVM, you should take this route.

run gnu-screen/tmux/byobu from client

I need to understand a fundamental concept about terminal multiplexers yet I can't seem to find the answer.
As I understand these programs need to be installed on server but not necessarily on clients. It's not a problem with gnu-screen as it is already installed on most systems but it's not the case for tmux and byobu. The problem is that I don't have permission to install software on the server. Is there a way I can run byobu from my client to show statistics about the server I connect?
Also what exactly is the effect of 'byobu-enable' option?
I think there is a misunderstanding here. When you connect to the server and run a command (byobu in this case), you are running the command on the server. Statistics reported are for the server. It's possible to open a byobu session on your own desktop of course, but if you're ssh'd into a machine, you're very likely to be executing commands on that machine.
byobu-enable sets byobu to launch automatically when you open a terminal. I don't do this since you can have confusion if you have byobu running locally and on the remote end you have connected to, which causes problems when you try to interact with byobu itself.