how can i get the cpuinfo of remotely connected system in centos? - linux

i am a newbie to linux(Centos 6.3) . Please forgive me for this simple question.
in my localhost i'll get the cpuinfo by using this cat /proc/cpuinfo.
if i want to get the remote system which is connected in my network.
Is it possible to get with out ssh ???
if not, how can i do that with out password for ssh. I red some posts, generating rsa keys in remote machines and copying to my localhost. With out these, is it possible to get cpuinfo and meminfo of remotely connected machines.
Because i want to display the info in Php. That's why i m afraid of ssh. Because if the user change password, again i need to generate keys and copying them to my .ssh folder...
is there any easy way to do that ??

I used to use staf for this purpose http://staf.sourceforge.net/, all you need to do is set trust between machines, nothing to worry about authentication. alternatively you can write a daemon (program) which just push the cpuinfo and meminfo to clients on request.

Related

Windows program to communicate with Virtualbox

I am wondering if it is possible to write a program on Windows that communicates with a program within a Linux Virtualbox on the same machine. If this is possible, what is the best approach to doing this? Is there a way to do this without using the internet to communicate?
I found instructions showing how you could potentially use SSH, but I have never tried doing this before, so I do not know if using SSH to communicate would be the best option.
I was going to put this as a comment to a very vague question, but then it got too long.
It depends what you mean by "communicate"....
If the Windows machine should start a program on the Linux VM, you probably want plink.exe - see here.
If you want to transfer whole files, you probably want scp or FTP or FileZilla - see here.
If you want to send small messages occasionally, maybe netcat, also known as nc - see Netcat Cheatsheet here.
If you want full-on, high speed, continuous messages, maybe sockets or some messaging protocol like mqtt.
If you want to share data structures, like lists, queues or sets, you could allow both Windows and the Linux machine to access a shared Redis database - see here.
Or maybe it is enough to share a filesystem between the two machines - in which case you can make a Shared Folder in VirtualBox on your host and the VM can just mount that and read/write it. See diagram:

How To Find Credentials of Host Machine in VM?

I thought I was sshing into an old server, but it turns out to be a VM into which I ssh'd. I don't know the credentials of the host machine and would like to get this to connect to it directly. Is there a way I can find this through the VM?
EDIT:
Suppose I just want whatever I can get - in this case, perhaps just the IP, as robmathers notes.
dmidecode | egrep -i 'system-product-name'
gives me "VMware Virtual Platform".
No. Passwords in Linux are stored in encrypted form and you can't read them. But if you can change the password by mounting the virtual hard drive and modifying /etc/shadow (unless the drive is encrypted). There are many guides how to do that.

How to copy files on remote Windows to local Linux on a Linux machine?

Currently, I'm working on a local Linux machine. I'm trying to use scp or similar Linux command-line tools to copy files from a remote Windows machine to my local Linux. I did some searching and found that most of the solutions are for local Windows cases (like putty and winscp), which don't really help.
Please advise.Thank you.
[UPDATE] Solved by installing cygwin's sshd service on Windows.
If you really want to use SCP, you will need an SCP server (actually an SSH server) on the Windows machine.
For example freeSSHd.
You will need to choose one of the options based on your own needs, there are a number of similar tools and freeSSHd was the first in the list on Google. I've used the Bitvise SSH Server in the past but it is only free for non-commercial use.
They are usually very easy to set up. You install them the usual way and run them for the first time. Depending on the tool, they may pick up your existing Windows users or you may need to manually create some users with passwords within the tool. Then, armed with your PC's IP address, you should be able to connect to the PC using SSH from the Linux command line.
If the windows system has a shared folder you should be able access that with smbclient which is part of the terrific samba project.
Usually somthing like:
smbclient //winmachine/share
Possibly using the -U username options to specifiy the username on the windows box.
Once connected, you can use cd to change folders, and get to retrieve files.
If there is no file share.... I dunno. Create one?
Syntax for copying from remote Windows 10 machine with built-in SSH server. Note forward slashes and drive style. Domain is not necessary.
scp user#domain#example.com:c:/path/to/file.txt .

How to contact linux ClearCase clients from Windows servers

I am working on trying to get some linux Clearcase clients to work with our existing Windows infrastructure. All of the vobs and servers are stored on Windows machines.
Using an existing vob, I was able to create a tag in the linux region to refer to the vob, and then create a view on the linux client. This client was able to connect to the vob and pull the files in when I updated the config spec. However, while it can view files, it does not have permission to edit them.
The usernames match
linux: user1
windows: DOMAIN\user1
The Clearcase admin panel is set to "Use this domain to map UNIX user and group names" with DOMAIN selected.
However, the authentication does not appear to be working. From the unix client, if I run
credmap windowsServer
I get Nobody/Nobody for the remote username and group ID. If I run from the Windows server
credmap linuxClient
It times out and I get
credmap: Error: Unable to contact albd_server on host
Investigating further albd_list on unix shows that the albd server is running, and even finds the albd_server on the windows machine.
albd_server addr = 166.20.20.81, port= 371
albd_list 166.20.17.118
albd_server addr = 166.20.17.118, port= 371
Going in the opposite direction returns
albd_list 166.20.20.81
noname: Error: Unable to contact albd_server on host '166.20.20.81'
cannot contact albd
Ping works from the windows host to the linux host, and I am even connected to the linux host by SSH from the parent at the moment.
If anyone has any ideas on what to look for next, you'd be my hero :(
You get limited ClearCase functionality when you access a ClearCase server (running on Windows) from a Linux client. To learn more, read about CCFS.
I'd suggest you to consider migrating your VOB server to Linux. This way you get all ClearCase functionality, including dynamic views.
I confirm having Vob server on windows mean they won't be fully accessible from linux client, even though the official documentation from IBM describes the CCFS setting to follow.
(See "Configure UNIX or Linux clients to access Windows VOBs", which you must have seen)
In particular, I never managed to have a credential mapping fully working from Linux to windows (the other way works well).
And you need to make sure your view storage is accessible from Linux (see "Creating a view on a NAS device")
That leaves you with inter-environment solutions, like:
CCRC (ClearCase Remote Client, for CC7.x)
ClearTeam (for CC 8.x)
See "Feature Comparison Matrix for CCRC, CTE, CCWeb, Native ClearCase GUI and SCM Adapter".
This wound up being something stupid. There was a firewall running on the linux machine blocking the albd_server port.
This also did not resolve the credential mapping issues, but it at least let me eliminate one more potential cause. Thanks

How to specify local machine when already sshed into another computer?

It's easy to simply scp from another computer to the local one or vice versa. However, how to do it when you already sshed into another computer?
user#anothercomp:~/$ssh ~/path/file (how to specify local computer?):~/localpath/file
Note that my computer is a personal laptop instead of a server, so answers here Download files to local drive when sshed do not apply since it requires to specify the domain name, and my laptop is no server.
So what's the correct way to specify my local computer? (Please don't say exit ssh and then scp, since it will possibly lose temporary data when working)
You don't need to exit ssh, you can run scp from another virtual terminal in your laptop.
For convenience, you may want to try connection sharing, to avoid the need to enter passwords again; you may either use ssh -M or modify ~/.ssh/config. See man ssh and man ssh_config for details.
By SSH'ing into the second machine you lose the context of your first. For the purpose of transferring files the second machine would need to scp the files to the first, or could use a different (yet similar) approach such as sshfs.
If the issue is that the second machine does not have network access to the first, then tunneling is the likely solution. However, this just enabled scp or sshfs to connect--it doesn't let your ssh session access paths or variables from your local machine.
While your computer does not have a domain name, it still has an IP address, so you can connect to the IP address. You can retrieve the address from the SSH_CLIENT variable. See How to get the IP address from $SSH_CLIENT.
Obviously to ssh or scp to your computer, you need to be running an SSH server there. What is not common, if you are running Windows, in particular.

Resources