Hot answers tagged

33

With socat (a 'bidirectional data relay between two data channels') you can can connect to the unix domain socket like this: $ socat - UNIX-CONNECT:/tmp/memcached.sock


18

Use telnet domain.name.server.com 80 then HEAD /~USER HTTP/1.1 Host: domain.name.server.com (Then you have to hit Enter once more.) Now it should show you the header of this page. For a real life example: $ telnet unix.stackexchange.com 80 Trying 198.252.206.16... Connected to unix.stackexchange.com. Escape character is '^]'. HEAD ...


15

With netcat-openbsd, there is a -U option. If you don't have it, you probably have netcat-traditional installed instead; I'd suggest switching.


12

Instead of manually specifying the fingerprint (which can change), you can instead tell offlineimap where your local system certificates are stored and then have it automatically verify the chain. [Repository somerepos-remote] type = Gmail sslcacertfile = /etc/ssl/certs/ca-certificates.crt The sslcacertfile is what does the trick. If non-Ubuntu users ...


12

It's for convenience, but it's also a lower-than-user-level diagnostic. You can isolate the problem you're having with a service that way, for example: Joe has a database server and client. They are not communicating. Is the problem on the network? The server? The client? Joe goes to the client machine and opens a shell. He uses telnet, just as you ...


11

You can use socat on Debian. To install it: # apt-get install socat


9

Use netcat, it provides command line raw sockets, a very handy utility, I often use it to move data between servers when encryption is not required, for example: Server1 # nc -l -p 1234 | zcat | mysql -u root databaseName Server2 # mysqldump -u root databaseName | gzip | nc Server1 1234


9

You could do what the browser does, i.e. connect to the proxy, $ telnet proxy-server 3128 and talk to it. If there was no authentication, a simple GET request (followed by two newlines (Enter)) with a full hostname and protocol, e.g. GET http://www.google.com/ HTTP/1.1 should suffice. Since you need authentication, you need to provide your username ...


8

Check the file /etc/ttys which contains list of terminals. Only those marked "secure" will allow root to login. By default this is the console and all virtual terminals. Pseudo terminals do not allow root login. Also, in this day and age, where security is a big concern, may I ask why you are still using an unsecure protocol like telnet and not ssh ? ...


8

You ought to be able to pipe the exit command into STDIN in telnet. Try: echo exit | telnet {site} {port} and see if that works. (it seems to work on my web server, but YMMV).


8

Bash provides pseudo devices that you're likely familiar with such as /dev/null. However there are other devices such as /dev/tcp and /dev/udp for testing network connections, which you may use from within Bash scripts too. excerpt from Bash's man page Bash handles several filenames specially when they are used in redirections, as described in the ...


7

Create a user and set his login shell to your command. For example: sudo apt-get install sl sudo adduser foo sudo chsh -s $(which sl) foo ssh foo@localhost Also have a look at man sshd_config for some other ways to configure you ssh server. (Like adding a ForceCommand.)


7

Telnet is a very simple protocol, where everything that you type in your client (with few exceptions) go to the wire, and everything that comes from the wire is shown in your terminal. The exception is the 0xFF byte, that setups some special communication states. As long as your communication doesn't contain this byte, you can use telnet as sort of a raw ...


6

So here are in one answer a summary of my comments. You have 3 solutions depending on your environment: A. Your Windows host is connected to a network 1- Use "Bridge networking" And select the Windows network interface that is configured under Windows to have network access. Make sure you have no firewall on Ubuntu: sudo iptables -L should give you no ...


6

This depends which tools are installed on the client device / supported by the kernel. Possible methods for file transfer (unordered): ssh / sftp encoding binary files into displayable format with base64/uuencode and then copy from/into your telnet terminal window. over a simple tcp connection with netcat or socat or with bash and /dev/tcp upload / ...


6

The process that is listening for connections on port 7077 is accepting the connection and then immediately closing the connection. The problem lies somewhere in that application's code or configuration, not in the system itself.


5

Congratulations, you've just delved into the concept of networking layers by realizing that ports and protocols are not directly connected with each other. As others are saying, telnet can be used to connect to any TCP port. However to understand why this is possible you need to understand a bit about networking layers. If you've ever heard of the OSI 7 ...


5

A more general solution than Laurentiu Roescu's would be to use iptables, which works the same in every distribution and essentially regardless of which software is installed. # iptables -A INPUT -p tcp -s <ip_address> --dport telnet -j DROP You may optionally use -j REJECT instead of -j DROP. Using REJECT will tell whoever is at the other end that ...


5

Have you tried turning off localchars in your telnet client? bash$ telnet telnet> toggle localchars Won't recognize certain control characters. telnet> open myhost You may also be able to put this command in the ~/.telnetrc file, depending on your version of telnet.


5

I finally found an answer in Anne Baretta's Linux Keyboard Hall of Shame... it seems that changing key mappings in xterm / rxvt does no good for telnet. I validated this when I sniffed the telnet connection. First I sniffed the telnet session and saw that Backspace sent 0x7f to the host. Next I intentionally broke Backspace in rxvt using stty erase $ (thus ...


5

You don't. Use netcat nc instead. It will do what you want, whereas telnet will not. (echo helo ole.tange.dk; echo mail from: '<spam@tange.dk>'; echo rcpt to: '<spam@tange.dk>'; echo data; echo Subject: This is an email;echo;echo test;echo .;echo quit ) | nc smtp.server.example.com 25 | grep 250


4

You are trying to test connectivity to a remote Web server with telnet? Then, no: you do not need telnet servers. The remote HTTP server is waiting for commands, as indicated by the escape character. When it times out waiting, the connection is closed. So... telnet <hostname or ip address> 80 Then type some HTTP commands: GET / HTTP/1.1 host: ...


4

To answer to your question in the first sentence: Telnet is two things: a server-side application (daemon), and a client-side application. When a telnet server is running, the computer is listening on TCP port 23 for connections from a telnet client. A telnet client does not listen on any ports, but rather attempts to connect to TCP port 23 (by default) on ...


4

If you are asking "What is the way to connect to an SMTP server using SSH instead of telnet?" the answer is there is none. SSH only communicates over ports using the SSH protocol. Using it to connect to any other port will fail, because SSH will try to speak the SSH protocol, which will not be understood by an SMTP server (or FTP, or other server ...


4

In /etc/host.deny add: telnet: <ip_addres> But you should use ssh instead.


4

Just wanted to mention that (at least on Ubuntu 12.04) there is --askpass /your/file argument for openvpn, that reads the private key password from a file.


4

You can use Proxychains for this. First install proxychains, using the command: $ apt-get install proxychains Then configure your proxy settings in /etc/proxychains.conf file. Add at last, these lines for HTTP and HTTPS proxy. http proxy-ip proxy-port username password https proxy-ip proxy-port username password Now you ...


4

The telnet protocol, described in RFC 854, includes a way to send in-band commands, consisting of the IAC character, '\255', followed by several more bytes. These commands can do things like send an interrupt to the remote, but typically they're used to send options. A detailed look at an exchange that sends the terminal type option can be found in ...


4

telnet is a tool that can connect to any tcp port. By default, it connects to the telnet port (23), but you can tell it to connect to the http port (80) or smtp port (25) or whatever instead. You need to know how to "speak" the protocol that the remote server is listening for on that port, though. For example, if you want to get the headers of a web ...


4

the problem lies in cmd2=meminfo > /tmp/top.txt this actualy sets the variable cmd2 to meminfo and evaluates the redirection. you should quote this. cmd2='meminfo > /tmp/top.txt' edit: this creates the file on the target. according to your own answer you wanted to create it on the system that runs the script (not stated in your original question). ...



Only top voted, non community-wiki answers of a minimum length are eligible