date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,374,433,691,000
A friend of mine is running Ubuntu and got GRUB RESCUE. Can they use Mint ISO to repair their Grub? As I don't have Ubuntu ISO?
If the Ubuntu installation is still present (and only GRUB was lost), sure, you can use any distro that has live booting to do so. chroot into the Ubuntu installation and install and update Grub. If /dev/sda5 is the Ubuntu partition: mount /dev/sda5 /mnt mount -o bind /dev /mnt/dev mount -t proc none /mnt/proc mount -...
Can we use Linux Mint ISO to repair Ubuntu's Grub?
1,374,433,691,000
I can't boot my Debian 9.5 with following errors. If I remember correctly ACPI Errors were shown every time I turn on PC. But computer always boot right with these errors, so I didn't care much. The new error starts at "A start job is running.." When did the error start? I was going to sell my older HDD so I erased ...
Systemd assumes certain mounts are critical to the system and as such a failure to mount one results in it switching to emergency mode. Systemd should have reconfigured its automount units when the device was disconnected unless it appears in /etc/fstab or you configured it as a mount unit. So the issue is likely that...
Trouble on Debian boot up "Timed out waiting for device dev-disk..."
1,374,433,691,000
I recently ran into the following situation: I could not boot my computer normally. (I was shown a blinking cursor after the boot-loader and Ubunutu load screen but before the login page while never reaching the login page.) I was able to enter recovery mode. If I fully continued the boot, I could get to a terminal...
This feature is provided by the friendly recovery menu, and in particular its dpkg plugin (which adds a menu entry titled “Repair broken packages”, translated appropriately in whatever language the user configured the system to use). This plugin uses two different approaches to repair broken packages: if dist-upgrade...
What command is run when the dpkg option is selected in recovery mode?
1,374,433,691,000
How to create a persistent and bootable USB of a running system on a computer without shut down. The key would be the same as the computer and offer ways to use it and install it as is on some other hardware. . root rights ok quote from chat Unix & Linux To keep the things simple, I would like to create an alive back...
I think dd is the good way to proceed. Meanwhile, this solution works out of the box only if there is only one /dev/sd*. For instance, i would suggest to list all /dev/sd* except usb one then make as many partition (fdisk -n) as required on usb drive and use dd for each /dev/sd* counted. From the link: insert the dest...
How to create a persistent USB key of a running system?
1,374,433,691,000
I wanted to update my system (Slackware current) which was in multilib. Before updating, I tried to remove all packages (compat32 and multilib). Big mistake !!! This have broken some crucial symlinks and give me now a kernel panic when i trie to boot it. I have tried several methods, including this one But it does not...
since you can't boot your system, you need some other medium - cd or usb. there is no other magic way to boot unbootable system. basically what you have to do is: boot your machine (slackware installer). mount your partitions and chroot to system / dir. install packages you removed (download them from some slackware ...
Linux Slackware ( Broken - kernel panic )
1,374,433,691,000
So my Fedora Linux machine crashed during an update, and now refuses to start properly. I'm using SystemRescueCD to try to recover the contents of the hard drive. Following the steps in this post, I have done the following, shown together with the respective output for each command. First I list the partitions: root@...
This appears to be a bug in older versions of LVM. A bug that could be corrected by compiling from source with a different set of flags to add support for thin devices. I can not speak for the SystemRescueCD you mentioned, because I have never used it, but it may be using an older version of LVM, for whatever reason...
mount: Unrecognised segment type thin
1,374,433,691,000
I have this mid 2011 iMac 21.5" Core i5 on which I would like to install Linux (Debian) as the only OS, so I'd like to throw away the entire macOS installation. The web is full of tutorials for doing this, so, I think, this will be an "easy" step. My problem is: what if in future I want to go back on macOS (e.g for se...
Might want to use backup software for your personal files first... Buy a flash drive, 8 GB or larger, for this purpose. Download macOS Sierra from the App Store. Plug in the flash drive and rename it to "SierraInstallation" for the purpose of matching the command below in step five. Open Terminal or iTerm2. Execute, ...
Installing only Linux on a mac and in case, go back to macOS
1,374,433,691,000
I changed owner of /etc folder by accident when I was doing work on web server and now owner of /etc folder and all of its subdirectories is www-data. I can't use sudo anymore for anything and in recovery mode console restarts after like 30 seconds and then it freezes. Is there any way for me to fix this without reins...
Maybe searching a little more: https://superuser.com/questions/501818/changing-ownership-without-the-sudo-command#501824 Reboot, hold down right shift key to bring up the grub2 boot menu. Then follow these instructions to enter single user mode. How do I boot into single user mode from grub? In single user mode you...
Changed owner of /etc folder, can't use sudo anymore
1,374,433,691,000
All apt-like commands failed to create the lock file, because /var/lib/dpkg/ doesn't exist. Also, /lost+found/ has contents: pi@pi-top:~ $ sudo ls -al /lost+found/ total 102456 drwx------ 11 root root 16384 Apr 3 16:26 . drwxr-xr-x 23 root root 4096 May 5 17:00 .. -rw------- 1 root root 104857600 Apr 3...
I'm sorry, but at this stage, you're probably better off restoring from a clean backup. When fsck places so many directories in /lost+found, that's a sign that there's been a lot of corruption. It's quite possible that there's more corruption, but because it's in the file contents rather than in metadata, fsck has no ...
/var/lib/dpkg/ disappeared after fsck
1,374,433,691,000
I just need to edit the /etc/network/interfaces file in my otherwise-functional Debian installation, but I can't boot up because it gets stuck at "Configuring network interfaces". So how can I access this file without booting up? Do I need a Live USB? I'm using the amd64 port of Debian 7.8.
You don't need a live environment for this. You just need to boot into a rescue environment, which is easy. When GRUB comes up, hit the e key, so that you can edit the kernel command-line. Find the line that begins with "linux", use the arrow keys to move down to the end of it, and type single (with a space before it)...
How can I fix my Debian's /etc/network/interfaces?
1,374,433,691,000
1st. Thanks in advance. This is somewhat like # 216697: Reinstalling packages with missing/corrupt files except in that person's situation, after recovery, the system still worked. Mine does not. Can't start X, no networking, systemd doesn't have all it's requirements so services can't start, etc etc. The system, to u...
It seems like you are simply looking for the rpm --root option, which is roughly analogous to dnf --installroot. This is documented in the RPM man page: --root DIRECTORY Use the file system tree rooted at DIRECTORY for all operations. Note that this means the database within DIRECTORY will be u...
Reinstalling only packages with missing or corrupt files on a non-running system?
1,374,433,691,000
I was careless for just a second and managed to type (being logged as root) on my Ubuntu system: chown foobar /* chown foobar /*/* What is the possible extent of the damage, and how can I revert it?
It seems like there isn't really much that needs fixing, at least on a fresh install of Ubuntu 15.10. Of course, if you've installed stuff, you will have files and directories that I don't. However, I believe this output will show the proper permissions to keep Ubuntu running. Some programs may be broken because of th...
Damage by chown command at /
1,374,433,691,000
I lost my drive with my media center on it, and I realized that I had an old backup lying around. But when I went to restore my backup, I realized that all of the files had been copied with a Windows utility, and more than likely my file permissions are all messed up. It will be a few hours before I'll be able to atte...
Sorry, it would be very hard to restore your system from this backup. You didn't just lose file permissions, you also lost file ownership and symbolic links. With so much lost, restoring manually would be an arduous process, there'd be a lot to do manually and it would be difficult to ensure you have them all. It woul...
Restore file permissions after Windows copy
1,374,433,691,000
I did as root in my Debian 8.5 because wanted to test Matlab's thing but the commands removed some dependencies which affect the runlevel Run apt-get purge openjdk-7-jdk openjdk-7-doc openjdk-7-jre-lib openjdk-7-jre Reboot Output: notification about processing runlevel changes and staying there. All symbols were gree...
You're trying to use the generic modesetting driver, but you somehow got xserver-xorg-video-intel installed again. Removing it should force Xorg to default back to the modesetting driver. Creating an /etc/X11/xorg.conf with the following should keep it working, even if -video-intel gets installed again: Section "Devic...
How to Recover Debian of LK backports where runlevel conflict?
1,374,433,691,000
I was working on my linux machine earlier today and when I was in the middle of updating my java packages through the package manager and installing coffee script, my windows started not working and closed down. I didn't think much of it and kept on working in TexStudio and finishing my hand in for this week, saved it...
I noticed that what happened was I install the boot sequence (or whatever it is called) on sdb1 or something similar and not on sda where the boot flag was set. So what I did was I booted linux from a live USB and re installed my linux mint, and put the boot sequence to be installed on sda and set the boot flag there ...
Linux Mint (LMDE) suddenly crashed and won't boot again
1,374,433,691,000
Accidentally /usr/ directory got deleted, in Cent OS 8. For recovering CentOS, I have found this link which needs live CentOS 8 installed in USB drive. However CentOS 8 doesn't have live ISO release as per this discussion. In MS-Windows, I get errors when trying to install DVD iso to USB drive using Rufus and also Et...
Re-Installation. All your installed programs rely on data in /usr, so you can't simply reinstall. Your idea about using a live CD/DVD goes in this direction. You use them to FIX the problem. This would be the reinstallation of all programs, which won't work. Since this would be invoked within a chroot, it doesn't matt...
Accidentally deleted /usr/ directory in CentOS 8
1,374,433,691,000
I use debian jessie and I have done one of those bad mistakes and broke my system with a mistyped command and worse mistakes that follow in such situations. Trying to fix some permissions I mistakenly used chmod recursively on root folder: # chmod -R 0644 / and then realizing immediately I rushed in doing something t...
The good news is that all your data is still there. The mixed news is that your system installation may or may not be recoverable — it depends where chmod stopped. You will need to boot into a rescue system to repair it. From the rescue system, mount your broken installation somewhere, say /mnt. Issue the following co...
Broken system after chmod -R 644 /
1,374,433,691,000
After a power outage, my ubuntu 20.04 boots from the normal option in grub to a black screen and hangs there. However, if I go to Advanced Options and select recovery mode and then "resume", it is able to boot up. What went wrong? how can I fix it? Note: I found many solutions to this problem, not all worked for me so...
The solution that worked for me was reinstalling all the nvidia drivers. Uninstall all nvidia drivers (based on this answer) sudo apt-get remove --purge '^nvidia-.*' sudo apt-get install ubuntu-desktop sudo rm /etc/X11/xorg.conf echo 'nouveau' | sudo tee -a /etc/modules Reinstall all nvidia drivers (based on this t...
ubuntu 20.04 only boots from recovery mode
1,374,433,691,000
After all these years of using Linux, I have never goofed up this badly. I should have known better, I honestly don't know what I was thinking. While trying to fix a small error message I was getting (this is irrelevant to my now much bigger issue), I found a post that said to "just run pacdiff and overwrite old files...
I have never used Manjaro, but the process that works for Arch Linux should be fine in your case too. You should be able boot off a Manjaro live USB, mount the root file system of your Manjaro installation, mount your existing /home directory and put the backup copy you have of shadow back to its place. Then you shoul...
Locked out: overwrote /etc/shadow and /etc/grub.d with pacnew
1,571,859,957,000
I have the following lines extracted from the output of last. It shows two reboots, and that userA was logged in right up to the reboot. So far, I am able to interpret the data. However, what I do not understand right now, is the login-time of the pseudo user reboot. For any ordinary users, the two times are the time ...
Its refer to the time between reboots. i will explain with example: root pts/0 192.168.10.58 Mon Nov 28 10:53 still logged in reboot system boot 2.6.32-642.11.1. Mon Nov 28 10:14 - 11:00 (00:45) root pts/0 192.168.10.58 Mon Nov 28 10:11 - down (00:02) reboot system boot...
last - user reboot - logged-in period
1,571,859,957,000
I was making a spare Mint live USB via Unetbootin and when I was looking for my iso file, I misclicked and moved /etc into my /home directory, which pretty much immediately rendered my system useless. How can I make this partition bootable again? I tried grabbing the file from a live USB, but permission was denied. I...
You need to boot into a linux live USB (preferably mint or ubuntu), make sure your linux HDD partion is mounted read/write, and use the linux mv command to move the directory to the proper location. This is how I would approach: Boot your system on a Linux Live USB. Use the file manager on the Linux live system to ...
I moved /etc into /home in Linux Mint, how do I make the system usable again?
1,571,859,957,000
I used to access it via SSH but I wanted to connect to it with zsh instead of bash. I made a mistake with my Synology NAS: I deleted the /bin/sh symbolic link to /bin/bash to replace it with /bin/zsh but since then I cannot connect to it using SSH: $ ssh synology.local [email protected]'s password: /bin/sh: No such f...
I finally was able to restore my Synology software without losing the data thanks to this Synology Knowledgebase article. It explains how to factory reset the configuration and operating system: Use a paperclip to press the reset button on the back of the device and hold it for 4 seconds until it beeps. (This resets ...
Fix corrupt /bin/sh link
1,571,859,957,000
I've been cloning complete HDD images to restore OS crashes using DD and GZIP for a while now using dd if=/dev/sda | gzip > img.gz and gzip img.gz | dd of=/dev/sda This always working fine, but the process is a little slow. It takes more than 2 hours to create or restore an image. I started experimenting with faster (...
Is the restored image the same size as the original one ? You can test restored size using : lz4 -v img.lz4 > /dev/null If not, maybe the following line would be a bit safer : lz4 -d img.lz4 | dd of=/dev/sda
HD clone using LZ4 and DD fails
1,571,859,957,000
So, recently I was doing the Linux from scratch project and I had multiple terminals open, so I was continuing to make it, and by accident I typed the line in another terminal tab (root), and it messes up symlinks completely!, I can't run any commands on bash. case $(uname -m) in i?86) ln -sfv ld-linux.so.2 $LFS/...
What to recover The LFS variable was presumably unset when you ran this command. So it modified /lib64/ld-linux-x86-64.so.2 and /lib64/ld-lsb-x86-64.so.3. You've corrupted the dynamic loader. As a consequence, you can't run any dynamically linked program. Pretty much every program is dynamically linked, including bash...
switch_root: failed to execute /sbin/init: Too many levels of symbolic links
1,571,859,957,000
Im pretty new at linux and I really don't know how to fix this. I accidentally ran sudo chmod -x /* Now every command I run returns a "Permission denied" even the sudo command. please help!
Unfortunately you will not be able to do much from that os because you cannot run any binaries in /usr/bin/ or /usr/sbin/. What you can do is make a live usb of any linux os, boot into the live environment, mount your root partition in the live environment at any mountpoint (say /mnt/), undo what you did i.e run the c...
Accidentally ran "sudo chmod -x /*, is a fix possible?
1,571,859,957,000
On my PC I had 2 operating sytems (ubuntu and windows) and for about 5 days I wanted to reinstall my Windows OS because of some bugs but instead of installing it on the partition where my old version of windows is I have installed it on the partitions where my Ubuntu OS was so my question is, is it possible to recove...
Considering you have over-written your Ubuntu partition with a Windows reinstallation, chances of recovering files are pretty low. With : A LOT of time a pretty large storage space on another drive another PC where you can plug your hard drive (stop writing on your Windows/Ubuntu drive NOW!!!) an indecent amount of ...
Is it possible to recover overwritten files from another operating System on the current operating system?
1,571,859,957,000
I'm trying to move some files using a bash script on a mac during recovery mode. I can successfully move the files by manually entering the command in Terminal after booting into recovery. However, one goal is to document the process and make it portable, so a script is desired. When I try to run the mv command from t...
Your variables are quoted, you don't need to escape the spaces: SYSDIR='/Volumes/Macintosh HD/System/' (etc.) Also (tangentially) related: Are there naming conventions for variables in shell scripts?
Why is mv failing in this (bash) shell script in bash 3.2 during Mac OS recovery mode?
1,571,859,957,000
Unfortunatelly I made mistake somewhere but can't get where. I had issues with ssh and github, tried different things and they didn't work. Later I decided .. i think.. moved file i balieve it was home/username/known.hosts or smth like that. Additonally I deleted everything from folder, where id_25519 and id_25519.pub...
It's unlikely modifying anything in your home directory will have reset your password. On most distributions it's stored in /etc/shadow by default. To get to a recovery console, the most easy thing to try is to change the init kernel parameter on boot. Assuming you are booting with grub: switch on your computer At th...
password to linux changed after deleting/manipulation with ssh
1,571,859,957,000
I am using btrfs (which seems integral to the question). Upon recovering with timeshift and rebooting, I am encountering the following error [Failed] Failed to mount /home. [Depend] Dependancy failed for Local File Systems You are in emergency mode. After logging in, type "journalctl -xb" to view system logs, "systemc...
SOLUTION: upon entering the root (just type password in the emergency mode) I edited /etc/fstab * There I removed the bits where it said subvolid=xxx$. E.g from UUID=xxx-yyy-zzz /home btrfs rw,noatime,compress=zstd:3,ssd,space_cache,commit=120,subvolid=257,subvol=/@home 0 0 to UUID=xxx-yyy-zzz /home btrfs rw,no...
Timeshift and btrfs. Recovery unable to mount /home
1,571,859,957,000
I'm new to Linux but I'm going to try my best to describe the problem, please bare with me, if you need more information tell me what I can do to provide more information and I'll get it for you. After booting up my system and opening Steam the entire OS locked up, I could move the mouse but nothing else (including al...
I had a similar problem, below is my current lsblk, i solved it by removing an fstab entry sdb 8:16 0 1.8T 0 disk ├─sdb1 8:17 0 16M 0 part └─sdb2 8:18 0 1.8T 0 part /mnt/xxx I had an sdb3 partition which had a fstab entry, I deleted the sdb3 partition without removing t...
PopOS (Ubuntu) crashed and booted into emergency mode
1,571,859,957,000
I am trying to get Debian installed on a device that doesn't have enough battery capacity to power the display on full brightness for long enough to complete an installation, even while plugged in. I've got it to the stage where I've installed almost everything and it was sitting on the penultimate step of the advance...
At the "Finish the installation" step of the d-i graphical Debian installer it runs scripts out of each parts of the installer. After installing the bootloader however it immediately runs this step. The only step left is the "finish-install" step which is here: https://salsa.debian.org/installer-team/finish-install/tr...
How can you complete a Debian installation interrupted just before "Finish installation"?
1,571,859,957,000
I know that chmod -R 777 / is extremely destructive, and I know that a chmod -R 000 /bin can be recovered by using an additional disk, but I'm wondering about chmod -R 777 /bin. If I have a root shell, but no additional disk mounted from a healthy VM, can I recover this system? (This question is for learning purposes...
As argued in the response you link, it depends on your definition of "recover" (i.e. do you still trust a binary after it was potentially changed by anybody on the system, which may be "I guess I'm ok" for your private desktop machine but much much less so on a multi-user company system). Looking at my box, /bin has ...
Can `chmod -R 777 /bin` be recovered from?
1,571,859,957,000
I cloned my installation from a 240GB SATA SSD to a 500GB NVMe SSD using Clonezilla. The cloning was completed successfully, except for a failure with initrd (unfortauntely I don't remember the actual error). After rebooting I manage to get to right before the login screen and then I'm kicked into emergency mode. I a...
Solved it, answering for anyone that might encounter the same issue. My fstab also had my storage drive in it and I didn't know the system wouldn't boot unless it detected all drives in the file. Make sure to comment out or delete any drives that are not connected.
Stuck in emergency mode after cloning my system with clonezilla
1,571,859,957,000
I recently reinstalled Fedora 35 on a dual-boot with Windows 10. Unfortunately, I think I have accidentally formatted /boot/efi, as hints a tree /boot /boot ├── config-5.14.10-300.fc35.x86_64 ├── config-5.14.16-301.fc35.x86_64 ├── efi │   ├── EFI │   │   ├── BOOT │   │   │   ├── BOOTIA32.EFI │   │   │   ├── BOOTX64.E...
I had the same issue as you awhile ago. Heres the command I used in the Windows installer usb command prompt: Bcdboot C:\Windows /l en-us /s x: /f ALL Use diskpart to mount and unmount disks. Replace C:\Windows with your windows drives Windows folder and x: with your grub disk.
Restoring windows boot [closed]
1,571,859,957,000
When running dbus-launch, I get bash: cd: /run: Permission non accordée. (Permission denied) I think I've bad permissions. Is there a correct solution ?
/run should be world-accessible, and only writable by root. chmod 755 /run However, you may run into more trouble, since whatever caused /run to have wrong permissions may have affected other files. There is no generic way to fix such problems. It depends on what happened. Maybe one of the previous questions on simil...
bash: cd: /run: Permission non accordée (Permission denied)
1,571,859,957,000
I had a dual boot system with windows 10 and ubuntu 18. Recently the system failed, the motherboard probably got fried by lightning during a thunder storm and its not booting anymore, no fan, no lights, totally dead. So I salvaged the hard disk to recover the data from it. I plugged in the hard disk to a windows machi...
The Ubuntu partitions will be ext4, so you won't be able to see them on Windows. There is some software you can use to read ext4, but I have never found anything that worked satisfactorily. Your best chance is probably using a Linux live USB drive. Instructions for creating one with Ubuntu can be found here. Boot usin...
Dual boot system failed, ubuntu file system missing during hard disk data recovery
1,571,859,957,000
I just recently ran a bash script that froze up my Linux mint machine, and I had no choice but to hold power key to perform a hard power off. Now my machine will not boot. I have no clue if the bash script did something, the hard reset did something, or it is just coincidence and my harddrive died. I created a bash sc...
Problems with "READ DMA" and "I/O error" are not problems with scripts, applications or the filesystem, but problems with the actual harddrive. To answer your question: nothing in particular, but your harddrive is failing. I can recommend turning the failing drive off for now, and later take a copy of whatever can be ...
Failure to boot after running bash script
1,571,859,957,000
I strongly despise any kinds of automatic OOM killers, and would like to resolve such situations manually. So for a long time I have vm.overcommit_memory=1 vm.overcommit_ratio=200 But this way, when the memory is overflowed, the system becomes unresponsive. On my old laptop with HDD and 6 GB of RAM, I sometimes had t...
For your use case try the mlockall system call to force a specific process to never be swapped, thus avoid swap thrashing slowdown. I would recommend earlyoom with custom rules over this hack.
Is it possible to reserve resources for an always-up emergency console?
1,571,859,957,000
I'm currently testing a backup/restore of RHEL 6.4 OS via the "dump" and "restore" on testing environment, and I do know that RHEL 6.4 seemed too outdated in nowadays. Butsome enterprises are still using such version of RHEL to load their services. Here's the scenario: to backup the system and critical programs in cas...
Well... After tons of re-tries, I solved this root filesystem restore problem via using installation DVD's recue mode. I discovered that the restoration of root filesystem from dump always conflicts with the running OS. Therefore, using rescue mode can handle it. I'll make other try to see whether there's possibility ...
failed to restore root filesystem from dump backup
1,384,188,969,000
I have a 4 port bridge: root@Linux-Switch:~# brctl show bridge name bridge id STP enabled interfaces br0 8000.000024cd2cb0 no eth0 eth1 eth2 eth3 My goal is to limit the upload speed of the eth2 interface. (eth0 is th...
I figured it out- I had to specify a 'protocol' in the filter. I could find much documentation on this- all the examples I could find specified the protocol as 'ip' but since this a switch, I thought I'd try 'all' and it worked! tc qdisc add dev eth0 root handle 1:0 htb default 2 tc class add dev eth0 parent 1:0 cla...
tc on bridge port
1,384,188,969,000
I would like to know the exact position of the following device in the packet flow for ingress traffic shaping: IFB: Intermediate Functional Block I would like to better understand how packets are flowing to this device and exactly when this happens to understand what methods for filtering / classification can be us...
I think I finally understood how redirecting ingress to IFB is working: +-------+ +------+ +------+ |ingress| |egress| +---------+ |egress| |qdisc +--->qdisc +--->netfilter+--->qdisc | |eth1 | |ifb1 | +---------+ |eth1 | +-------+ +------+ +------+ My initial assum...
How is the IFB device positioned in the packet flow of the Linux kernel
1,384,188,969,000
Based on this section of the Linux Advanced Routing & Traffic Control HOWTO, I can't get tc to limit the network speed in my computer. The router is a Motorola SurfBoard modem with a few routing capabilities and firewall. The machine I want to limit the traffic is 192.168.0.5, and also the script is being run from 192...
You cannot limit incoming traffic on the destination machine because it has already arrived. To properly do what you want to do, you need to put tc onto your gateway. This is probably not an option for you, but it's the way. Ingress traffic can only be policed, in that it discards packets that exceed the speed limit. ...
Can't get tc to limit network traffic
1,384,188,969,000
I have a packet rate limit (max. 10 per seconds) which is set by my internet provider. This is a problem if I want to use the AceStream player, because if I exceed the limit I get disconnected. How can I restrict the internet access of this program? I tried the suggested command: iptables -A OUTPUT -m limit --limit 10...
The solution you found was correct: iptables -A OUTPUT -m limit --limit 10/s -j ACCEPT But it is assuming a default policy of DROP or REJECT which is not usual for OUTPUT. You need to add: iptables -A OUTPUT -j REJECT Be sure to add this rule after the ACCEPT one. Either execute them in this order, or use -I instead...
set packet rate limit via iptables
1,384,188,969,000
I have two linux containers connected with a veth-pair. At veth-interface of one container I set up tc qdisc netem delay and send traffic from it to the other container. If I watch traffic on both sides using tcpdump/wireshark it can be seen that timestamps of the same packet at sender and receiver do not differ by se...
According to the Packet flow in Netfilter and General Networking schematic, tcpdump captures (AF_PACKET) after egress (qdisc). So it's normal you don't see the delay in tcpdump: the delay was already present at initial capture. You'd have to capture it one step earlier, so involve a 3rd system: S1: system1, runs tcpdu...
Tc qdisc delay not seen in tcpdump recording
1,384,188,969,000
I want to handle ip fragments in user-space, and I am using the iptables NF_QUEUE to direct packets to user-space. The problem is that IPv4 packets are always re-assembled and delivered as one packet rather than individual fragments. For IPv6, fragments are delivered as they should. I thought that the conntracker migh...
Whenever conntrack is in use, mainly for: stateful firewalling (-m conntrack ...) NAT (-t nat ...) An additional hidden facility gets loaded, provided by the kernel modules nf_defrag_ipv4 and nf_defrag_ipv6. This facility hooks into network prerouting at priority -400: that's before iptables' raw table which hooks ...
Unwanted defragmentation of forwarded ipv4 packets
1,384,188,969,000
This LWN article suggests that one may add/replace the network scheduler for a queue "under" the mq "dummy scheduler." These two point to that end: The mq scheduler does two things: - present device TX queues as classes, allowing to attach different qdiscs to them, which are grafted to the TX queues - present acc...
The kernel's default reserved handle 0: can't be referenced correctly (as major value 0: ). You have first to (re)install the qdisc root mq, using a valid handle (ie: not 0:): # tc qdisc add dev eth2 root handle 1: mq Which now should give you this: # tc qdisc show dev eth2 qdisc mq 1: root qdisc pfifo_fast 0: paren...
Adding qdisc under the mq top-level qdisc
1,384,188,969,000
We have say 4 users in a private network connected to the Internet trough a Linux router with a public IP address that is doing network address translation (NAT). I have to configure QoS to give access to the users to Internet but with throttled bandwidth for 2 users while for others no limitations. eth0:121.51.26.35 ...
You need to pick a class aware qdisc like HFSC or HTB. Then you'll have to build a class tree like this: Root Class (10MBit) | \--- XyZ Class (rate 3Mbit ceil 3Mbit) | | | \--- Client 10 (rate 1.5Mbit ceil 3Mbit) | \--- Client 11 (rate 1.5Mbit ceil 3Mbit) | \--- Client 30 (rate 3.5Mbit ceil 10Mbit) \--- Clien...
How to configure QoS per IP basis?
1,384,188,969,000
Looking at tools like tc, wondershaper, htb and comcast, all these tools seem to operate on the level of a network interface or at least a "connection group" for limiting bandwidth. I'd like to not throttle bandwidth for a group of connections, but instead throttle the max rate of individual connections. Specifically...
The limit_rate setting of nginx seems to overcome some of the issues in squid and varnish as recommended by other responders. From the docs: Limits the rate of response transmission to a client. The rate is specified in bytes per second. The zero value disables rate limiting. The limit is set per a request, and so i...
Limit bandwidth of individual HTTP requests while not throttling total bandwidth
1,384,188,969,000
I would like to log a warning message to /var/log/messages file if either ingress or egress bandwidth on eth0 interface is over a certain threshold. I could do this with a script which reads the value of /sys/devices/virtual/net/eth0/statistics/[rt]x_bytes file, stores the value, sleeps a second, reads those very same...
I finally found the solution which I was looking for. Iptables has rateest module which does exactly that. For example: # collects all ingress traffic to RATEEST target iptables -A INPUT -j RATEEST --rateest-name RE1 --rateest-interval 500.0ms --rateest-ewmalog 1s # creates a log entry(jumps to LOG target) if rate is ...
monitor bandwidth on interface with tc or iptables
1,384,188,969,000
How can I remove a single filter? tc filter show dev peth1 shows filter parent 1: protocol ip pref 16 u32 filter parent 1: protocol ip pref 16 u32 fh 800: ht divisor 1 filter parent 1: protocol ip pref 16 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:2 match 5bd6aaf9/ffffffff at 12 Why does that not work?: tc...
Old post, but for reference, it wouldn't work for a few reasons: The priority should be 16 and not 1 The filter handle should be 800::800 and not 800:800 You must supply the parent qdisc that the filter is attached to This should work: tc filter del dev peth1 parent 1: handle 800::800 prio 16 protocol ip u32
remove tc filter (Traffic Shaping)
1,384,188,969,000
I'm trying to modify the network behaviour of my server(s), to simulate external/WAN connection behaviours (what ever that means). After doing tc qdisc add dev lo root netem delay 100ms, I can successfully add 100ms delay to all traffic from (and to?) 127.0.0.1. E.g. ping 127.0.0.1 will have 200ms response time. Howev...
No it doesn't affect other interfaces. But the routing involved makes that any access from the server to itself stays local and uses the lo (loopback) interface whatever interface the IP address was assigned to. So lo is affected by tc ... netem. You can verify this with the ip route get command, which will give somet...
Why does tc-netem on loopback also affects other interfaces?
1,384,188,969,000
I'm trying to police my downstream bandwith for a given port - but it seems unless I have a gigantic limit and burst, the download stops completely IF="wlp3s0" LIMIT="100kbit" BURST="100kbit" PORT="80" echo "resetting tc" tc qdisc del dev ${IF} ingress echo "setting tc" tc filter add dev ${IF} parent ffff: \ pro...
I am not quite sure about the wlan interface you are using but I guess you are missing the virtual interface which is supposed to redirect the traffic from ethX or in your case wlan3s0 into ifb which than controls the incoming packet So, something similar to modprobe ifb numifbs=1 ip link set dev ifb0 up tc filter ad...
Why does this tc ingress limit command not work? (bandwidth drops off to nothing)
1,384,188,969,000
I am trying to understand the queuing mechanism of linux-htb QDisc and QDisc of linux tc in general. What I could gather: During TX, the packet is queued into the queue inside the linux tc. This queue by default follows a pfifo_fast QDisc with a txqueuelen of 1000. The packet scheduler dequeues the packet from this ...
I am going to answer my own question since I have done some source code reading and research work myself. If I had not done some research work myself, the answers by frostschutz and sourcejedi would be of a great help too – they seem to be correct as far as my knowledge goes (although not into as much detail, but they...
queueing in linux-htb
1,384,188,969,000
I need to use a tc qdisc command to limit bandwidth usage on an interface created by openvpn. This works great when I run the command manually but occasionally the connection drops or restarts and this appears to cancel or deactivate the previously applied bandwidth settings. Is there a way to make a tc qdisc command ...
openvpn has an option called --up cmd which runs cmd whenever the VPN connection is first established, and an --up-restart option which tells openvpn to also run the --up command when a connection is restarted. You can write a script which contains your tc qdisc ... command, make it executable with chmod +x, and then ...
How can I permanently associate tc qdisc commands with a particular interface?
1,384,188,969,000
I need to simulate network environment with bad network connections for about 1000 hosts. Can tc (with netem) be used with virtual network interfaces (like eth0:0, eth0:1)? When I try to use tc on many virtual interfaces with different parameters - it seems that all virtual interfaces have one tc configuration. My pro...
Can tc be used with virtual network interfaces Yes. (like eth0:0, eth0:1)? No. Those aren't virtual network interfaces. They're aliases for network interfaces. There's a huge difference. It's an oldfashioned way to specify more than one address per interface, instead of the modern approach of ip address add/change...
How can I use `tc` with diffrent parameters on few virtual interfaces?
1,384,188,969,000
Server has 2 network interfaces: eth1 with address 13.0.0.254/24 eth0 with address 172.20.203.4/24. It's routing traffic between this two networks. Task is to limit bandwidth between this two networks to 1Vbit/sec, but not to limit bandwidth between server and network hosts(i. e. limit all packets going though FORWA...
The problem you're experiencing with the MARK IPTABLES target not working as expected was caused by a missing kernel module which enables that specific Netfilter functionality. In order to use the MARK target, you need to load the XT_MARK module which must be compiled with the Linux kernel. Check your kernel config f...
tc don't see marked with -j MARK packets
1,384,188,969,000
I'm trying to setup QoS in my VPS so that I can have any new outbound connection to a unique IP gets limited x speed. For instance: have 5 public IP's requesting data from my VPS. When the VPS sends data back to each of those IP's, each IP gets 10mbps dedicated outbound bandwidth speed. Never drop packets, rather que...
I don't know a QDISC that would do that directly. With CBQ/HTB/HFSC, at best you could create a limited number of 10mbps classes and then hash filter IPs into them. Apart from hash collisions which will obviously happen, it would work. With some luck, you can set such limits directly at the source (like, in the webser...
QoS with TC qdiscs: is it possible to have ALL outbound connections have x speed limit per unique IP?
1,384,188,969,000
I just realised that all the iptables rules I have been applying to my open Vswitch interfaces never match. I am using iptables to mark some packets, and then I use TC (traffic control) filters to put packets into different priority queues depending on the Iptables match. That works for every interface, and even for L...
That's an old problem. You'll have to know how your distro handles the netfilter kernel module. Sometimes it's loaded and the trick is to create a rule to mark them all then split afterwards. The mangle chain is kinda tricky. Add this as your first mark rule: iptables -t mangle -A POSTROUTING -m physdev --physdev-out ...
Alternative to Iptables for packet filtering in OVS interfaces
1,384,188,969,000
I use this tc command to limit upload speed on an interface: tc qdisc add dev eth1 root tbf rate 2mbit burst 10kb latency 70ms peakrate 2.4mbit minburst 1540 But it results in heavy packet loss. If the data coming via eth0 (WAN) is 7 GB, it will be 6.2 GB on the rate-limited interface eth1. Are there any other rate ...
If I've understood correctly, you're trying to limit your ingress traffic from your ISP by limiting egress traffic on your locally facing interface. The packet loss you're seeing are probably to be expected, as dropped packets are (one of) TCPs way(s) of detecting congestion, and the way a router can signal congestion...
Reducing packet loss in tc rate limiting
1,384,188,969,000
The following rule corrupts 5% of the packets by introducing a single bit error at a random offset in the packet: sudo tc qdisc change dev ens8 root netem corrupt 5% But recently it gave me the following error: Error: Qdisc not found. To create specify NLM_F_CREATE flag Could you kindly help me or provide me with ...
The initial default qdisc set by the kernel with special handle 0: can't be modified nor referenced. It can only be overridden by a new qdisc. Using change references the existing root qdisc, but as this can't be the default kernel's qdisc, that's an error. So the first time this netem qdisc is used, the add keyword s...
Error when trying to corrupt packets in linux terminal (netem)
1,384,188,969,000
I have seen connmark or ctinfo could work for this but couldn't find a simple effective command to make it work (Not familiar within this area). The command can be applied to the TCP termination node or any linux node as intermediary router.
iptables -t mangle -A PREROUTING -m dscp --dscp-class AF12 -j CONNMARK --set-xmark 12 iptables -t mangle -A POSTROUTING -m connmark --mark 12 -j DSCP --set-dscp-class AF12 (not 100% dynamic as the DSCP value need to be known in advance in order to get a match)
Example command to set same DSCP value in the IP header for return packets within the same TCP connection
1,384,188,969,000
Does anyone know if it's possible to mirror to multiple interfaces from one source interface using TC? I've done the following: The first thing I did was create an ingress queue on my input interface with tc qdisc add dev e101-001-0 handle ffff: ingress If you need to delete a qdisc you can do it with tc qdisc del d...
A tc action can have a control operator appended to alter further handling of packets: CONTROL The CONTROL indicates how tc should proceed after executing the action. Any of the following are valid: reclassify Restart the classifiction by jumping back to the first filter attached to the action's parent. pip...
Mirror to Multiple Ports Using TC?
1,384,188,969,000
On a Linux router, how to setup download quotas for all hosts? This is for a shared wifi network with many guests: Each guest should start with a 150 Mb download quota and no restriction Once quota is reached download speed should be limited to 50 k/s Filtering must be based on mac address, IP addresses may change wi...
After some research here's what I found: First, some configuration: # download quota (Mb) dl_quota_mb=150 dl_quota=$(($dl_quota_mb * 1024 * 1024)) # max speed once overquota (k/s) dl_cap_kb=50 dl_cap=$(($dl_cap_kb * 8)) # wifi interface if_lan=wlan0 # lan subnet lan=192.168.1 Create tc classes for each ip to limit...
iptables: download quota per mac address for all hosts
1,620,164,824,000
I am trying to determine whether rules put in place using tc persist beyond a reboot (I do not believe they do by default), and whether there is any way to cause them to persist, or if the best you can do is to re-execute the commands at boot in order to put them in place again. Also: how/where do these rules get pers...
Consolidating comments into an answer Based on comments from @dirkt and @berndbausch, it seems like the bottomline is: There is no tc-specific way of persisting rules that are put in place using tc. The specifics of how to do so the Right Way will vary depending on your distro, but it will come down to re-running the ...
Can TC rules persist beyond a reboot? Where?
1,620,164,824,000
I'm trying to use this tc script on my arch box. Specifically, the first line, roughly equal to tc qdisc add dev eth0 root handle 1: htb default 3 fails with RTNETLINK answers: Operation not permitted I get another couple of those and a couple We have an error talking to the kernel. I searched around, nobody mentions ...
Searching a bit more around the web, In this archlinux forum post is said restarting, and it worked. I just wonder why it did...
how to use tc with htb on arch-linux
1,620,164,824,000
I want to throttle bandwidth and add delay to a network interface to simulate satellite communication. For example 800ms delay and 1mb/s. The following limits the bandwidth correctly but does not increase the latency: 17:16:51 root@Panasonic_FZ-55 ~ # tc qdisc add dev eth0 root tbf rate 1024kbit latency 800ms burst 1...
Perhaps the netem emulator : tc qdisc add dev eth0 root netem delay 800ms rate 1mbit
How to delay traffic and limit bandwidth at the same time with tc (Traffic Control)?
1,620,164,824,000
I have Ubuntu 16.04 LTS with hwe kernel 4.13.0-39-generic. I configure the veth pair in the default network namespace as follows: $ sudo ip link add h1-eth0 type veth peer name h2-eth0 $ sudo ip link set dev h1-eth0 up $ sudo ip link set dev h2-eth0 up $ sudo ip addr add 10.0.0.1/24 dev h1-eth0 $ sudo ip addr add 10...
I answer my own question below. The simplest circumvention (my approach): putting one of the veth pair to another network namespace. Let's call it test. $ sudo ip netns add test $ sudo ip link add h1-eth0 type veth peer name h2-eth0 netns test $ sudo ip link set dev h1-eth0 up $ sudo ip netns exec test ip link set de...
For veth pair, ping does not recognize interface name and tc qdisc netem does not work
1,620,164,824,000
I am trying to limit the download (ingress) rate for a certain app within a cgroup. I was able to limit the upload (egress) rate successfully by marking app's OUTPUT packets in iptables and then set a tc filter to handle that marked packets. However, when I did the same steps for ingress it didn't work. steps I follo...
As per @A.B comments: The mark you set in mangle/INPUT has no effect on tc, because tc ingress happens waaaay before. Check: en.wikipedia.org/wiki/Netfilter#/media/ ... To save the mark for the connection, use -j CONNMARK --save-mark for cgroup's outbound packets, retrieve connmark in inbound packets with tc-connma...
How to police ingress (input) packets belonging to a cgroup with iptables and tc?
1,620,164,824,000
I am using tc to change the MAC address of incoming packets on a TAP interface (tap0) as follows where mac_org is the MAC address of a guest in a QEMU virtual machine and mac_new is a different MAC address that mac_org should be replaced with. tc qdisc add dev tap0 ingress handle ffff: tc filter add dev tap0 protocol ...
My understanding is that you are confusing the Ethernet address that you modify with tc (link layer only), with the inner CHADDR field (client's hardware address) that was embedded by the client inside the DHCPDISCOVER request (application layer which won't ever be altered by tc).
MAC address rewriting using tc
1,620,164,824,000
Can I add multiple qdiscs to the same device with tc, or is it only possible to use one qdisc per device? Also, can a qdisc contain child qdiscs, or only child classes? i.e. is it possible to do tc qdisc add parent <existing qdisc> handle <child qdisc> <qdisc type> ?
There is no actual problem to solve in OP's question, so I'll provide a very simple example that uses network namespaces set up communications ip -n test1 link add up type veth peer netns test2 ip -n test2 link set veth0 up ip -n test1 address add 192.0.2.11/24 dev veth0 ip -n test2 address add 192.0.2.12/24 dev veth...
can I use multiple qdiscs per device?
1,620,164,824,000
I am very interested in setting up fq_pie queue discipline for TCP congestion control. If I write net.core.default_qdisc = fq_pie to /etc/sysctl.d/90-override.conf, it should enable fq_pie on latest kernels. It does work on my desktop though. But on my laptop: $ tc qdisc show qdisc noqueue 0: dev lo root refcnt 2 qd...
It appears net.core.default_qdisc affects an interface driver when it's loaded. If the kernel module was loaded before net.core.default_qdisc was changed, then it won't affect it afterward. Some interfaces have altered behaviour: multiqueue interfaces will keep mq but their leaves inherit this default instead. lo or v...
Forcefully enable fq_pie
1,620,164,824,000
I read that there's another tool for netfilter that allows you to add latency to a ratelimit. Does anyone have an example of this?
I use the following script to emulate various network conditions: #!/bin/bash intf="dev eth0" delay="delay 400ms 100ms 50%" loss="loss random 0%" corrupt="corrupt 0%" duplicate="duplicate 0%" reorder="reorder 0%" rate="rate 512kbit" tc qdisc del $intf root tc qdisc add $intf root netem $delay $loss $corrupt $duplica...
How does one use tc to add latency to a ratelimit?
1,620,164,824,000
After upgrading from Fedora 16 to Fedora 17, Traffic Control no longer seems to work. Running # tc qdisc show will output: qdisc pfifo_fast 0: dev eth0 root refcnt 2 bands 3 priopmap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 However, if I run # tc qdisc add dev eth0 root netem delay 100ms or similar commands such as # tc ... l...
In Fedora 17 they moved a lot of unused (in common usage I guess) modules for the kernel into the package kernel-modules-extra. Installing this package will fix the problem. Source: https://serverfault.com/a/398964/112950
Is Traffic Control (tc) broken in Fedora 17?
1,620,164,824,000
I am developing a tunnel application that will provide a low-latency, variable bandwidth link. This will be operating in a system that requires traffic prioritization. However, while traffic towards the tun device is clearly being queued by the kernel, it appears whatever qdisc I apply to the device it has no addition...
So after some reading and rummaging in the kernel source, it seems the qdisc is ineffective because the tun driver doesn't ever tell the network stack it is busy. It simply holds packets in its own local queues (whose size is set by txqlen) and when they are full it simply drops the excess packets. Here's the relevant...
Traffic shaping ineffective on tun device
1,620,164,824,000
I'm want to use TC BPF to redirect incoming traffic from port 80 to port 8080. Below is my own code, but I've also tried the example from man 8 tc-bpf (search for 8080) and I get the same result. #include <linux/bpf.h> #include <bpf/bpf_helpers.h> #include <bpf/bpf_endian.h> #include <linux/pkt_cls.h> #include <linux/...
Contrary to Netfilter which includes a stateful NAT engine (using the conntrack lookup entries) and which will automatically de-NAT the reply traffic without explicit rule telling it to do so, implementing NAT elsewhere is stateless and requires to handle both directions. For incoming connections, that means handling ...
Redirect port using TC BPF
1,620,164,824,000
I found an interesting article that describes how to simulate network issues (like lost packets) on a linux server. On an Ubuntu test VM, I checked which interface is used for internet connectivity, and it's called ens33. Then I added a rule using tc to introduce packet loss: $ sudo tc qdisc add dev ens33 root netem l...
tc also accepts a -s parameter, with the same meaning: statistics. Example as root applied on a veth link toward an LXC container with address 10.0.3.128: # echo; tc qdisc del dev vethlzYQu1 root 2>/dev/null; \ ip neigh flush all; \ tc qdisc add dev vethlzYQu1 root netem loss 30% 50%; \ tc -s qdisc show dev veth...
Monitoring packet loss simulated with tc
1,480,784,737,000
I have heard a lot about creating darknet sites lately. I also use the Tor browser frequently. The tor service is running in my Debian server at home, and it was installed with: sudo apt-get install tor I have an idea how the Tor network works and also use torify once in a while, in Linux, and MacOS, for doing some...
Creating an .onion service in the Tor network is as simple as editing /etc/tor/torrc and adding: HiddenServiceDir /var/lib/tor/www_service/ HiddenServicePort 80 127.0.0.1:80 After restarting the tor service with sudo service tor restart or sudo service tor reload The directory will be created automagically, and in...
How to create a darknet/Tor web site in Linux?
1,480,784,737,000
There are two SOCKS proxies that I know about that support transparent proxying for any outgoing TCP connection: Tor and redsocks. Unlike HTTP proxies, these SOCKS proxies can transparently proxy any outgoing TCP connection, including encrypted protocols and protocols without metadata or headers. Both of these proxie...
Here is how it does it: static int getdestaddr_iptables(int fd, const struct sockaddr_in *client, const struct sockaddr_in *bindaddr, struct sockaddr_in *destaddr) { socklen_t socklen = sizeof(*destaddr); int error; error = getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, destaddr, &socklen); i...
How does a transparent SOCKS proxy know which destination IP to use?
1,480,784,737,000
Out of curiosity I'm reading some tutorials about transparent TOR proxies as it's quite interesting topic from a networking standpoint. As opposed to VPN gateways which just use tun/tap interfaces and are totally clear to me, TOR proxy uses a single port. All tutorials repeat the magic line: iptables -t nat -A PREROU...
Take a look at this answer: How does a transparent SOCKS proxy know which destination IP to use? Quotation: iptables overrites the original destination address but it remembers the old one. The application code can then fetch it by asking for a special socket option, SO_ORIGINAL_DST.
What does iptables -j REDIRECT *actually* do to packet headers?
1,480,784,737,000
Is there a way to redirect all traffic, UDP and TCP, coming to and from eth1 and eth2 through a SOCKS proxy (Tor) which then passes it through eth0? eth0: Internet in - leads to the main router, then the cable modem eth1: A USB Ethernet port setup as a modem (I think that's the word I'm looking for, right?) eth2: A US...
First, you need tun2socks (often a part of the 'badvpn' package). tun2socks sets up a virtual interface which you can route traffic through, and that traffic will get sent through the target socks proxy. Setting it up gets a little tricky as you only want to route certain traffic through the tunnel. This script should...
Redirect ALL packets from eth1 & eth2 through a SOCKS proxy
1,480,784,737,000
I wanted to try using TOR on my new Linux Mint 18.1 installation. So I apt-get installed torbrowser-launcher and tor, then ran torbrowser-launcher. It opened a dialog box and showed me it was downloading the TOR browser; but when it was done, it said it had failed the signature check and that I may be "under attack" (...
It's not an attack, just an outdated key. There's a issue report on this matter over at the GitHub repository. A workaround reported there, which works for some systems if not all, is to run: gpg --homedir "$HOME/.local/share/torbrowser/gnupg_homedir/" --refresh-keys --keyserver pgp.mit.edu before torbrowser-launcher...
torbrowser signature verification fails - a glitch or an "attack"?
1,480,784,737,000
I’ve just moved from Stretch to Buster with a Cinnamon desktop. This more or less does everything I need except that I also load stable firefox (using snap), AirVPN and Tor from the buster-backport repository. Normally there aren’t any problems except this time the Tor screen (after using the launcher) is black and un...
Answer form Debian bugs tracker : bug #942901 edit your /etc/apparmor.d/local/torbrowser.Browser.firefox and add the following line: owner /{dev,run}/shm/org.mozilla.*.* rw, Also add exactly the same line to /etc/apparmor.d/local/torbrowser.Browser.plugin-container. Then: sudo systemctl restart apparmor The Debian b...
Debian Tor Browser Showing a Black Screen
1,480,784,737,000
I'm trying to install tor on my Kali Linux 2016.1 (kali-rolling). When I type apt-get install tor in Terminal, this error appears: Reading package lists... Done Building dependency tree Reading state information... Done Package tor is not available, but is referred to by another package. This may mean that the ...
I found the solution: Firstly, I ran: echo -e "deb http://http.kali.org/kali sana main non-free contrib\ndeb http://security.kali.org/kali-security/ sana/updates main contrib non-free" > /etc/apt/sources.list and then apt-get update apt-get update --fix-missing After this Tor was installed normally with apt-get in...
Problem installing tor on Kali Linux
1,480,784,737,000
When posting the question How to create a darknet/Tor web site in Linux?, @Michael Kjörling asked how to setup multiple Tor Hidden services in the same host. In that question, for setting up a single www service, it was mentioned editing /etc/tor/torrc and adding: HiddenServiceDir /var/lib/tor/www_service/ HiddenServi...
For adding multiple Tor services in the same server, it is as simple as editing /etc/tor/torrc and adding two lines per each service, each with it´s own directory under /var/lib/tor/ ; For instance, to launch another two web sites in the same server, you can leave in the right side also port 80, and in the left side, ...
How to set up multiple Tor hidden services in the same host?
1,480,784,737,000
Is it possible to runnmap via Tor? When I googled around, I got the impression that Tor uses Polipo / Privoxy, which are socks5 proxies. So any TCP / UDP aware applications should be able to use them as a gateway to route their traffic. But somewhere it also said that nmap uses raw packets, so it can't be run over Tor...
Short answer Yes it is possible, use tsocks nmap -sT IP Long answer First of all Tor doesn't use privoxy, Tor provides an socks proxy for connecting via the Tor network. This means you won't see any network routes or things like that on your system but you have to configure your applications to use the Tor socks proxy...
Run nmap via Tor
1,480,784,737,000
I'm trying to download a file using wget, but I've exceeded (without knowing there was a limit) the limit of downloaded bytes for my IP address, which means that I can't download anymore the files I was downloading repeatedly by re-running a script. I was essentially trying to re-running a shell/bash script (somehow ...
torify as a nice frontend for torsocks which makes life far easier. It automates and simplifies the setup of torsocks in the background, making it as simple as simply invoking torify before the intended commands. What you need to run to put to work any program that uses TCP connections in the Tor network are the steps...
How to download file by faking the request's IP address?
1,480,784,737,000
I'm experimenting with OpenVPN connections routed through Tor, using pairs of Tor gateway and OpenVPN-hosting VMs. On the server side, link local ports are forwarded to Tor hidden-service ports on the associated gateway VM. On the client side, OpenVPN connects through socks proxies on the associated Tor gateway VM. Th...
Op (I, that is) didn't take this OpenVPN FAQ seriously enough: One of the most common problems in setting up OpenVPN is that the two OpenVPN daemons on either side of the connection are unable to establish a TCP or UDP connection with each other. This is almost [always] a result of: ... A software firewall running on...
How can I configure OpenVPN to wait for slow SOCKS proxies?
1,480,784,737,000
I use pianobar player. But before launching it I need to run tor and polipo. Both are continuous (are running until interrupted). Basically what I'm looking for is a single command which would spawn tor and polipo processes (their output is not needed) and then open pianobar in foreground. edit: turns out tor takes se...
put this in your .profile or .bashrc or .zshrc or whichever shell you use: function mycommand { tor & polipo & planobar } And now just run mycommand
How can I start several processes with a single command?
1,480,784,737,000
When I am using Tor, and not using the Tor bundle there is a possibility of DNS leaks in certain situations. What can be done to minimize it? Is it possible to resolve DNS via Tor?
To minimize DNS leaks, it is indeed possible to resolve DNS via Tor. For that, add to your /etc/tor/torrc the line: DNSPort 9053 And restart the tor service with: service tor restart To test it out, do: $nslookup set port=9053 server 127.0.0.1 www.cnn.com If using resolvconf/dnsmasq, change your /etc/dnsmasq.conf: ...
resolving DNS via Tor
1,480,784,737,000
I want to install a minimal OpenBSD 6.5 (x86_64) server to run a Tor relay. On Debian I would select ssh-server and usually standard system utilities in tasksel for a basic server install. What is the closest equivalent to such a configuration in OpenBSD? The documentation is not clear about this merely stating: "New ...
The "generally accepted best practice" is to install all the file sets, (which should not be confused with "run all daemons"). If you are inclined to keep some sets out because of safety concerns, remember that if someone has penetrated your system deep enough so that they can run a compiler, start daemons (like X) o...
What 'file sets' to install on a basic OpenBSD server to be used as a Tor relay?
1,480,784,737,000
I'm trying to setup proxychains on Kali like this : User > Tor > SOCKS5 > Out I've created my SOCKS5 server with danted running on port 1080. I setup an SSH connection on my Kali distrib : ssh -NfD 1080 user@address And I'm able to connect to the SOCKS5 server without trouble. Same when I'm trying to connect to Tor ...
I found an answer to my question and for a visibility purpose I think responding is better than editing. So I wanted to use Tor and a SOCKS5 proxy at the same time using proxychains. There are two ways to achieve that : With dante server Dante server is a SOCKS5 server (and client) with lots of options I don't know ye...
Proxychains, Tor, SSH and Danted. Connection denied
1,503,005,532,000
I was preparing my Kali Linux to run a Tor's Middle Relay. I was doing Tor Project's Repository configuration according to this site. I made steps 1 and 2. The 3rd step was to add the gpg key used to sign the packages by running the following command: sudo wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979...
First, let's break down what's happening. sudo is only being used to run wget, not the rest of the command. What you did is functionally equivalent to: # 1. Download a file and save as 'file.asc' sudo wget -qO- https://d...E886DDD89.asc > file.asc # 2. Dearmor that file (generates file.asc.gpg) gpg --dearmor file.a...
Add the gpg key used to sign the packages by running the following wget | gpg | tee >/dev/null command
1,503,005,532,000
When using some Tor browsers, for instance in iOS, I have a nice list with speeds and countries from which I can choose the relay points that can be used/from which I do get out. Can I get such a list from the Linux command line when running the tor daemon?
As the post related to man tor describes Does the Tor Browser Bundle cache relay information?, there is such a file with cache information in the system. DataDirectory/cached-consensus and/or cached-microdesc-consensus The most recent consensus network status document we’ve downloaded. So in Debian, the file w...
How to get tor relay points through the Linux command line?
1,503,005,532,000
I want to use a specific ip from Tor without changing it, even if Tor restart/close. I'm aware that by using Tor, either by using custom flags on Tor service/process, or by editing the config, one can achieve this, though I'm unaware of the exact details. A simple example that i know of is to use torify like so: torif...
To specify the ip that Tor will use, append: ExitNodes IP Into your torrc config file (which is generally in /etc/tor/torrc for Ubuntu/Debian variant, not sure for other OSes). Where IP is the wanted ExitNodes ip, which can be either found by already knowing some of them (like by noting them down when using other T...
Make Tor use only one specified ip address
1,503,005,532,000
I'm using the tor package coming with the debian-testing distribution: Package: tor Version: 0.3.5.8-1 I'm frequently using it in combination with proxychains like: proxychains -q curl -s -L https://ipecho.net/plain how do I change the route, in order to get a new IP from the command-line?
The answer is pretty straight forward, as root use: service tor restart or service tor reload
How do I change route (IP) of tor service from the command line?
1,503,005,532,000
I can reach my phone using: torsocks ssh myphone if I have this in my .ssh/config: Host myphone User u0_a162 Port 2222 HostName umqkh75wp2chf5av5esqhtyzedmw4it76dvs7ild2rikbcek6eyqfsqd.onion Can I somehow adapt the .ssh/config so that I can simply write this and run the same: ssh myphone Can I somehow move th...
Use this as the ProxyCommand: ProxyCommand nc -x localhost:9050 -X 5 umqkh75wp2chf5av5esqhtyzedmw4it76dvs7ild2rikbcek6eyqfsqd.onion 2222
ssh config to "prepend" torsocks
1,503,005,532,000
How can I configure VirtualBox to route all network access of a guest OS through TOR? My host system is running Linux, and I've already set up TOR on it.
What you're describing is a tor middlebox. There seems to already be documentation on how to do this. http://www.howtoforge.com/how-to-set-up-a-tor-middlebox-routing-all-virtualbox-virtual-machine-traffic-over-the-tor-network This might be different depending on what network manager you use.
How to configure VirtualBox to route through tor?
1,503,005,532,000
Is it ok for me to drop all types of ICMP packets? I.e. iptables -I INPUT -p icmp -j DROP. Everything except one service seems to work. I already stopped this service. To be specific I functioned as non-exit Tor relay and that seems to have stopped working. In 2 days I dropped 107K ICMP packets, which seems excessive ...
No, it's not OK. ICMP exists for a reason. For example, if you drop all ICMP packets you will not be able to communicate via IP with any host where the route to it is such your machine needs to be told to fragment the packets it's sending. At the very least look at the ICMP type and only drop those that you know are n...
Drop all ICMP packets?
1,503,005,532,000
I was going to install tor-browser. I had download package from here. I had cloned a git repo git clone https://aur.archlinux.org/tor-browser.git Then, I was trying to unpack it. cd tor-browser makepkg -s I was getting error/output something just like this : Validating source files with sha256sums... tor-browser...
You need to read the instructions. The very first (pinned) comment on the Package Details: tor-browser page says: Before running makepkg, you must do this (as normal user): $ gpg --auto-key-locate nodefault,wkd --locate-keys [email protected] The build is failing because the public key which signed the package is ...
Unable to unpack tor-browser git repo
1,503,005,532,000
command: gpg -vvv --debug-all --recv-keys A8BD96F8FD24E96B60232807B3B4C3CECC10C662 output: gpg: Note: no default option file '/home/user/.gnupg/gpg.conf' gpg: using character set 'utf-8' gpg: enabled debug flags: packet mpi crypto filter iobuf memory cache memstat trust hashing ipc clock lookup extprog gpg: DBG: [not...
I was struggling with this too for a long time. Then I found in the manual for dirmngr: --standard-resolver This option forces the use of the system's standard DNS resolver code. This is mainly used for debugging. Note that on Windows a standard resolver is not used a...
gpg recv-keys error: DBG: Not enabled <Dirmngr>, keyserver receive failed: Not enabled