Install Socat Cygwin

Posted on  by  admin

Install Socat Cygwin 5,6/10 2926 votes

I am currently trying to install and update a few packages on a Windows OS. The only matter is that I am using Cygwin in order to type the commands through a terminal (as I'm aware, I can type in L.

  1. Yum Install Socat
  2. Socat Proxy
  • You can, in a somewhat limited fashion. There’s a python script that fakes it here: nu774/sudo-for-cygwin I’ve used it with reasonable success.
  • Socat Stuff Socat is a multi-purpose relay tool. Socat on Cygwin/Windows An initial port of Socat to Cygwin/Windows is easily made: set up Cygwin.

I am currently trying to install and update a few packages on a Windows OS. The only matter is that I am using Cygwin in order to type the commands through a terminal (as I'm aware, I can type in Linux type commands such as cd, ls etc. on Cygwin - I may be wrong). However, when I try to install a package like:

I get the reply:

Does anyone have an idea as to how I can fix this problem?

AdamAdam

7 Answers

Cygwin is not a full Linux distribution. Therefore you don't have sudo or the Debian/Ubuntu package manager apt-get. There is a number of packages available from the Cygwin repository: http://cygwin.com/packages/You have to chose these packages during setup.

Socat
CalebCaleb

Run cygwin as administrator. then you wouldn't need any sudo command.

AimalAimal

Windows does not have sudo, apt, or almost any Linux commands to be exact. Cygwin may allow some, but as programs are not installed on Windows as packages apt-get will not work. Windows programs have installers as .exe or .msi instead.

The Windows version of sudo is called runas in case you need to run something as another user. Or, you can run Cygwin as administrator.

If you have to use the packages you need Linux. You can install it directly to replace Windows, dual-boot or use a virtualization software like VMware VirtualBox.

PurkkaKoodariPurkkaKoodari

Making out an explanatory answer from answer here by @Aimal as it worked for me.

Cygwin may not get permissions to create folders and files when run by clicking Cygwin icon that's in normal mode.

Cygwin gets the right authorization only when right click -> 'run as adminitrator' on cygwin icon because of that it gets permissions to create folders and files.

veer7veer7

Cygwin lets you run certain commands, such as cd, ls, or mv; but it doesn't let you run other commands, such as sudo or apt-get.

  • If you're trying to add a package to your Cygwin installation, rerun Cygwin Setup. It may still be in your 'Downloads' folder. Go through all the steps again. The Cygwin installer will automatically download and install the package you want, and add it to your Cygwin installation. (I think it will probably also upgrade all your other installed Cygwin packages to the latest available versions.)

  • If your desired package isn't on the Cygwin package list but is on the Cygwin Ports package list, follow the Cygwin Ports installation instructions. Note that Cygwin Ports is separate from Cygwin. Please do not send messages about Cygwin Ports packages to the cygwin.com mailing lists.

  • If you have years of Linux experience, you may be able to compile the software you want inside Cygwin. This can be challenging.

  • Perhaps an option simpler than 'compile it yourself' is this: You can install VirtualBox, then install your favorite Linux distribution inside the virtual machine, then install your desired package inside Linux. (I like Ubuntu Linux, which has more than 27,000 packages in its 'Universe' repository.) Now you can run Linux and Windows at the same time.

    One time, Lao Lao had brought him to Xi Ha and forced him to eat meat and love a woman. Serial silat mandarin. During his journey, he meet Lao Lao and Li Chiu Shui and had learned kungfu from them. Lao Lao and Li Chiu Shui hated each other deeply and were dead at the end because of revenge.

    Terjemah kitab shahih fiqih sunnah

unforgettableidunforgettableid

Yum Install Socat

I think I tried steps below after doing some research & succeeded (on windows)

1.Install scoop using powershell 3 (iex (new-object net.webclient).downloadstring('https://get.scoop.sh'))2. do scoop install --global sudo3. make sure paths (C:Usersscoopshims & C:ProgramDatascoopshims) added in environmental path variable.

Pawan GangwaniPawan Gangwani

In my case, I wanted to install curl, but could not create directory /usr/local/curl/lib when running command 'make install', because of permission deny. so i need to change /usr/local permission. when i run sudo chmod 755 /usr/local, sudo command not found.

after searching a few solution, found that sudo is not installed by default in Cygwin. But I tried the solution that Aimal gave which is to run Cygwin as administrator. I finally can change the folder permission. Thanks Aimal.

Install Socat Cygwin
Leung Ying YingLeung Ying Ying
Ssh

Not the answer you're looking for? Browse other questions tagged windowsterminalcygwinsudo or ask your own question.

I have a scenario where multiple processes on the same box want to communicate with a serial device. Process A needs two-way communications with the serial port, and Process B only needs to be able to write to the serial port. The serial device is continually spewing data, while the two processes periodically write to the port. The environment is Cygwin on Windows (the processes are windows processes), but the serial port could be moved to a *nix virtual machine if anyone has a Linux-only solution.

My 'network diagram' is as follows:

My first attempt was to set up a socat instance with udp-recvfrom and the fork option. This works for the first packet - a process forks off from socat, sends the data to the serial device, and starts reading data back from the serial device. However, this forked process now has the serial port open for read-write, so no more forks successfully start.

Can anyone think of any way to get this to work? I can think of the following avenues but I haven't found settings to make any of them work:

  • Use socat's udp-recv option to receive from anyone, but find a way to make it send replies to a specific address.
  • Use two unidirectional socats, one to write to the port and one to read from the port. I would then need a way to combine these two unidirectional streams into one bidirectional stream, but I don't know how.
John WalthourJohn Walthour

1 Answer

I found a solution. It involves 4 instances of socat, arranged in the network diagram below:

  • Socat 'B' talks to the serial port, takes input on stdin and outputs to stdout.
  • Socat 'A' listens for UDP packets from anywhere and outputs them over stdout, where they are piped into socat 'B'.
  • Socat 'C' listens for a TCP connection from Process A. Data coming from socat 'A' comes in stdin and is routed to Process A. Data from Process A is sent out stdout to socat 'D'.
  • Socat 'D' takes data from stdin and sends it out over UDP to socat 'A'.

Process B sends UDP packets to socat 'B' when it wants to inject traffic.

The bash command to create this monstrosity is as follows:

This also sets a timeout of 5 seconds and logs a lot of detail to 'log.txt'. Port numbers replaced for security.

John WalthourJohn Walthour

Socat Proxy

Not the answer you're looking for? Browse other questions tagged cygwinsocat or ask your own question.

Coments are closed
Scroll to top