date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,395,122,243,000 |
I have an NIC card on a Debian machine somewhere. The machine is turned off, but I need to know whether the NIC card is turned on so that I can send a wake-on-lan magic packet later (from another Debian machine) to wake it up. I have the MAC address of the card. Is there any way I can ping the ethernet card by MAC to ... |
You might have better luck using the tool arping instead. The tool ping works at the layer 3 level of the OSI model, whereas arping works at layer 2.
You still need to know the IP of the system however with this tool. There are 2 versions of it, the standard one included with most Unixes (Alexey Kuznetsov's) is the ve... | Can one ping a NIC by MAC |
1,395,122,243,000 |
I have found some tools that seems to update the OUI MAC address vendor database on my system, like get-oui, airodump-ng-oui-update or update-oui :
update-oui(8) OUI update-oui(8)
NAME
update-oui - download new version of the OUI and IAB lists
SYNOPSIS
u... |
I do not think there is an automated tool to do what you ask, but can be done by working directly on files oui.txt.
First of all it identifies the file downloaded, for example:
root@kalilloX:~# locate oui.txt
/var/lib/ieee-data/oui.txt
then search for the string you are interested. You must remove : or instead inser... | Command-line tool to obtain OUI vendor info from MAC address? |
1,395,122,243,000 |
I changed my MAC address with macchanger -A wlp68s0b1 at boot with crontab,
Here is what happens when I disconnect and reconnect:
While connecting after boot:
rahman@debian:~$ macchanger -s wlp68s0b1
Current MAC: 00:22:31:c6:38:45 (SMT&C Co., Ltd.)
Permanent MAC: 00:00:00:00:00:00 (FAKE CORPORATION)
After disconnec... |
NetworkManager will reset your MAC address during the Wi-Fi scanning.
To permanently change your MAC address:
Edit your /etc/NetworkManager/NetworkManager.conf as follows:
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=false
[device]
wifi.scan-rand-mac-address=no
[keyfile]
Edit your /etc/network/interfaces by ... | How to stop MAC address from changing after disconnecting? |
1,395,122,243,000 |
I have to extract from the command hcitool dev only the MAC address of the bluetooth dongle.
Output of hcitool dev is:
Devices:
hci0 xx:xx:xx:xx:xx:xx
I write this output to a file and try to get the info with awk:
hcitool dev > /home/pi/mario/BT.txt
awk ' { print $2 } ' /home/pi/mario/BT.txt
The output also cont... |
For you purpose is quite enough grep
hcitool dev | grep -o "[[:xdigit:]:]\{11,17\}"
-o outputs just finded patten
[[:xdigit:]:] mean all hexadecimal digits plus : char
{11,17} the set of chars should be neither less then 11 no more 17 in length
| Extract Bluetooth MAC Address: hcitool dev |
1,395,122,243,000 |
We know that we can use the MAC address to create an interface identifier, e.g. for a link-local IPv6 address which should be unique in the Network.
The image shows the way to do this:
My questions are:
How can I create an IPv6 address from a MAC using awk or sed?
OR is there any command that gives me the link-local... |
If you want to create a whole IPv6 address from a MAC (and a given prefix), you could use the excellent ipv6calc tool by Peter Bieringer.
The following command creates a link-local IPv6 address (fe80:: prefix) from a MAC address:
$ ipv6calc --action prefixmac2ipv6 --in prefix+mac --out ipv6addr fe80:: 00:21:5b:f7:25:1... | How to use shell to derive an IPv6 address from a MAC address? |
1,395,122,243,000 |
I've made an image of my system and I have given it to someone to run. They have successfully flushed their system with the image and are running it.
The problem is as follows:
The system normally has 2 Wireless Adapters. Both showing up in the lsusb:
pi@raspberry:~ $ lsusb
Bus 001 Device 004: ID 7392:7811 Edimax Tech... |
First three octets in a MAC address uniquely identify the manufacturer of the device. Udev rules allow you to match any number of characters with an asterisk. Thus, you can write a generic rule that will match any device of a specific vendor:
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="74:2f:68*", NAME="wlan0"
A... | Cloned system + network interfaces |
1,395,122,243,000 |
With a bash script, can I read the mac address of my eth0 and print it to a file?
|
ifconfig will output information about your interfaces, including the MAC address:
$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:289748093 errors:... | Print mac address to file |
1,395,122,243,000 |
I have set up a network as such:
Set up host-only networking on VirtualBox. The first adapter is configured with NAT, the second with host-only networking
HOST: Windows
GUEST: CentOS VM1, CentOS VM2 (clone of VM1)
When executing ifconfig -a on both VMs, I noticed that the MAC addresses are exactly the same. My quest... |
This is one of those things that surprises people because it goes against what they've been taught.
2 machines with the same hardware mac address on the same broadcast domain can talk to each other just fine as long as they have different IP addresses (and the switching gear plays nice).
Lets start with a test setup:
... | Identical MAC address on two different VM, yet I have internet connectivity |
1,395,122,243,000 |
Per this comment, I'm going to take advice and ask this as a separate question. I am trying to learn more about networking and security and want to play with tools to help increase my understanding.
Fing seems like a pretty cool tool - finding devices on the network and their associated MAC address. One could easily... |
I just ran Fing against my wireless network. Using tcpdump, it appears that Fing generates Address Resolution Protocol (ARP) request packets. ARP is a pretty simple protocol that runs at the Ethernet Protocol level (Data Link, OSI level 2). An ARP request packet has the broadcast address (ff:ff:ff:ff:ff:ff) as the "to... | How does FING (or any of the IP/MAC Address Mappers) work? |
1,395,122,243,000 |
In Red Hat Enterprise Linux (RHEL) 8, if someone does ifconfig eth0 hw ether abcd12341234,
all I know is ifconfig and ip -a,
so then is there a way to reliably get the real MAC address of that eth0 interface and if so how? ... other than for example rebooting to a Linux live CD coming from a reliable source to be su... |
This answer is about Linux.
ifconfig is obsolete and doesn't have access to a kernel API able to provide it this information.
This information has been able to be retrieved for a long time with ethtool --show-permaddr. Example (redacted):
# ethtool --show-permaddr eth0
Permanent address: 10:1f:74:32:10:fe
Some board/... | How to find unspoofed MAC address of NIC |
1,395,122,243,000 |
I am looking for a way to mask the client MAC address every time it appears in a logfile before using the logfile to present data to a customer (GDPR rules).
I can identify the MAC string using regex, but am unsure what the best way of masking is, since MD5 seems to be advised against as it's almost transparent!
I nee... |
As requested in the comment, here is an example how to perform such a substitution with sed. You used the /linux tag, so it should be safe to use GNU sed with its e flag for the s command:
sed -E 'h;s/.*clientMac":\s"([A-Z0-9]{12}).*/echo secretKey\1|md5sum/e;T
G;s/(.*)\s*-\n(.*clientMac":\s")[A-Z0-9]{12}(.*)/\2\1\3... | Replace MAC address with UUID |
1,395,122,243,000 |
I have just upgraded two servers from Debian 10 (Buster) to Debian 11 (Bullseye). Afterwards, I could not reach either of them via the network any more. After some investigation, the following problem turned out:
Both machines have a bridge device configured. Obviously, the algorithm which Debian uses to assign MAC ad... |
Browsing in Internet I found this bug report on systemd-udev related to Debian 11 bridges: systemd-udev interferes with MAC addresses of interfaces it's not supposed to do
#21185:
ash.in.ffho.net:~# for n in 0 1 2 3; do ip l add br$n type bridge; done
ash.in.ffho.net:~# ip -br l
br0 DOWN d2:9e... | How can I make Linux generate different MAC addresses for different bridge devices which are on different PCs? |
1,395,122,243,000 |
Sometimes I need to spoof MAC address, I'm doing so with this command:
ip link set dev eth0 address XX:XX:XX:XX:XX:XX
Is there a way how to set MAC address back to default without reboot?
|
See also:
sudo ethtool -P eth0
So, to set the MAC address back to its default (assuming GNU grep here):
set_to_real() (
for i do
mac=$(ethtool -P "$i" | grep -iEom1 '([0-9a-f]{2}:){5}[0-9a-f]{2}') &&
ip link set dev "$i" address "$mac"
done
)
set_real eth0
| Set MAC address to default |
1,395,122,243,000 |
I'm scratching my head about this question... I have a debian squeeze machine that is connected to an internal lab network. We have a lot of machines that have default proxy-arp configurations on them, and occasionally one of those machines starts hijacking a lot of lab addresses.
After resolving the latest Proxy-ARP... |
I found the problem... I was demonstrating how proxy-arp worked on a spare ethernet interface a few weeks ago and left the configs on the machine (although I had the interface DOWN).
When I removed these entries for 192.168.12.0/24 from eth2, I no longer had the problem.
[mpenning@netwiki ~]$ ip add show eth2
4: eth2:... | eth0 is proxy-arping, but /proc/sys/net/ipv4/conf/eth0/proxy_arp is 0 |
1,395,122,243,000 |
I need to read permanent (burned-in) MAC address of network adapter. Since MAC address can be easily spoofed, I need to read the real one which is written on EEPROM. I need to do it using C++ on Linux.
I tried using ethtool which is quite good and works fine. However on some systems it does not work as intented.
ethto... |
If you trust the local machine not to be spoofing, both ifconfig and ip addr will give you the MAC address of the hardware.
If you don't trust the local machine, neither ethtool, ifconfig, nor ip is going to provide you the information you need. Because there are very legitimate reasons for MAC spoofing (for example, ... | ethtool get permanent MAC address returns all 0's |
1,395,122,243,000 |
we are trying to add a static ARP entry to a FreeBSD system.
This works well with, for example,
arp -S 172.16.16.9 11:54:33:A8:B2:6B
. We have added this to a startup script to survive a reboot. So far so good.
However, if the physical link is cycled, the permanent ARP entry is flushed, too. Does anybody know of
a.... |
Becoming friends with FreeBSD
You seem to be on a partially correct path. I presume you have a lot of knowledge on Unix but not so much an actual FreeBSD system. The reason I am guessing this is you have approached it in a slightly different way than the typical user of rc.d in FreeBSD.
I find the question a bit thin ... | FreeBSD static ARP entry when link cycles |
1,395,122,243,000 |
Question:
I would like to find a way to have the HWADDR line in the ifcfg-eth0 script verify/update itself on-boot in case it changes when a clone or copy of the VM occurs. Is there a way to do so? In CentOS 6, removing the HWADDR line from the ifcfg-eth0 script made it much more dynamic, but I have yet to find a way... |
The easiest solution is probably to disable the "predictable device naming" behavior by setting the following options on your kernel command line:
biosdevname=0 net.ifnames=0
With this in place, the first ethernet interface on your system will be named eth0, the second will be eth1, etc. This is documented here.
Wit... | Forcing HWADDR to correct itself in ifcfg-eth0 network script on boot CentOS 7 |
1,395,122,243,000 |
I have a server in an internal network (login there via VPN) from where I login to the server via SSH with OpenSSH public/private key authentication. From a security point of view, I want to tie the MAC addresses of my three used clients via iptables on the server so that only these clients can login with it.
iptable... |
I am supposing that you want to prevent your SSH server from accepting connections from untrusted hosts even though they supply valid user credentials. Is it right?
A possible solution to tie users' public key authentication to selected client hosts is via host-based authentication. By setting up host-based authentica... | SSH with MAC based filtering using iptables - recommended? |
1,395,122,243,000 |
I know that I can change a network interface's MAC address by bringing the interface down, using a command like ifconfig eth0 hw ether 00:11:22:33:44:55 or ip link set eth0 address 00:11:22:33:44:55 and then bringing the interface up again. A command like ip link show eth0 then confirms that the change was successful.... |
Background
/proc and /sys filesystems are just a view of kernel structures, both filesystems reside in memory. Although both filesystems are writable (well, some of the files in there are writable) it is unwise to assume that they behave the same way as a real filesystems.
Operations that allow you to write into a fi... | Change MAC address of network interface on lower level |
1,395,122,243,000 |
I used the uuid command from the uuid-1.6.2-8.fc17.x86_64 package to generate version 1 UUIDs. The man page said that the default is to use the real MAC address of the host, but when I decoded the generated UUID, it is using the local multicast address. uuid v 1 shows:
5fc2d464-e1f8-11e1-9c3d-ff8beec65651
Decoding wi... |
The reason it's not using your actual MAC address is because the code is poorly written. The mac_address function in uuid_mac.c has this block of code:
if ((s = socket(PF_INET, SOCK_DGRAM, 0)) < 0)
return FALSE;
sprintf(ifr.ifr_name, "eth0");
if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0) {
close(... | UUID based on global MAC address |
1,395,122,243,000 |
I have machine at the office which is shut off I was hoping to turn it on from home using wake on lan. Reading about this, I have realized that I need the MAC address of the machine. Is there a way to find the MAC address of the machine from my ssh connection history?
I use an RSA key to connect to the machine.
|
No, ssh has nothing to do with MAC addresses. If you are using DHCP you can maybe look into the logs or configuration files to determine the mac address.
| Is there a way to find the mac address of a remote machine I have connected to with ssh? |
1,395,122,243,000 |
I have various small NUCs with attached on each one some of this USB3 LAN adapters (because the NUCs have only one Ethernet,
so I added extra ones with USB3 adapters).
You can see an image of the product here.
All of a sudden, probably due to an unattended automatic upgrade,
these devices started getting random MAC ad... |
This 6.8 kernel commit, backported to 6.1.x:
net: usb: ax88179_178a: avoid two consecutive device resets
intended to avoid a double reset on the AX88179-based NIC had as side effect to get a random MAC address for the NIC.
There's a fix in the works for future 6.9 kernel, already backported to kernel 6.1.85+ which ack... | Debian 12 – All of a sudden my USB3 LAN adapter gets assigned random MAC address at each reboot |
1,395,122,243,000 |
I only have the BSSID of the specific target device I want to connect to.
How can I determine the actual Wi-Fi network name that the device is connected to?
I'm using kali linux, and I used crunch 8 14 | aircrack-ng -a2 -b [target device BSSID] -w [file saved using airodump-ng].
|
To get the Wi-Fi (SSID) to a specific BSSID, you can use the wash command.
wash is a utility provided by the reaver package.
Install the reaver package:
apt-get install reaver
Use the following command to run wash and scan for nearby access points, replace [INTERFACE] with the name of your wireless network interface:
... | What is the command to get the wifi name of a BSSID device in Kali Linux? |
1,395,122,243,000 |
You probably know that MAC address can be generated, for instance, in the following way:
macaddr=$(dd if=/dev/random bs=1024 count=1 2>/dev/null|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/')
echo $macaddr
But this method can result in MAC address that looks like this one: 07:d4:51:9f:50:... |
extract the first byte (e.g. 07 from your example)
bitwise AND it with decimal 254 (11111110 - all bits except zeroth bit set)
bitwise OR it with decimal 2 (00000010 - only 1st bit set)
combine the first byte back with the last five bytes
e.g.
#! /bin/sh
mac='07:d4:51:9f:50:6c'
lastfive=$( echo "$mac" | cut -d: -... | How go generate a valid and random MAC address? |
1,395,122,243,000 |
Is it possible to generate a unique ID that wouldn't change over time unless there is hardware changes. The hardware must be generated with a c program.
That also would be great if it were robust to spoofing, like MAC address or hard disk serial number spoofing. But that is not an absolute requirement.
I need such an ... |
Short answer
From all my researches and attempts, I would say that it is not possible to make a program that would generate a unique ID respecting the following constraints.
The ID must be the same every time if generated on the same computer.
The ID must be different if generated on different computers.
The program ... | generate consistent machine unique ID in c programming |
1,395,122,243,000 |
Question:
What is the terminal command behind right clicking on the wireless icon (Ubuntu 15.04) and then unchecking "Enable Wi-Fi" the box?
Why am I asking it?
macchanger just work for me when I disable my wifi via GUI, call sudo macchanger -e wlan0 and enable the wifi via GUI again.
When I try using the command lin... |
If you're using NetworkManager (and you very likely are): nmcli radio wifi off. This is simply a command line interface equivalent of the widget. NetworkManager is a complicated beast. I'm not sure what the basic commands are that it's using.
| Disabling wlan0 adapter |
1,395,122,243,000 |
Does ifconfig show the MAC address of a network interface following ether?
Does ether mean ethernet? How does it mean Mac address?
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:b1:aa:1f txqueuelen 1000 (Etherne... |
As explained in the ifconfig manpage, in the section on setting options,
Set the hardware address of this interface, if the device driver supports this operation. The keyword must be followed by the name of the hardware class and the printable ASCII equivalent of the hardware address. Hardware
... | Does `ifconfig` show the MAC address of a network interface following `ether`? |
1,454,607,563,000 |
I'm connecting a linux machine using a nowadays popular Huawei Brovi E3372-325 LTE USB Stick to the internet. The special requirement is that incoming ssh/ping/NTP/... connections must reach my linux OS.
The state is, that using usb_modeswitch -X and the option driver I can bring up the 3 ttyUSB interfaces, and connec... |
If I'm not mistake, I don't use RNDIS right now.
RNDIS is a Windows-specific network interface driver API. Um, that as nothing to do with what you're doing, right?
What might be the reason, that ppp0 does not have a MAC address? How it's even possible?
a MAC address is an Ethernet concept; and PPP is not ethernet ... | USB LTE modem without MAC address? |
1,454,607,563,000 |
I have
Comcast cable <====> modem <===> router <===> freebsd server
My freebsd server is connected to wireless router via a network cable.
What I want to do is, to have a static ip for the server.
How can I do it?
|
You can set static IP address in FreeBSD in /etc/rc.conf file. First you need to know what is name of your network interface that you want to configure. Use ifconfig to list all network interfaces, when you find it add following line to /etc/rc.conf:
ifconfig_INTERFACE_NAME="inet IP_ADDRESS netmask NETMASK"
for examp... | static ip to a freebsd server |
1,454,607,563,000 |
I use this command to get the name of my network interfaces and their mac address
ip -o link | awk '$2 != "lo:" {print $2, $(NF-2)}' | sed 's_: _ _'
out:
enp2s0 XX:XX:XX:XX:XX:XX
wlp1s0 YY:YY:YY:YY:YY
and this one to get the IP:
ip addr show $lan | grep 'inet ' | cut -f2 | awk '{ print $2}'
out:
127.0.0.1/8
192.168... |
In bash this works:
paste <(ip -o -br link) <(ip -o -br addr) | awk '$2=="UP" {print $1,$7,$3}'
but it relies on the ip output being in the same order for link and addr. To be sure, you could use join with sort instead:
join <(ip -o -br link | sort) <(ip -o -br addr | sort) | awk '$2=="UP" {print $1,$6,$3}'
In sh c... | how do i get interface name, ip and mac from active interface only (except lo) |
1,454,607,563,000 |
I've been making a BASh script that changes your MAC Address to that of any manufacturer of your choice from a list. At the last part of the script that is run, it stops before finishing. Here is the code for that part:
function spoofUseMAC() {
echo
read -p "[*] $($stopAllFX; $bgBlack; $white)Enter the number cod... |
I found the problem: one of the $ifaces had quotes around it when it shouldn't have.
| Cannot connect to internet after changing MAC Address |
1,454,607,563,000 |
I'm using dnsmasq as a DNS server only (no dhcp), mapping Lan's hostnames to relative ip using /etc/hosts, but in the same Lan there's some ip assigned dynamically by a router (and I'd like to keep so, I don't want to use dnsmasq'd dhcp but I want to keep the ip dynamic).
Any way to map a MAC-address with a hostname s... |
Solved, see poor-mans-device-discovery-dns new link
Use dnsmasq's option addn-hosts=/etc/dyn.hosts to read an additional hosts file, which is generated periodically using the command arp-scan (and cron or whatever).
| dnsmasq as dns only, map mac-address to hostname for dynamic ip |
1,454,607,563,000 |
I have several devices connected to my wifi, and I need to assign them a static ip address, but NetworkManager gives them sometimes different ip addresses. I tried adding a file in /etc/network/if-up.d/ with the command
arp -i wlp6s0 -s 10.42.0.2 e8:b4:c8:2a:5c:45
but didn't work, then I tried disabling NetworkManager... |
The thing with Network Manager is that it calls dnsmasq for configuring dns and dhcp when the wifi acts as an Access Point. You can overwrite that configuration by adding files with the .conf extension into the directory
/etc/NetworkManager/dnsmasq-shared.d/
And thats all.
In my case I added a few lines configuring dh... | How to assign static ip to devices connecting over wifi using Network Manager? |
1,454,607,563,000 |
How do I find my MAC address on RHEL 7.3? When I ran ifconfig -a | grep HWaddr, nothing showed. It's an EC2 instance, if that means any deviation from the norm.
|
The command ip link shows the MAC address on all interfaces.
| How to find MAC address on RHEL 7.3? |
1,454,607,563,000 |
Running Ubuntu 22.04.3 LTS on top of WSL2
Output of ifconfig:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1492
inet 172.28.193.11 netmask 255.255.240.0 broadcast 172.28.207.255
inet6 fe80::215:5dff:fe3e:7ffa prefixlen 64 scopeid 0x20<link>
ether 00:15:5d:3e:7f:fa txqueuelen 1000 (Ethernet)
... |
A few notes, starting with the suggestion to use the ip command and its subcommands. This replaces the deprecated ifconfig command. I'll use ip commands for any examples in this answer.
As mentioned in the other answer, WSL2 by default Footnote uses a virtual network interface. As for "where the ... address ... com... | Machine MAC address with Ubuntu on top of WSL2 |
1,454,607,563,000 |
I'm trying to know a way to show only MAC address from every NIC I have on any running virtual machine:
So far I have this:
ipcopv2
-----------------------------------------------
Groups: /Infraestructura
State: powered off (since 2018-03-16T13:30:56.389000000)
NIC 1: MAC: 080027D40320, At... |
This seems to do the trick:
$ ip link | awk '/link/ { print $2 }'
00:00:00:00:00:00
00:20:78:1c:xx:yy
00:1d:92:67:xx:yy
| how to show only mac address on virtualbox |
1,454,607,563,000 |
I am new to Linux. Today, I installed Linux Mint (17.2) and tried to connect to the internet via a broadband connection. My Internet Service Provider (ISP) provided me with a fixed MAC address that they expect me to use as computer hardware identification. Thus, I need to change my current default MAC address. After d... |
Problem
You bought a new computer to replace your old one. You brought it home and followed the quickstart guide, and it's all setup. You then disconnected your ISP's equipment, or at least turned off the power to disconnect your connection. You then plugged everything in exactly the way it was before, and turned o... | Internet connectivity issues due to wrong MAC address (using Linux Mint 17.2) |
1,454,607,563,000 |
I'm using SuSE 12.2 with custom kernel 4.4.21 (minor changes related to real time environment).
Is it really necessary to down/up the interface during the MAC address change? What I observed is that it is not really necessary (the change succeeds on enabled interface, without a need to turn it off).
However - most of ... |
Changing the MAC address of an interface is hardware and driver dependent. When the interface is up, more actions must be done to update the interface's state while still running. Some drivers just don't support it, either yet, or because the interface's hardware can't permit such feature.
The modern method to disting... | Is it necessary to down/up interface during MAC address change? |
1,454,607,563,000 |
From https://networkengineering.stackexchange.com/questions/57935/is-a-network-interface-supposed-to-have-no-more-than-one-mac-address/57937?noredirect=1#comment100988_57937
A network interface in a MAC-based network always requires a MAC address, virtual or physical. However, there are networks that are not MAC-bas... |
Since the lo interface is not associated with a hardware network interface (it's a virtual loopback interface), it does not have an Ethernet hardware address (MAC address).
Communication though the loopback interface is not MAC-based. No routing needs to take place to send packets between NICs.
| Does `lo` have no MAC address? |
1,454,607,563,000 |
When I create ad hoc wifi network with shared Ethernet connection to router, does the router register only the ad hoc host MAC address or all MACs of devices connected to router via the ad hoc network? I assume only MAC of ad hoc host, but I'm not sure.
For example, I connect from laptop1 to laptop2 through ad hoc wif... |
It depends. If laptop1 is doing it as a bridge, it will appear to the router as if there is a switch with two computers. The router will have laptop2's MAC address.
Laptop1 might do it using NAT. That way, the router won't know about laptop2; laptop1 will take care of everything.
| MAC address through ad hoc wifi |
1,454,607,563,000 |
I installed CentOS 6.X with VMWare Fusion.
It looks like the mac address and nic names changes randomly.
eth8 and eth9, totally weird.
Anyone know why?
P.S VMWare pops a dialog asks me if I moved or copied the VM, although I never did anything to the Virtual Machine. And each time I choose I moved it, maybe it's rele... |
According to vmware-support You need to assign the MAC adress manually to avoid changes in the MAC automatically evrytime you moved it.
If you want to guarantee that the same MAC address is assigned to a given virtual machine every time, even if the virtual machine is moved, or if you want to guarantee a unique MAC a... | CentOS 6 in VMWare fusion: Unexpected MAC address change |
1,454,607,563,000 |
I want to match all data from ens19 with the mac address 88:7e:25:d3:90:0b use table 147.
My idea is to mark the data from 88:7e:25:d3:90:0b and give it a fwmark 14. Then use ip rule to the specified route table
So I make this command
nft add rule filter input iif ens19 ether saddr = 88:7e:25:d3:90:0b mark set 147
Err... |
According to the documentation, the syntax you want is:
nft add rule filter input iif ens19 ether saddr 88:7e:25:d3:90:0b mark set 147
| maching source MAC address in nftables |
1,464,617,834,000 |
In my script I need to randomly generate MAC addresses. The code below is from a larger script extracted, that's why the MAC address calculation is in a separate function.
This works fine with the code below. Although when I execute the script it slows heavily down after a number of generated addresses.
How can I impr... |
Use /dev/urandom! There is almost no good reason to use /dev/random instead of /dev/urandom -- see Myths about urandom or When to use /dev/random vs /dev/urandom -- and certainly not when you are going to publish the generated numbers all over the place.
/dev/random consumes entropy, blocks and waits if not enough of ... | How to improve performance in generating MAC addresses with od? |
1,464,617,834,000 |
I have a default gateway with IP address 192.168.1.1 and MAC address 5c:77:76:6e:0d:7b. It is my only wi fi modem router from which I receive internet.
But in input nftables logs I saw another one router with the same IP address and different MAC address 5c:77:77:6e:0d:7b. This unknown router sends pages which I didn'... |
Routers often have multiple virtual network interfaces, and the MAC address that gets assigned to these is made by flipping some bits of the hardware MAC address.
So the "illegal router" you see is probably another virtual interface of your "legal router". And if you block the packets (which are "legal" packets) then ... | Delete illegal router from network |
1,464,617,834,000 |
I have a network with 20 raspberries (clients) and 1 server.
I'd like to check MAC of client request, is that possible ?
Further, possible without being known (nor visible) by the client ?
NB : I aim to check if a client is not a fake one/imitation.
NB2 : I already run a VPN option. But I want to check MAC anyway.
|
Is your server a Linux host?
If you have a white list of your clients, you can use iptables to accept requests only from them on specific input ports. You can also log requests from bad clients in dmesg.
The following script defines MACCHECK chain to accept packets from approved 3 MACs, and drop others with logging. ... | Get MAC of a client request? |
1,464,617,834,000 |
I have been working on basic Linux network configuration. I am aware that IP addresses, default gateways, subnetmasks etc are assigned by a DHCP server but am unsure if MAC addresses are assigned by DHCP. Where do MAC addresses come from if a system is utilising DHCP?
|
The MAC address is a unique identifier that identifies the hardware (the network card)(the first bytes identify the manufacturer and type, the rest is a serial number). DHCP allocates an IP address to a MAC address.
In other words, on all networks you PC has the same MAC address, but can be given different IP address ... | Does a DHCP server assign MAC addresses to network computers? |
1,464,617,834,000 |
I wanna block a mac address which downloaded value is over "20480":
The json file:
{
"client_length": 3,
"clients": {
"ac:07:5f:77:40:e9": {
"id": 1,
"ip": "192.168.5.40",
"mac": "ac:07:5f:85:40:e9",
"added": 1576258952,
"active": 1576264642,
"duration": 5711,
"tok... |
There is a JSON parser for the command line called jq readily available for most Unices (this may have to be installed from your package system).
With it, it's easy to parse out the MAC addresses of the entries that have been downloaded more than 20480 times.
Once these are fetched, you may just pass these off one by ... | Read a json file and run a command in Bash |
1,464,617,834,000 |
Using one Ubuntu machine with one physical NIC, I want to make it seem that there are two or more additional machines on my real network, all controlled by this one Ubuntu machine.
For example, I have a 192.168.1.x network.
My Ubuntu machine has an IP of 192.168.1.10 with a mac address of 00:11:22:33:44:55.
I want to ... |
I have a system with address 192.168.1.175:
# ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 2c:f0:5d:c9:12:a9 brd ff:ff:ff:ff:ff:ff
altname eno2
altname enp0s31f6
inet 192.168.1.175/24 brd 192.168.1.255 scope global dyna... | Unique Mac address for Secondary IP address? |
1,464,617,834,000 |
I am running OpenWrt (=Busybox per SSH) so my amount of binaries is limited. I would like to change my MAC address only using a text editor like nano.
|
As you can see here, you should add the option macaddr in /etc/config/network in your desired interface.
For example:
config interface 'lan'
option ifname 'eth0.1'
option proto 'dhcp'
option macaddr 'xx:xx:xx:xx:xx:xx'
After that, restart the network service with /etc/init.d/network restart or reboot t... | How to change eth0 MAC address only using a text editor? |
1,464,617,834,000 |
For experimentation purposes I have bought some pairs of wifi and bluetooth devices and I plan to get some more.
However when two or more of the same type are plugged in to the hub lsusb lists multiple instances of the device.
Eg. a Realtek wifi adapter as the USB id 0bda:f179. If there are 3 of them this id will appe... |
In Linux, you can use the udev system to assign unique identifiers to USB devices based on various criteria such as the device's vendor and product IDs, its serial number, or its physical location on the system's USB bus. This allows you to uniquely identify devices even if they have the same USB ID.
To find the MAC a... | How are USB devices uniquely distinguished? |
1,464,617,834,000 |
I'm using a gateway connected to VPN to do forwarding with the port of an industrial LAN element.
I use iptables forwarding to access port 80/443 of my gateway in the browser to show me the contents of Port 80/443 of the item:
iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.37 --dport 80 -j MASQUERADE
iptables -t... |
Is there any way to check the existence of these rules before writing them again? Or delete them before you do?
You can use -C option for iptables. Check man iptables for more information. I think a neat way would be to create an array with the rules and check the rule for existence before you add it to the chain.
E... | Changing `iptables` rules by `MAC` address |
1,464,617,834,000 |
I have a samba share and I want to make some changes for security. Today everybody can read and write my files. It's not safe. I'd like to do the these things:
1- set up for everybody just read files
2- set and allow just to people with their IPs & Mac Address allowed to write
|
If you want to give only read permission and not write permission, open up your configuration file, the path to which is /etc/samba/smb.conf
Inside this file, move down to the share name of your directory.
Now there must be an option write list. Either comment this or remove this option. This will now not allow anyone... | Samba share security changes: read-only and IP/MAC restrictions |
1,464,617,834,000 |
I upgraded to Fedora 40 and was introduced to its new feature of MAC address randomization (for Wi-Fi interfaces at least).
How do I disable it? Links I found didn't work for me:
https://discussion.fedoraproject.org/t/f40-change-proposal-wifi-mac-randomization-system-wide/99856/5
https://fedoraproject.org/wiki/Changes... |
I tried to follow the advice from link 2 and create 2
I don't think that is what link 2 suggests.
The Fedora change introduces a new file /usr/lib/NetworkManager/conf.d/22-wifi-mac-addr.conf. That's all.
You can prevent that file from being loaded at all, by creating a file /etc/NetworkManager/conf.d/22-wifi-mac-add... | How to disable MAC address randomization in Fedora 40? |
1,464,617,834,000 |
I need to set the default gateway's MAC address statically.
I used the command:
arp -s <ip> <mac>
That works, but on reboot the entry is back to being dynamic.
I have tried:
Writing the same arp -s <ip> <mac> command inside a script, in the /etc/network/if-up.d directory
This seemed straightforward, but it didn't w... |
You would have to add this to your /etc/systemd/network/eth0.network file:
[Neighbor]
Address=<gateway IP>
LinkLayerAddress=<gateway MAC>
But the Description = Interface eth0 autoconfigured by PVE suggests this file may be managed by some other software, so it is possible any changes to it may be overwritten. Is this... | How do I set a static MAC address for the default gateway on startup? |
1,464,617,834,000 |
I want to match every traffic from a server but it is at the same interface.
MAC 88:7e:25:d3:90:0b > ens19 > table 147
Therefore I made this nftables rule
table ip filter { # handle 3
chain input { # handle 1
type filter hook input priority filter; policy accept;
iif "ens19" ether saddr 88... |
hook input is specifically meant for packets where the local host is the final destination – it is only reached after routing decisions have been made, as that's how netfilter knows which packets are processed through "hook input" chains and which ones go through "hook forward" chains. So at that point, your policy ru... | MAC based routing with nftables and ipv6 |
1,464,617,834,000 |
I have set up a DHCPD service on a Linux server, which shall provide fixed public IP addresses for cable modem devices based on MAC addresses.
Here is the configuration file of the DHCPD. The server's IP address is 212.200.200.34 (it has only one interface) and the CMTS has the IP address 172.30.30.2. The CMTS and the... |
Alright, I had two ways now to do it: Either add another NIC to the machine with an IP of the second IP range or try to get a bigger IP range (/26 instead /27).
First, I tried it with the second NIC, which worked out fine.
Later on I received a /26 net and reconfigured everything, so all CMs are in the same net.
Both ... | DHCPD with two different ranges |
1,464,617,834,000 |
This perl line very useful to change mac address but retain the first three pair.
perl -e 'for ($i=00;$i<6;$i++){@m[$i]=int(rand(256));} printf "00:16:3E:%X:%X:%X\n",@m;'
Generate some good address
00:16:3E:1E:B6:DB
00:16:3E:EE:8D:4A
But some with only one figure(E,D)
00:16:3E:80:21:D
00:16:3E:18:87:D
00:16:3E:E6:EF... |
This solution seems to work: %X become %02X
Old and not working
perl -e 'for ($i=00;$i<6;$i++){@m[$i]=int(rand(256));} printf "00:16:3E:%X:%X:%X\n",@m;'
new and working
perl -e 'for ($i=00;$i<6;$i++){@m[$i]=int(rand(256));} printf "00:16:3E:%02X:%02X:%02X\n",@m;'
| Perl script for generating MAC addresses |
1,464,617,834,000 |
Let's say I'm browsing from Ubuntu Virtual Machine using Firefox.
IF the website I am visiting can see the MAC Address, which MAC address will it see?
Is MAC Address of Ubuntu VM or MAC Address of the host Operating System?
|
The website you are visiting can't see the MAC address of your computer, unless it is at the same LAN.
For a computer on the same LAN, it depends on your VM settings. Bridged access will see the MAC of the guest, while NAT access will see the MAC of the host.
| Virtual Machine MAC Address or Host Operating System MAC Address? |
1,464,617,834,000 |
arp -a
doesn't show it. How can I get the MAC of it then? (on ex.: from a Linux)
|
If your switch is a managed switch, then you can use lldpctl from the lldpd package (on Debian/Ubuntu) to know its MAC address.
The lldp package is described as follows:
lldpd is a 802.1ab implementation (LLDP) to help you locate neighbors of all your equipments.
The man page for lldpctl shows how to use it:
NAME
... | How to get switch MAC address if it's a layer2 one? |
1,412,767,588,000 |
Whats the difference between mail and mailx?
I'm trying to troubleshoot a problem where I can send mail from server A with this echo $MESSAGE | mail -s "$SUBJECT" -r $FROM $RECIPIENTS command but executing the same command from server B throws me this error (Both servers are RHEL)
mail: invalid option -- r
Usage: m... |
Behold the confusing history of mail, nail, mailx.
Briefly, mail is the older program, mailx (formerly nail in some implementations) is a newer version , with an extended mostly-but-not-totally-compatible interface.
mailx is still quite old, created around 1986 and standarized as part of POSIX in 1992. There are sev... | Difference between mail and mailx? [duplicate] |
1,412,767,588,000 |
I know we can use mail command in terminal to start using the mail program in interactive mode.
However, I want to read the email using mail command non-interactively.
Is there a command like
$ mail -optionToReadMail -mailNumber 1;
which will display the content of email in stdout ?
|
To print the first mail message in your default mailbox, use:
echo p | mail
mail is only interactive when stdin is a terminal. Because mail gets its stdin from a pipe, it is non-interactive. The p command (print) tells it to print the default (first) message.
For more options, you may find that man mail is very hel... | use 'mail' to read email from command line |
1,412,767,588,000 |
I'm trying to send unix mail (heirloom-mailx) via bcc.
$ mail -V
12.5 6/20/10
My MTA is exim, which sends via Gmail SMTP.
I can execute the following:
echo -e "body" | mail -s 'subject' -b [email protected],[email protected] [email protected]
All addresses receive the email, however the bcc is not hidden. i.e. in th... |
heirloom-mailx hardcodes the options to pass to /usr/sbin/sendmail, and unfortunately the ones it passes don't make Bcc: headers work right in exim. That isn't really fixable, without patching and recompiling it. (You need to have it add -t to the arguments, and then either not pass the list of email addresses or alte... | How can I bcc with mailx? |
1,412,767,588,000 |
I had a problem that gmail was blocking emails sent using mailx. I solved this by setting up an appropriate ~/.mailrc, which looks like:
set smtp-use-starttls
set nss-config-dir=/home/theuser/.certs
set ssl-verify=ignore
set smtp=smtp://smtp.gmail.com:587
set smtp-auth=login
set smtp-auth-user=xxx
set smtp-auth-passwo... |
mailx only sends mail if you pass it the destination address on the command line. When you run it with no arguments, it reads interactive commands from its standard input. Beware that your tests fed it garbage which has been interpreted as commands; some of these commands may have corrupted your mailboxes, sent out em... | Calling mailx from crond |
1,412,767,588,000 |
I was trying to send an email to multiple persons using mailx (mailx (GNU Mailutils) 3.4). I did that successfully on a previous version of Ubuntu, v16.04, and the script was working fine. Now I have Ubuntu 18.04 and the following problem:
mailx: unrecognized option -S
mailx: unrecognized option -S
mailx: unrecognized... |
Quick and dirty:
mailx is a link to s-nail so you should use s-nail instead as according to its Bionic man page it still has the -S option.
Do it properly:
You should avoid sending mail like that because anyone that has access to ps can read your password as it's on the command line and you should look into using the ... | Ubuntu 18.04: Error with mailx smtp - mailx: unrecognized option "-S'"? |
1,412,767,588,000 |
I would like to download all the e-mails in my old e-mail server. It uses POP3 and I'm interested in e-mails in "Inbox" and "Sent" folders. Once I have downloaded all the messages, I would like to make a script which lists all the e-mails between my e-mail address and one certain e-mail address in chronological fashio... |
Traditional mailx does not support IMAP or POP, but the one that comes with Linux does.
For your particular problem, I recommend using fetchmail instead. You can use the --mda option to have fetchmail execute a script of your choice for each downloaded message. It can even pass the From and To addresses as parameter... | How to download all the e-mail messages from POP3 server to a single text file with mailx? |
1,412,767,588,000 |
I can't install mailx on CentOS 9.
yum install mailx -y
Last metadata expiration check: 0:04:13 ago on Sat 09 Apr 2022 07:55:59 PM UTC.
No match for argument: mailx
Error: Unable to find a match: mailx
|
According to Bugzilla Bug 2001537 "mailx -> s-nail replacement in CentOS Stream 9", mailx was replaced by s-nail. There's also a reference to the same in the Red Hat's "Considerations in adopting RHEL 9" - Appendix A. Change to packages - Package replacements.
Install the replacement package with: yum install s-nail.
| Install mailx on CentOS 9 |
1,412,767,588,000 |
I am using mailx command to send mail,
I tried it by two ways..
mailx -s "This is Subject" toAddr < bodyFile.txt
mailx -r "fromAddr" -s "This is Subject" toAddr < bodyFile.txt
I am getting same error:
send-mail: fatal: parameter inet_interfaces: no local interface found for ::1
I want to know how to resolve that er... |
Mailx is just a command-line tool to pass mail to your Mail Transfer Agent (MTA; whatever it is you have installed: sendmail, exim, ...). It does this by invoking the command sendmail (usually /usr/sbin/sendmail). Your MTA provides this command to, well, send mail.
In your case, it tries to contact a server on the IPv... | what things i should know when using mailx command |
1,412,767,588,000 |
I'm trying to send an HTML email from our CentOS server to users. In the long run I'll be building a COBOL program that runs the command to send reports to the user.
Here are a few details.
CentOS 6.4
MAU : Mailx
MTA : Postfix 2.6.6
Postfix is running a relay through an exchange server.
As for what commands I'v... |
Since you seem to have full control over the generated text file, the simplest and probably most portable way would be to involve /usr/sbin/sendmail directly.
/usr/sbin/sendmail -t < complete-mail.txt
This would require you to add all important headers yourself (From, To, Subject, and Content-Type). The file should ... | Sending HTML using mailx with postfix 2.6.6 and centOS 6.4 [duplicate] |
1,412,767,588,000 |
Having many short mail messages in my inbox, it's quite annoying that even short messages are sent though a pager (less), requiring to press 'q' before I can view the next message (for example).
I read the manual page about pager, but none of these did work:
PAGER= mailx
set pager=
unset pager
unset PAGER
How can I d... |
There are two major problems that prevent an easy solution for the problem:
As indicated in the mailx man page (SLES ships Nail’s mailx), “Variables in the environment passed to mailx cannot be unset.”
PAGER (as set from within mailx) cannot have parameters, so something like set PAGER="LESS=-F less" or set PAGER="s... | How to avoid the "pager" in mailx? |
1,412,767,588,000 |
How can I set up mailx to send messages to my Gmail account? What I do now is run the command:
mail -s "hello kid" [email protected]
It freezes and does nothing. I tried some variations, but all of them just froze dead in my terminal. Is there anything I need to configure in mailx before actually using mail?
There w... |
The command mail -s "hello kid" [email protected] is waiting for you to type the mail message and then control-d. After you do that the message will be sent. If you just want a quick test, do:
echo `date` this is a test | mail [email protected]
and the message will be sent immediately.
| How to configure mailx to support Gmail? |
1,412,767,588,000 |
Lets say I have 5 messages in /var/mail/ and I want to read one message at a time and then do some string search in that mail before moving on to the next message. Is there a command that I can use to parse one message at a time ?
I am looking to write a bash script which will read all messages in an mbox file & then ... |
The formail tool from procmail (available in any distribution, it's a classic) is designed precisely for this purpose.
Basic usage:
formail -s myprogram --option
runs myprogram --option on each mail in turn. The program receives each mail on its standard input.
| How can I read one message at a time from /var/mail |
1,412,767,588,000 |
I have setup unattended-upgrades on servers running Raspbian (Raspbian GNU/Linux 9.4 (stretch)). Version of Unattended-upgrades: 0.93.1+nmu1
Updates work, but I am having problems with the email reporting.
I want to use mailx for sending reports. If I run the update with command unattended-upgrade -v -d the report get... |
Your question is a variation of the FAQ Why do things work differently under systemd?.
One of the benefits of systemd is that it provides a consistent execution environment. To error on the side of security and simplicity, the environment variables set are minimal.
The related docs on the systemd execution environmen... | Unattended upgrades won’t use mailx when run by Systemd |
1,412,767,588,000 |
Say I receive a message with an attachment, and all I want to do is to resend this message to another address. Is it possible to do this using plain mailx? If so, how? I know Heirloom mailx has a resend command, but I was wondering if it is possible to achieve this result using more primitive versions of mailx.
|
According to heirloom mailx's documentation:
resend: Takes a list of messages and a user name and sends each message to the named user. 'Resent-From:' and related header fields are prepended to the new copy of the message.
For a bare-bones way to achieve the same effect, you don't even need to use an MUA at all. You... | Can I resend a message with (plain) mailx? |
1,412,767,588,000 |
On my Raspbian server, I wish to have local *nix mail delivered locally, as well as to an external address. /home/pi/.forward contains pi,[email protected]. I've run sudo dpkg-reconfigure exim4-config with the following options.
mail sent by smarthost; received via SMTP or fetchmail.
System mail name: raspberrypi.
IP... |
With most mailers you can do something like this in the /etc/aliases file.
joe: joe, [email protected]
After making changes to this file you typically have to run the command, newaliases.
References
How to redirect local root mail to an external email address on Linux
Forwarding email and must keep a copy
| How can I forward local *nix mail to an external account while keeping the local copy? |
1,412,767,588,000 |
By using find command I got multiple files. Now I want to add all these files as mail attachment. How do I add these files as attachment in single mail?
I want to implement this in script. Do I need to use for loop and store the files in array variables?
EX: I got 3 files results by the following
find . -type f -name ... |
You can do it with mutt like this:
mutt -a $(find . -type f -name "sum*")
If you want to do it non-interactive, try
mutt -s "Subject" -a $(find . -type f -name "sum*") -- [email protected] < /dev/null
If mutt is not installed, here is an example with mail and more tools (e.g. mpack)!
So it should be something like
... | Attach files for sending mail which are the result set of find command |
1,412,767,588,000 |
On my computer, mail is stored in ~/Mailbox, not in a centralized directory. Is there a way to get bsd-mailx to read mail from there, instead of looking in /var/mail?
|
You can change the location of the mailbox in two ways. The first is using the MAIL environment variable:
export MAIL=$HOME/Mailbox
The other method is to use the -f option to mailx to specify a mbox file manually:
mailx -f ~/Mailbox
| Change mailx mailbox location |
1,412,767,588,000 |
I know that you can change the from address in *nix mail by specifying command-line options. However, is there a way to set it globally, so that it is respected by forwarding?
I tried modifying the $REPLYTO environment variable, but this did not help.
Background
I have set up my Raspbian mail to forward by configuring... |
It sounds like you want Exim's address rewriting.
In the rewriting section of your Exim config file, you will probably want something along the lines of this:
[email protected] [email protected] Ffr
You may need to adjust the flags ("Ffr") to the specific behavior you want.
More generally, see:
http://www.exim.org/ex... | How can I change the from address in *nix mail globally? |
1,412,767,588,000 |
I am sending mail to a list of users, using the mailx utility:
mailx -s "$SUBJECT" "$TO" < $FILE
It is working fine with valid emails, but I am getting a dead.letter issue when I try to send mail like adffadf, i.e., the string is not a valid email,
I want this dead.letter to not be occurring even for users having any... |
The man page for my mailx says a lot of things about set nosave and so on, but they don't seem to work. The only way to stop your dead.letter file growing I have found is to replace it by a link to the special file /dev/null.
rm ~/dead.letter
ln -s /dev/null ~/dead.letter
| dead.letter issue on Linux? |
1,412,767,588,000 |
I need to send the generated CSV files on regular intervals using script. I am using UUENCODE and mailx for the same.
But i need to know that is there any method/way to know that email sent successfully? Any kind of acknowledgement or feedback or something???
It is likely to report for any error. Also the file is conf... |
Email was designed back when computers did not have a permanent, fast network connection to each other, on the model of postal mail. When you send an email, it gets sent to a server, which sends it to another server, and so on until the email reaches its destination. The oldest mail systems had local delivery, then th... | Is there any way to check email sent success acknowledgement? |
1,412,767,588,000 |
(Note: I have seen this question, but it does not work for me)
I am attempting to send an email with an attachment using Bash on Debian Stretch, using the mailx package (not mutt). My implementation does not support the -A parameter (it's an invalid option), and the -a parameter is for adding headers.
I have tried man... |
Your original command will work if you have the heirloom-mailx package installed.
sudo apt-get install heirloom-mailx
Then you can:
mailx -s "Test" -a /home/user/filename.xlsx [email protected] < /root/emailbody.txt
| Debian mailx won't attach files to emails |
1,412,767,588,000 |
I have a postfix server running on an EC2 instance. I want to forward all email, via SES, to my personal inbox.
The problem: AWS only allows a FROM address that is verified in the AWS console and the FROM address in this case could be anything, for example: twitter.com. I cannot white-list my server's IP and say: "Acc... |
Based on our discussion in chat, I'm going to provide you my hackish, customized solution that will change the "FROM" address as we expect it to be, and then deliver to the original destination point but add the "Reply-To" header.
This is a very hackish approach, but should manipulate the messages as you expect before... | Forward email but change the FROM address |
1,412,767,588,000 |
I have setup a Unix machine with uucp (Unixware)
connected via direct serial to Slackware machine.
Using uucp.
The copy works
on Unixware
uucp -m /usr/bin/view Slackware1\!/var/spool/uucppublic
mailx
....
.....
Content-Type: text/plain; charset=us-ascii
Status: R
Content-Length: 121
REQUEST: unixware2!/usr/bin/view... |
Solution found
on /etc/uucp/sys
instead of
commands mailx
we use
commands /usr/bin/mailx
Works fine.
The command for sent email using mailx is this
uux - -z Slackware1\!/usr/bin/mailx -s subject myuser
or in one line
echo -e 'Hello, A message for you\nhow are you...blablabla' | uux - 'Slackware1!mailx myuser'
| Uucp: copy...but not command execution allowed |
1,412,767,588,000 |
I've come across different names in different places: Light MTA, Remote MTA, Smarthost, etc.
Generally, I do not want to install a full-fledged mail server (such as sendmail, postfix, exim), but only send notifications/emails using an existing external ISP/mail provider (such as dismail.de, mailfence.com or others) wi... |
After conducting my research:
From the list given above, message queuing and retrying (for example when the laptop was temporarily offline or the mail server was temporarily down) only support:
msmtp
nullmailer
dma
msmtp:
I rejected msmtp because queuing is not supported natively and requires a workaround through ad... | Light program (mini MTA?) for system mail (only sending/relay via external server with unattended-upgrades, cron, smartmontools, etc.) |
1,412,767,588,000 |
I have a cron job which runs a long script producing lots of output. Some of the output is lines delimited by single carriage returns; when run from the command line, these make the successive lines overwrite each other, providing progress output without overly polluting the backscroll. However, when looking at the ou... |
It turned out that the issue lay with mailx's pager setting. It began using more for some reason, when previously it had used less (which does the escaping). Linking more to less again restored the old behavior.
| Control character handling in cron/mailx |
1,412,767,588,000 |
I'm trying to setup mailx to use my Gmail account. I've found a configuration that can send mail successfully but it requires me to store my email password in a configuration file in my home directory. I would like to be prompted for the password every time rather than storing it.
I've tried leaving out the smtp-auth... |
Which version of mailx are you using?
heirloom-mailx 12.5 on Ubuntu 14.04 prompts me for the password every time if there's no smtp-auth-password setting in ~/.mailrc. This feature was added in 12.0 in March 2006 according to ChangeLog.
| Using mailx without storing a password |
1,412,767,588,000 |
I just set up a VPS with Debian 7 x64, and removed Sendmail along with some other programs. When it removed Sendmail, it also installed Exim. When I removed Exim, it installed xmail.
Is there any reason why it seems to require a mail program?
I used apt-get remove --purge sendmail* exim* to remove them
|
One of your installed packages depends on installed MTA. This is most likely cron. You can view why a package (or meta package) is installed with aptitude:
aptitude why mail-transport-agent
| Why does uninstalling sendmail install exim, and uninstalling exim installs xmail? |
1,412,767,588,000 |
I want to install heirloom-mailx on Ubuntu 14.04
My current /etc/apt/sources.list reads like this:
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://ar... |
You should have the following line in your sources.list:
deb http://security.ubuntu.com/ubuntu trusty-security main universe
Then run:
sudo apt-get update
sudo apt-get install heirloom-mailx
| How to install heirloom-mailx on Ubuntu 14.04 |
1,485,760,371,000 |
If postfix is setup as the MTA using its virtual transport to deliver mail to a local mbox file (and handling delivery of outgoing messages), and mailx is the MUA, being used on that same computer for reading and composing messages, can only one of these operations happen at once due to mbox file locking?
If a user is... |
You are right, Postfix will lock the mail file during delivery.
The mailbox is locked for exclusive access while delivery is in progress.
Read more about it here
But that doesnt mean that your other incoming mails will bounce. If postfix cant deliver during a try,
Apr 15 14:02:25 server.tld postfix/local[67533]: D8C4... | How do postfix and mailx interact with mbox locking? |
1,485,760,371,000 |
Problem Statement:-
Currently I am sending an email using mailx by attaching an html file within the email. But I want to send an email using mailx command instead of attaching the html file in an email, I want to show the results of html file within an email body.
Below is the script I am using to send an email wit... |
You cannot do that with text/plain email. To directly embed that html into the email message will only work if the receiving email client software supports JavaScript. I am not aware of any that do.
You basically have two options. The first is to have graphing software produce an image file that can be embedded in ... | Send the Output of an HTML file within the email body using mailx |
1,485,760,371,000 |
new person here.
I would like to run uptime and bdf and have the output emailed to me.
I have the mailx part down-
/usr/bin/mailx -s "daily_update" [email protected] </home/daily_update
And I am ok with how to add it to the cron so it sends the email everyday at 8:00am.
Just not sure how to do the scripting part that... |
cron sends email with any command output by default, either to the user specified by MAILTO, or to the owner (which requires local email delivery to work).
A crontab such as this should do the trick, no need to handle email specially:
[email protected]
0 8 * * * uptime
0 8 * * * bdf
| How to run a few commands and have the output emailed once a day? |
1,485,760,371,000 |
Currently I have file with structure as
Foo Sign: blah
SubFoo Sign: blah
BarDate: 2017-11-31
Foo Sign: blah
BarDate: Never
Foo Sign: blah
BarDate: 2016-12-20
Foo Sign: blah
BarDate: 2014-12-20
.... and so on
This are the main four categories of data which resides in the file. Don't go with the foo... |
You can get current epoch time with
date "+%s"
You can also convert any time format to epoch time:
date -d "${MY_TIME}" "+%s"
And these epoch times you can substract.
Having the line with BarDate: 2017-11-31 in a variable LINE, you can extract the date using:
MY_TIME=$(echo $LINE | cut -d: -f2)
| How to extract date and calculate if it is within "x" days from today? |
1,485,760,371,000 |
How can I check with bash or python (preferred) if there are some unread mails in /var/spool/mail/$USER like pam_mail does?
I'd like to use this for my own custom motd script, motd.dynamic
|
The way to determine whether there are unread mails in a mailbox file is traditionally to check if the access time is earlier than the modification time.
You can easily find these times using the stat command; by specifying a custom output format these values can be imported into the shell:
eval $(stat -c 'atime=%X; m... | check "newness" / "is-read" of /var/spool/mail/$USER like pam_mail for custom motd script |
1,485,760,371,000 |
I've installed mailx, and when I try to send an email, like:
echo "Test" | mailx -r "[email protected]" -s "Test" "[email protected]"
It executes. But I don't receive the email. How do I set mailx up to send to Gmail, while retaining the ability to customize the sender ID?
|
You can't do this without some form of authentication that you are the correct user.
https://en.wikipedia.org/wiki/Email_spoofing
This used to be a big problem, before people fixed it with cryptographic signatures. You could receive an email from a criminal, pretending to be your boss, asking you to send them the secr... | Using Mailx with Gmail |
1,485,760,371,000 |
I have 2 Linux CentOS 7 machines, a Samba server and a Postfix server. The Postfix server is configured to use SASL authentication and TLS encryption. On the Samba server, I can connect to the Postfix server using openssl.
[root@samba1 ~]# openssl s_client
-connect mail.example.com:587
-starttls smtp
-CAfile /etc/... |
dave_thompson_085 answered in the comments:
smtps: means to initially connect with SSL/TLS, which 587 does not support. You want to connect then start SSL/TLS, which is generically called starttls.
Use:
smtp=server:587
and
smtp-use-starttls
| Mailx SSL/TLS handshake failed: Unknown error -5938 |
1,485,760,371,000 |
save internal variable enable saving of messages in the dead.letter file on interrupt or delivery error.The default is save.
problem: default is save so dead.letter file is created at home directory,
expected: I want to change the value of save variable so file will not be generated
I tried set save=false;, but its no... |
The man page for my mailx says a lot of things about set nosave and so on,
but they dont seem to work. The only way to stop your dead.letter file
growing I have found is to replace it by a link to the special file /dev/null.
rm ~/dead.letter
ln -s /dev/null ~/dead.letter
| how to set Internal Variables in mailx in linux? |
1,485,760,371,000 |
I am sending multiple files using following line in my script
find . -type f -name "Sum*pdf*"|while read name; do uuencode "$name" "${name##*/}"; done | mailx -s "North Bus Correction" $RECIP
Now I want to have body of mail as well with the attachments and I have tried the below one
(echo "Bus Correction";find . -ty... |
Wow.... My trails were worked
(echo "Bus Correction" && find . -type f -name "Sum*pdf*"|while read name; do uuencode "$name" "${name##*/}"; done)| mailx -s "North Bus Correction" $RECIP
| Mailx with multiple uuencode attachments and body |
1,485,760,371,000 |
I have exim installed and configured as "internet site; mail is sent and received directly using SMTP". Mail is stored in /home/*user*/Maildir and it is really there. I can send and receive mail globally and internally, but my Debian Wheezy's mail program isn't showing any of it.
Does mail support Maildir format at al... |
Okay, @jordanm gave me a right direction, but information is scattered across the Net, so I think it is worth to post some kind of guide myself.
Install mailutils and heirloom-mailx packages:
sudo apt-get install mailutils heirloom-mailx
Update alternatives for mailx — choose /usr/bin/heirloom-mailx:
sudo update-alt... | Debian: exim, Maildir and mail |
1,485,760,371,000 |
Unable to send out emails from my Linux Host. Below is the command I try:
echo "This is the message body and contains the message" | sudo mailx -v [email protected] -s "This is the subject"
or
mail -s "Test Subject" [email protected] < /home/system/mailbody.txt
Output:
Mail Delivery Status Report will be mailed to... |
In an update you showed your /var/log/mail.log contained this:
Feb 8 15:29:43 Efendibey_Live postfix/qmgr[1193]: E4F5F16A9:
from=<root@efendibey_live.localdomain>, size=467, nrcpt=1 (queue active)
Feb 8 15:29:45 Efendibey_Live postfix/smtp[18225]: E4F5F16A9:
to=<[email protected]>,
relay=mx.zoho.com... | Unable to send out emails from my Linux Host |
1,485,760,371,000 |
I was trying to send a mail from the shell script using the command
mailx -s "TEST MAIL" -c "user_name ..." user<message.txt
but it generates an error as unrecognized option -c ,the same happens if i
use -b as a option for blind copy, so what options do i need to use for cc and bcc here ???
|
Debian and Ubuntu have replaced Heirloom mailx with s-nail mailx. Both support the -b and -c options. But there are other mailx commands from other packages which do not.
I suspect that you, too, are unknowingly using the GNU Mailutils mailx or the NMH mailx. The latter re-spells the -c option as -cc but has no equ... | -c and -b options not working in mailx in ubuntu |
1,485,760,371,000 |
In Heirloom mailx, one can specify "from address" (-r) and "reply-to address" (-R). What is the difference between the two?
|
From RFC 2822 para 3.6.2:
When the "Reply-To:" field is present, it indicates the mailbox(es) to
which the author of the message suggests that replies be sent. In the
absence of the "Reply-To:" field, replies SHOULD by default be sent to
the mailbox(es) specified in the "From:" field unless otherwise
specifi... | Difference between Reply-To address and From address in an email |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.