Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
7
votes
1
answers
3461
views
How to run start up scripts on Amazon linux?
I'm trying to create some script that should run on start. Now I've created some myScript file under the /etc/init.d/ and then run `sudo chkconfig --add myScript;` `chkconfig --list myScript` output is: myScript 0:off 1:off 2:on 3:on 4:on 5:on 6:off **myScript:** #!/bin/sh # chkconfig: 2345 98 02 #...
I'm trying to create some script that should run on start.
Now I've created some myScript file under the /etc/init.d/
and then run
myScript 0:off 1:off 2:on 3:on 4:on 5:on 6:off **myScript:** #!/bin/sh # chkconfig: 2345 98 02 # description: # processname: # Source function library. if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 0 fi KIND="_" start() { echo starting
N 3 Need some help.
sudo chkconfig --add myScript;
chkconfig --list myScript
output is:myScript 0:off 1:off 2:on 3:on 4:on 5:on 6:off **myScript:** #!/bin/sh # chkconfig: 2345 98 02 # description: # processname: # Source function library. if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 0 fi KIND="_" start() { echo starting
date
>> ~/myScript.log
}
stop() {
echo stopping myScript
}
restart() {
echo restarting
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
Now I can successfully run service myScript start
and log record will be appended.
But if I run sudo reboot
or restart the instance with AWS UI console it doesn't work as was expected.
Although runlevel
output is:N 3 Need some help.
Silk0vsky
(213 rep)
Nov 15, 2016, 11:19 AM
• Last activity: Aug 4, 2025, 09:09 PM
0
votes
2
answers
2585
views
How do I forward all requests from local port to port on my remote Amazon EC2 instance which is using a custom ssh port
I am trying to forward all requests from local port 8888 to port 8888 to my remote Amazon EC2 instance. The only difference is that my EC2 instance is running ssh on custom port 56129. I can successfully ping my ec2 instance from the local system but when I try to forward requests from a local port...
I am trying to forward all requests from local port 8888 to port 8888 to my remote Amazon EC2 instance. The only difference is that my EC2 instance is running ssh on custom port 56129.
I can successfully ping my ec2 instance from the local system but when I try to forward requests from a local port to a port on ec2 instance, I am getting:
>channel 2: open failed: administratively prohibited: open failed
I am using the following command:
ssh -i -NfL 8888:localhost:8888 @ -p 56129
Then it asks for a password. There are no messages when it accepts the password. But as soon as I open localhost:8888 in my browser, I get the error message:
>channel 2: open failed: administratively prohibited: open failed
Some observations -
- Running
ssh -i @ -p 56129
with a
password is successful.
- I am running Jupyter Notebook at port 8888 in EC2 instance. curl localhost:8888 returns nothing when done after ssh-ing into the instance
kusur
(111 rep)
Feb 20, 2022, 03:17 PM
• Last activity: Aug 4, 2025, 04:10 AM
3
votes
2
answers
2190
views
Timeout when connecting RDS using AWS session manager via EC2 instance
I am having trouble accessing AWS RDS instance in a private subnet using session manager through ec2 instance (Ubuntu). Port forwarding using AWS Session manager - ```shell aws ssm start-session --target $INSTANCE_ID \ --document-name AWS-StartPortForwardingSession \ --parameters '{"portNumber":[330...
I am having trouble accessing AWS RDS instance in a private subnet using session manager through ec2 instance (Ubuntu).
Port forwarding using AWS Session manager -
aws ssm start-session --target $INSTANCE_ID \
--document-name AWS-StartPortForwardingSession \
--parameters '{"portNumber":,"localPortNumber":["8000"]}' \
--profile=production \
--region=us-east-1`
Now local port 8000 successfully forwarded to port 3307 of EC2.
lsof -nP +c 15 | grep LISTEN
session-manager 59744 xrage 12u IPv4 0xa6c821d0a800e9a1 0t0 TCP 127.0.0.1:8000 (LISTEN)
EC2 instance has an iptable rule that forward all traffic on port 3307 to rds host at port 3306 (MYSQL PORT).
sudo iptables -t nat -A OUTPUT -o lo -d 127.0.0.1 -p tcp --dport 3307 -j DNAT --to-destination :3306
This allowed me to access remote host on the desired port from ec2, But still, the remote host is not accessible locally on port 8000.
Network details on the local machine -
- Not using any proxy
- Firewall disabled on mac
So it's clear that SSM setup is working but something else is blocking this traffic, Need some help here.
xrage
(139 rep)
Apr 10, 2020, 12:52 PM
• Last activity: Jul 21, 2025, 08:04 AM
0
votes
1
answers
1972
views
How to Create a PTR Record for AWS Mailserver's Elastic IP Address
I configured an SMTP server (Postfix) on an AWS instance. However, as a defense against spam most well-managed emailservers will reject messages ***sent*** from any host whose IP does not resolve back to the same hostname of the sending server. When I sent a test message from the CLI: mail -s 'TEST...
I configured an SMTP server (Postfix) on an AWS instance. However, as a defense against spam most well-managed emailservers will reject messages ***sent*** from any host whose IP does not resolve back to the same hostname of the sending server.
When I sent a test message from the CLI:
mail -s 'TEST Subject' addressOfRecpient@test.com <<< 'Test Message Sent from Postfix Server'
It gets rejected by the recipient's mailserver. ***How do I create a PTR record for the Elastic IP assigned to my AWS mailserver?***
F1Linux
(2744 rep)
Mar 12, 2020, 04:06 PM
• Last activity: Jul 19, 2025, 11:06 AM
4
votes
2
answers
2242
views
Make date change permanent in EC2
How can I manually set date and time to future in EC2 instance and make it permanent, so it won't reset after reboot ? I can change date using this command: $ sudo timedatectl set-time "2017-12-09 16:00:00" $ timedatectl Local time: Sat 2017-12-09 16:00:01 UTC Universal time: Sat 2017-12-09 16:00:01...
How can I manually set date and time to future in EC2 instance and make it permanent, so it won't reset after reboot ?
I can change date using this command:
$ sudo timedatectl set-time "2017-12-09 16:00:00"
$ timedatectl
Local time: Sat 2017-12-09 16:00:01 UTC
Universal time: Sat 2017-12-09 16:00:01 UTC
RTC time: Sat 2017-12-09 16:00:02
Time zone: Etc/UTC (UTC, +0000)
Network time on: no
NTP synchronized: no
RTC in local TZ: no
OS on EC2:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
What else should I do to make this permanent ?
The purpose of this adjustment is to set the date to future, so I can test few things.
Michal Przybylowicz
(471 rep)
Nov 2, 2017, 01:58 PM
• Last activity: Jul 6, 2025, 01:08 AM
0
votes
0
answers
21
views
extending aws docker image fails
I need to extend the aws cli docker image with some custom scripts I have created a docker file and am copying the script files into a directory when using the docker file in my gitlab job I get the following error: [![enter image description here][1]][1] Dockerfile: ``` FROM amazon/aws-cli:latest A...
I need to extend the aws cli docker image with some custom scripts
I have created a docker file and am copying the script files into a directory
when using the docker file in my gitlab job I get the following error:
Dockerfile:

FROM amazon/aws-cli:latest
ADD scripts /usr/local/bin/aws-scripts/
RUN chmod -R 755 /usr/local/bin/aws-scripts
CMD [ "/usr/local/bin/aws-scripts/aws-version.sh" ]
Pipeline error:
Using docker image sha256:00fa868560bb812a79ed5d3895ab3aaa6a3f4a7f0b376415a7538f5bea8db4e9 for registry.gitlab.com/yumbrands/phdt/lambda-canary-scripts with digest registry.gitlab.com/yumbrands/phdt/lambda-canary-scripts@sha256:270e337dc3f149e52ec5d4c70537409f98973d80fa3ef8c567de4ba70ea0694d ...
usage: aws [options] [ ...] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument command: Invalid choice, valid choices are:
accessanalyzer | account
acm | acm-pca
aiops | amp
I have tried to change the content of the aws-version
file to the following but both instances fail:
aws --version
And:
aws --help
xerxes
(359 rep)
Jul 3, 2025, 02:56 PM
• Last activity: Jul 3, 2025, 03:57 PM
4
votes
1
answers
2005
views
How to get private IP address of EC2 after spinning the AWS from local machine/ at Jenkins outside AWS
Assume we already spin the AWS using cloudformation plugin from Jenkins outside AWS and now, how to get private IP address after spinning the AWS at my local machine/jenkins using any API methods? I tried ruby aws-sdk, REST API methods to get the private ip outside AWS (at my local) and I'm getting...
Assume we already spin the AWS using cloudformation plugin from Jenkins outside AWS and now, how to get private IP address after spinning the AWS at my local machine/jenkins using any API methods? I tried ruby aws-sdk, REST API methods to get the private ip outside AWS (at my local) and I'm getting timed out for the connection. Here are some examples that did not yield the ip address/EC2 objects and getting timeout -
#using ruby aws-sdk
require 'rubygems'
require 'aws-sdk-v1'
require 'aws-sdk'
AWS.config(:region => "xxxxx",
:access_key_id => "xxxxx",
:secret_access_key => "xxxxx")
ec2 = AWS::EC2.new(
:region => "xxxxxx",
:access_key_id => "xxxx",
:secret_access_key => "xxxxxxx")
ec2.instances.each do |test|
puts test.id
end
#using REST API client -
require 'rubygems'
require 'rest-client'
url = "https://ec2.amazonaws.com/?Action=DescribeNatGateways&ImageId=xxxxxxx&access_key_id=xxxxxx&secret_access_key=xxxxxxxx "
response=RestClient::Request.execute(:url =>url, :method => :get, :verify_ssl => false)
puts response
Tried uploading the IP address contained text file to S3 and then reading it back -
--------------cloudformation Json contains the following ---------
"wget -qO- http://169.254.169.254/latest/meta-data/local-pv4 >>dockeriseleniumgrid_ip_address\n", "aws s3 cp dockeriseleniumgrid_ip_address s3://xxxxx/dockeriseleniumgrid_ip_address\n"
----------tried reading it from s3 and writing to local machine --------
require 'aws/s3'
S3ID = "xxxxx"
S3KEY = "xxxx"
# include AWS::S3
AWS::S3::Base.establish_connection!(
:access_key_id => S3ID,
:secret_access_key => S3KEY
)
bucket = AWS::S3::Bucket.find("dockeriseleniumgrid_ip_address")
File.open("ip_address.txt", "w") do |f|
f.write(bucket.objects.read)
end
I'm new to AWS and appreciate if anyone can help
user176867
(41 rep)
Nov 18, 2016, 08:12 PM
• Last activity: Jul 3, 2025, 06:07 AM
0
votes
1
answers
63
views
SSH X11 Forwarding - GUI Crashes with X Error of failed request: BadIDChoice
I am: - Running a program on a Ubuntu 20.04 AWS instance - Using SSH & X11 forwarding in PuTTY, with the VcXsrv X-server, to run program GUIs on my local Windows 11 machine **The GUIs of test programs like xclock/xeyes successfully run on my local machine**. The issue arises when trying to run the G...
I am:
- Running a program on a Ubuntu 20.04 AWS instance
- Using SSH & X11 forwarding in PuTTY, with the VcXsrv X-server, to run program GUIs on my local Windows 11 machine
**The GUIs of test programs like xclock/xeyes successfully run on my local machine**. The issue arises when trying to run the GUI of interest (NVIDIA's Isaac Gym). I run a test script that activates the GUI. It opens up for a second, closes, then I get the following error:
**X Server (VcXsrv)**
Using XLaunch:
- "Display number" is -1 (to let vcxsrv automatically choose one)
- "Disable access control" box is unchecked
----------
**What I've Tried**
---------------------------
The following all yield the
X Error of failed request: BadIDChoice (invalid resource ID chosen for this connection)
Major opcode of failed request: 148 ()
Minor opcode of failed request: 3
Resource id in failed request: 0x200002
Serial number of failed request: 26
Current serial number in output stream: 18
**The Opcodes**
As per the Xorg opcode page (thanks Kenster):
- Major opcode: **PRESENT** extension (apparently called for things related to "frame representation timing" - screen refreshing, tear-free rendering, etc.)
- Minor opcode: **X_PresentSelectInput** request (apparently "selects a set of Present events to be delivered for the specified window on the X server specified by display" - source )
It sounds like it's just an initial request that's sent when setting up/running PRESENT-related things.
How do I fix this? Some help would be greatly appreciated.
----------
More System Info
---------
**Server**
As per this well-known post for setting up X11 forwarding:
- /etc/ssh/sshd_config
looks as follows:
#AllowAgentForwarding yes # unspecified
X11Forwarding yes # activated
#X11DisplayOffset 10 # unspecified
#X11UseLocalhost yes # unspecified
- /etc/ssh/ssh_config
looks as follows:
# FowardX11 yes # unspecified
# ForwardX11Trusted yes # unspecified
- xauth
is installed
$ xauth -V
1.1
- The server's DISPLAY
variable seems to be set correctly
$ env | grep DISPLAY
DISPLAY=localhost:10.0
- The XAUTHORITY
variable seems empty
$ env | grep XAUTHORITY
$
**PuTTY**
- Obviously "Enable X11 forwarding" box is checked
- "X display location" is empty

BadIDChoice
error mentioned up top:
- (After reading David G.'s answer) Enabled ForwardX11Trusted
in /etc/ssh/ssh_config
, together with "Disable access control" in XLaunch
- Tried once with X11UseLocalhost no
in /etc/ssh/sshd_config
- Tried once with #X11UseLocalhost yes
(commented out)
- Changing VcXsrv "Display number" to 0
- Changing PuTTY "X display location" to localhost:0
Other Errors:
- Changing VcXsrv "Display number" to 1
or 10
--> yields (4 times for some reason):
PuTTY X11 proxy: unable to connect to forwarded X server: Network error: Connection refused
----------
sumsamson
(1 rep)
Jun 13, 2025, 05:35 AM
• Last activity: Jun 17, 2025, 10:33 PM
3
votes
1
answers
3073
views
Postfix Error while loading shared libraries: libmysqlclient.so.18
When I try to start postfix I get these errors: /usr/sbin/postconf: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such...r directory /usr/bin/newaliases: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No su...
When I try to start postfix I get these errors:
/usr/sbin/postconf: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such...r directory
/usr/bin/newaliases: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No suc...r directory
/usr/sbin/postfix: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No suc...r directory
Postfix use to work fine until I installed mysql. I'm not sure why mysql is even related to the Postfix errors.
When I run the
find . -name 'libmysqlclient*'
command I get this:
./usr/lib64/mysql/libmysqlclient.so.21
./usr/lib64/mysql/libmysqlclient.so.21.2.30
# ls -al /usr/lib64/mysql
total 7520
drwxr-xr-x. 5 root root 109 Sep 29 13:47 .
dr-xr-xr-x. 49 root root 28672 Sep 29 13:49 ..
lrwxrwxrwx. 1 root root 25 Sep 28 21:53 libmysqlclient.so.21 -> libmysqlclient.so.21.2.30
-rwxr-xr-x. 1 root root 7651120 Jul 6 17:53 libmysqlclient.so.21.2.30
drwxr-xr-x. 4 root root 28 Sep 28 21:53 mecab
drwxr-xr-x. 2 root root 4096 Sep 28 21:53 plugin
drwxr-xr-x. 3 root root 131 Sep 28 21:53 private
There is no 18 version installed and I'm confused as to why it is looking for 18 instead of 21.
Further info which my be helpful:
mysql-community-server-8.0.30-1.el7.x86_64
#which mysql: /bin/mysql/mysql
#mysql -V: Ver 8.0.30 for Linux on x86_64 (MySQL Community Server - GPL)
#mysqld -V: /usr/sbin/mysqld Ver 8.0.30 for Linux on x86_64 (MySQL Community Server - GPL)
#php -v PHP 8.0.20 (cli)
#systemctl status mysqld: Active: active (running) since Fri 2022-09-30 23:27:02 CDT; 3 days ago
# rpm -qa postfix: postfix-2.10.1-6.amzn2.0.3.x86_64
AWS Linux 2 Server
***Can anyone help me with this? I checked other posts on here which are similar to my issue, however, I wasn't able to find a solution that was close enough to my situation that I could try.***
Finally, I also ran this command which outputs a ton of info which is why I saved this for the end of this post:
# repoquery --whatprovides *libmysqlclient*
mysql-community-libs-0:8.0.18-1.el7.i686
mysql-community-libs-0:8.0.11-1.el7.i686
mysql-community-devel-0:8.0.11-1.el7.i686
mysql-community-libs-0:8.0.27-1.el7.i686
mysql-community-libs-compat-0:8.0.15-1.el7.i686
mysql-community-libs-0:8.0.27-1.el7.x86_64
mysql-community-devel-0:8.0.17-1.el7.i686
mysql-workbench-community-0:6.3.5-1.el7.x86_64
mysql-community-libs-0:8.0.30-1.el7.i686
mysql-community-devel-0:8.0.15-1.el7.x86_64
mysql-community-libs-compat-0:8.0.24-1.el7.i686
mysql-community-libs-compat-0:8.0.26-1.el7.i686
mysql-workbench-community-0:8.0.16-1.el7.x86_64
mysql-community-libs-0:8.0.26-1.el7.i686
mysql-community-libs-0:8.0.17-1.el7.i686
mysql-workbench-community-0:8.0.12-1.el7.x86_64
mysql-community-devel-0:8.0.21-1.el7.i686
mysql-community-libs-compat-0:8.0.13-1.el7.i686
mysql-community-libs-compat-0:8.0.16-2.el7.i686
mariadb-devel-1:5.5.60-1.amzn2.x86_64
mysql-community-devel-0:8.0.16-2.el7.i686
mysql-community-devel-0:8.0.19-1.el7.x86_64
mysql-community-devel-0:8.0.18-1.el7.x86_64
mysql-community-libs-0:8.0.16-2.el7.i686
mysql-community-libs-compat-0:8.0.22-1.el7.i686
mariadb-devel-1:5.5.56-2.amzn2.0.2.x86_64
mysql-community-libs-0:8.0.16-2.el7.x86_64
mysql-community-devel-0:8.0.26-1.el7.i686
mysql-community-libs-0:8.0.22-1.el7.x86_64
mysql-community-libs-0:8.0.28-1.el7.x86_64
mysql-community-libs-0:8.0.23-1.el7.x86_64
mysql-community-devel-0:8.0.30-1.el7.i686
mysql-community-devel-0:8.0.26-1.el7.x86_64
mysql-community-libs-compat-0:8.0.19-1.el7.i686
mysql-community-devel-0:8.0.11-1.el7.x86_64
mysql-community-libs-0:8.0.13-1.el7.i686
mysql-community-libs-compat-0:8.0.12-1.el7.i686
mariadb-devel-1:5.5.62-1.amzn2.0.1.x86_64
mysql-workbench-community-0:8.0.22-1.el7.x86_64
mysql-community-devel-0:8.0.15-1.el7.i686
mysql-community-devel-0:8.0.12-1.el7.x86_64
mysql-community-devel-0:8.0.12-1.el7.i686
mysql-workbench-community-0:6.2.4-1.el7.x86_64
mysql-community-devel-0:8.0.23-1.el7.i686
mariadb-libs-1:5.5.62-1.amzn2.0.1.i686
mysql-community-devel-0:8.0.16-1.el7.i686
mysql-community-libs-compat-0:8.0.25-1.el7.x86_64
mysql-community-libs-compat-0:8.0.21-1.el7.i686
mysql-community-libs-0:8.0.21-1.el7.x86_64
mysql-workbench-community-0:8.0.13-1.el7.x86_64
mysql-community-libs-compat-0:8.0.14-1.el7.x86_64
mysql-community-libs-compat-0:8.0.27-1.el7.x86_64
mysql-community-libs-compat-0:8.0.30-1.el7.i686
mysql-community-libs-compat-0:8.0.23-1.el7.i686
mysql-community-devel-0:8.0.14-1.el7.x86_64
mariadb-devel-1:5.5.56-2.amzn2.x86_64
mysql-community-libs-0:8.0.17-1.el7.x86_64
mysql-community-devel-0:8.0.22-1.el7.i686
mysql-community-libs-0:8.0.20-1.el7.i686
mariadb-libs-1:5.5.68-1.amzn2.i686
mysql-community-libs-0:8.0.25-1.el7.i686
mariadb-libs-1:5.5.56-2.amzn2.x86_64
mysql-community-libs-0:8.0.16-1.el7.i686
mysql-community-libs-compat-0:8.0.14-1.el7.i686
mariadb-libs-1:5.5.68-1.amzn2.x86_64
mysql-community-libs-compat-0:8.0.19-1.el7.x86_64
mysql-community-libs-0:8.0.12-1.el7.i686
mysql-workbench-community-0:6.3.6-1.el7.x86_64
mysql-workbench-community-0:6.3.7-1.el7.x86_64
mysql-community-libs-0:8.0.11-1.el7.x86_64
mysql-community-libs-compat-0:8.0.25-1.el7.i686
mysql-community-libs-0:8.0.20-1.el7.x86_64
mariadb-libs-1:5.5.60-1.amzn2.i686
mysql-community-libs-compat-0:8.0.30-1.el7.x86_64
mysql-community-libs-compat-0:8.0.11-1.el7.i686
mysql-community-libs-0:8.0.25-1.el7.x86_64
mariadb-devel-1:5.5.68-1.amzn2.x86_64
mysql-community-devel-0:8.0.22-1.el7.x86_64
mariadb-libs-1:5.5.56-2.amzn2.0.2.i686
mysql-community-libs-compat-0:8.0.21-1.el7.x86_64
mysql-community-libs-compat-0:8.0.18-1.el7.x86_64
mysql-community-devel-0:8.0.28-1.el7.i686
mariadb-libs-1:5.5.62-1.amzn2.0.1.x86_64
mysql-community-libs-compat-0:8.0.24-1.el7.x86_64
mysql-community-devel-0:8.0.28-1.el7.x86_64
mysql-community-libs-compat-0:8.0.18-1.el7.i686
mysql-community-libs-0:8.0.19-1.el7.i686
mysql-community-libs-0:8.0.15-1.el7.x86_64
mysql-community-devel-0:8.0.19-1.el7.i686
mysql-community-libs-0:8.0.28-1.el7.i686
mariadb-libs-1:5.5.64-1.amzn2.x86_64
mysql-workbench-community-0:6.2.5-1.el7.x86_64
mysql-community-libs-compat-0:8.0.16-1.el7.x86_64
mysql-community-libs-compat-0:8.0.28-1.el7.x86_64
mariadb-libs-1:5.5.60-1.amzn2.x86_64
mysql-workbench-community-0:8.0.14-1.el7.x86_64
mysql-workbench-community-0:8.0.15-1.el7.x86_64
mysql-community-libs-0:8.0.21-1.el7.i686
mysql-community-devel-0:8.0.23-1.el7.x86_64
mysql-community-libs-compat-0:8.0.11-1.el7.x86_64
mysql-workbench-community-0:6.3.4-1.el7.x86_64
mysql-workbench-community-0:6.2.3-1.el7.x86_64
mariadb-devel-1:5.5.64-1.amzn2.x86_64
mysql-community-devel-0:8.0.24-1.el7.x86_64
mysql-community-libs-0:8.0.23-1.el7.i686
mysql-workbench-community-0:6.3.3-1.el7.x86_64
mysql-community-devel-0:8.0.25-1.el7.i686
mysql-workbench-community-0:8.0.18-1.el7.x86_64
mysql-community-devel-0:8.0.20-1.el7.i686
mariadb-libs-1:5.5.64-1.amzn2.i686
mysql-community-libs-compat-0:8.0.23-1.el7.x86_64
mysql-community-devel-0:8.0.16-2.el7.x86_64
mysql-community-libs-0:8.0.14-1.el7.i686
mysql-community-libs-0:8.0.19-1.el7.x86_64
mysql-community-libs-compat-0:8.0.12-1.el7.x86_64
mysql-community-libs-compat-0:8.0.13-1.el7.x86_64
mysql-community-devel-0:8.0.17-1.el7.x86_64
mysql-community-devel-0:8.0.27-1.el7.x86_64
mysql-workbench-community-0:8.0.21-1.el7.x86_64
mysql-community-libs-0:8.0.22-1.el7.i686
mysql-community-devel-0:8.0.13-1.el7.x86_64
mysql-community-libs-compat-0:8.0.26-1.el7.x86_64
mysql-workbench-community-0:6.3.6-2.el7.x86_64
mysql-workbench-community-0:6.3.8-1.el7.x86_64
mysql-community-libs-0:8.0.24-1.el7.x86_64
mysql-community-libs-compat-0:8.0.16-1.el7.i686
mysql-community-libs-compat-0:8.0.17-1.el7.i686
mysql-community-libs-compat-0:8.0.22-1.el7.x86_64
mysql-community-libs-0:8.0.30-1.el7.x86_64
mysql-community-libs-compat-0:8.0.28-1.el7.i686
mysql-community-devel-0:8.0.27-1.el7.i686
mysql-community-libs-compat-0:8.0.15-1.el7.x86_64
mysql-community-devel-0:8.0.25-1.el7.x86_64
mysql-community-devel-0:8.0.18-1.el7.i686
mysql-community-libs-0:8.0.18-1.el7.x86_64
mysql-community-devel-0:8.0.16-1.el7.x86_64
mysql-community-libs-0:8.0.26-1.el7.x86_64
mysql-workbench-community-0:8.0.20-1.el7.x86_64
mysql-community-libs-0:8.0.12-1.el7.x86_64
mysql-community-libs-0:8.0.15-1.el7.i686
mysql-workbench-community-0:8.0.19-1.el7.x86_64
mysql-community-devel-0:8.0.30-1.el7.x86_64
mysql-community-libs-compat-0:8.0.17-1.el7.x86_64
mysql-community-libs-compat-0:8.0.20-1.el7.i686
mysql-community-libs-0:8.0.14-1.el7.x86_64
mysql-community-libs-compat-0:8.0.20-1.el7.x86_64
mysql-community-libs-0:8.0.24-1.el7.i686
mysql-community-devel-0:8.0.14-1.el7.i686
mysql-community-devel-0:8.0.13-1.el7.i686
mysql-community-libs-compat-0:8.0.16-2.el7.x86_64
mysql-community-devel-0:8.0.24-1.el7.i686
mysql-community-libs-compat-0:8.0.27-1.el7.i686
mysql-community-libs-0:8.0.13-1.el7.x86_64
mariadb-libs-1:5.5.56-2.amzn2.0.2.x86_64
mysql-workbench-community-0:8.0.17-1.el7.x86_64
mysql-community-devel-0:8.0.20-1.el7.x86_64
mysql-community-devel-0:8.0.21-1.el7.x86_64
mysql-community-libs-0:8.0.16-1.el7.x86_64
SeniorDeveloper
(131 rep)
Oct 4, 2022, 06:32 AM
• Last activity: Jun 8, 2025, 07:07 PM
5
votes
1
answers
3281
views
How to recover data from EBS volume showing no partition or filesystem?
I restored an EBS volume and attached it to a new EC2 instance. When I `lsblk`, I can see it under the name `/dev/nvme1n1`. More specifically, the output of `lsblk` is: ``` NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 25M 1 loop /snap/amazon-ssm-agent/4046 loop1 7:1 0 55.4M 1 loop /snap/core1...
I restored an EBS volume and attached it to a new EC2 instance. When I
lsblk
, I can see it under the name /dev/nvme1n1
.
More specifically, the output of lsblk
is:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 25M 1 loop /snap/amazon-ssm-agent/4046
loop1 7:1 0 55.4M 1 loop /snap/core18/2128
loop2 7:2 0 61.9M 1 loop /snap/core20/1169
loop3 7:3 0 67.3M 1 loop /snap/lxd/21545
loop4 7:4 0 32.5M 1 loop /snap/snapd/13640
loop5 7:5 0 55.5M 1 loop /snap/core18/2246
loop6 7:6 0 67.2M 1 loop /snap/lxd/21835
nvme0n1 259:0 0 8G 0 disk
└─nvme0n1p1 259:1 0 8G 0 part /
nvme1n1 259:2 0 100G 0 disk
As you can see, nvme1n1
has no partitions. As a result, when I try to mount it on a folder with:
sudo mkdir mount_point
sudo mount /dev/nvme1n1 mount_point/
I get
mount: /home/ubuntu/mount_point: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
The volume has data inside:
ubuntu@ubuntu:~$ sudo file -s /dev/nvme1n1
/dev/nvme1n1: data
`
Using sudo mkfs -t xfs /dev/nvme1n1
to create a filesystem is not an option as Amazon states that:
> **Warning**
> Do not use this command if you're mounting a volume that already has data on it (for example, a volume that was created from a snapshot). Otherwise, you'll format the volume and delete the existing data.
Indeed, I tried it with a second dummy EBS snapshot that I recovered, and all I got was a dummy lost+found
linux folder .
This EBS recovered snapshot has useful data inside. How can I mount it without destroying it?
---
# parted -l /dev/nvme1n1 print
Model: Amazon Elastic Block Store (nvme)
Disk /dev/nvme0n1: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 8590MB 8589MB primary ext4 boot
Error: /dev/nvme1n1: unrecognised disk label
Model: Amazon Elastic Block Store (nvme)
Disk /dev/nvme1n1: 107GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
dmesg | grep nvme1n1
[ 68.475368] EXT4-fs (nvme1n1): VFS: Can't find ext4 filesystem
[ 96.604971] EXT4-fs (nvme1n1): VFS: Can't find ext4 filesystem
[ 254.674651] EXT4-fs (nvme1n1): VFS: Can't find ext4 filesystem
[ 256.438712] EXT4-fs (nvme1n1): VFS: Can't find ext4 filesystem
$ sudo fsck /dev/nvme1n1
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/nvme1n1
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193
or
e2fsck -b 32768
HelloWorld
(1785 rep)
Nov 8, 2021, 12:08 PM
• Last activity: May 19, 2025, 08:41 AM
1
votes
1
answers
2742
views
install chrome on aws ec2 linux server?
I am trying to install google chrome using `yum install google-chrome-stable` but it is giving me this error on libgdk and libgtk. Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64 (google-chrome) Requires: libgdk-3.so.0()(64bit) Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64...
I am trying to install google chrome using
yum install google-chrome-stable
but it is giving me this error on libgdk and libgtk.
Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64 (google-chrome)
Requires: libgdk-3.so.0()(64bit)
Error: Package: google-chrome-stable-61.0.3163.100-1.x86_64 (google-chrome)
Requires: libgtk-3.so.0()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
When I ran:
yum install libgtk-3 -y; yum install google-chrome-stable -y
I got:
> No package libgtk-3 available
mosaad
(111 rep)
Oct 8, 2017, 08:05 PM
• Last activity: May 12, 2025, 07:00 PM
0
votes
1
answers
3493
views
What's the risk of running net.ipv4.route.flush
I'm setting up a Linux box through AWS and I'm exploring `sysctl`. When I run `ip route` I can see that there are already routes on the machine refering to `169.X.X.X` addresses. **Questions**: 1. What does `systctl -w net.ipv4.route.flush=1` do? 2. Could `systctl -w net.ipv4.route.flush=1` mess up...
I'm setting up a Linux box through AWS and I'm exploring
sysctl
.
When I run ip route
I can see that there are already routes on the machine refering to 169.X.X.X
addresses.
**Questions**:
1. What does systctl -w net.ipv4.route.flush=1
do?
2. Could systctl -w net.ipv4.route.flush=1
mess up the default box/configuration needed in order for the AWS Linux instance to work as intended?
N. J
(177 rep)
Feb 2, 2023, 11:07 AM
• Last activity: May 11, 2025, 05:04 PM
0
votes
2
answers
2899
views
Where to set new UUID for PV & VG of LVM
I have 2 instances running on AWS. Instance A (main instance) and Instance B (rescue instance). I detached volume from Instance A and attached it to Instance B to perform some changes why because I am unable to login inside Instance A due to SSH issue. After doing changes on Instance B the UUID of t...
I have 2 instances running on AWS. Instance A (main instance) and Instance B (rescue instance).
I detached volume from Instance A and attached it to Instance B to perform some changes why because I am unable to login inside Instance A due to SSH issue.
After doing changes on Instance B the UUID of the PV & VG are now changed. Now I cannot directly attach this volume back to Instance A as obviously it will fail because previous UUIDs are no longer present. How to tell Instance A to start using new UUIDs ?
Is there any configuration file in Instance A where I could update the UUID directly ?
Pritesh Vikram
(1 rep)
Feb 1, 2023, 05:17 AM
• Last activity: Apr 17, 2025, 07:07 AM
2
votes
1
answers
3430
views
E: Package 'python-minimal' has no installation candidate
I am trying to deploy k8s cluster on aws using kubespray. Step1: I have downloaded the following dependencies: ``` apt-get update apt-get install software-properties-common apt-add-repository ppa:ansible/ansible apt-get update apt-get install ansible apt-get update apt-get -y upgrade apt-get install...
I am trying to deploy k8s cluster on aws using kubespray.
Step1: I have downloaded the following dependencies:
apt-get update
apt-get install software-properties-common
apt-add-repository ppa:ansible/ansible
apt-get update
apt-get install ansible
apt-get update
apt-get -y upgrade
apt-get install python-pip
pip install jinja2
pip install netaddr
Step2: cloned the kubespray git repo
git clone https://github.com/xenonstack/kubespray.git
Step3: customized the inventory file, while deploying the cluster using ansible it is throwing the following error
E: Package 'python-minimal' has no installation candidate
How can i fix this?
swetha panchakatla
(21 rep)
Jul 18, 2023, 06:53 AM
• Last activity: Apr 12, 2025, 10:03 AM
7
votes
2
answers
13493
views
Return the private IP of an EC2 instance from within the EC2 instance
What specific syntax can be used to return the private IP address of an Amazon Linux EC2 instance from the command line within that instance? So far, I have come up with the following: # Get private IP from inside the instance by filtering inside the following: instanceid=$(curl http://169.254.169.2...
What specific syntax can be used to return the private IP address of an Amazon Linux EC2 instance from the command line within that instance?
So far, I have come up with the following:
# Get private IP from inside the instance by filtering inside the following:
instanceid=$(curl http://169.254.169.254/latest/meta-data/instance-id)
echo $instanceid
aws ec2 describe-instances --instance-id $instanceid --region us-west-2
However, as you can see if you type these commands inside an EC2 instance yourself, the above 3 lines result in a massive output, which would be a mess to filter through manually.
Can someone suggest one or two lines of code to return simply the private ip of the instance and NO other information?
CodeMed
(5357 rep)
Jun 8, 2019, 12:49 AM
• Last activity: Apr 9, 2025, 01:38 PM
6
votes
1
answers
689
views
Running docker in docker in AWS Fargate
I am thinking of running docker in docker using [this][1]. Can I run it in AWS Fargate task? It doesn't have underlying host so was not sure that would work or not. [1]: https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/
I am thinking of running docker in docker using this .
Can I run it in AWS Fargate task? It doesn't have underlying host so was not sure that would work or not.
Mirage
(121 rep)
Jun 21, 2018, 06:07 AM
• Last activity: Mar 19, 2025, 10:24 PM
0
votes
0
answers
110
views
SSH VScode to ec2 instance AWS Linux
I am trying to connect to an AWS EC2 instance from my MacBook Pro using `VSCode`. I am able to connect to the EC2 instance through the terminal by navigating to the `Downloads` folder (where my key pair `.pem` file is) using the command: ```lang-shell ssh -i "Key-Pair.pem" ec2-user@ec2-**-***-**-***...
I am trying to connect to an AWS EC2 instance from my MacBook Pro using
VSCode
.
I am able to connect to the EC2 instance through the terminal by navigating to the Downloads
folder (where my key pair .pem
file is) using the command:
-shell
ssh -i "Key-Pair.pem" ec2-user@ec2-**-***-**-***.ap-northeast-1.compute.amazonaws.com
My terminal shows me
-shellsession
[ec2-user@ip-***-**-**-*** ~]$
However, when trying to connect to the AWS instance from VScode I get the error
Load key "/Users/****/Downloads/Key-Pair.pem": Operation not permitted
ec2-user@**.***.**.***: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
local-server-1> ssh child died, shutting down
It seems as though my key pair .pem
file is not able to authenticate with the AWS instance.
For reference this is what my config file looks like for this instance
Host PM.ByBit.SMM
Hostname **.***.**.***
User ec2-user
IdentityFile /Users/****/Downloads/Key-Pair.pem
dinosaurslayer
(1 rep)
Dec 22, 2023, 11:16 AM
• Last activity: Mar 19, 2025, 10:47 AM
0
votes
0
answers
32
views
cannot install newrelic-infra on new AWS Linux instance
I am following the instructions here: https://docs.newrelic.com/docs/infrastructure/infrastructure-agent/linux-installation/package-manager-install/ Step 6 is a yum install. I get this error: package newrelic-infra... requires td-agent-bit, but none of the providers can be installed Any idea what is...
I am following the instructions here:
https://docs.newrelic.com/docs/infrastructure/infrastructure-agent/linux-installation/package-manager-install/
Step 6 is a yum install. I get this error:
package newrelic-infra... requires td-agent-bit, but none of the providers can be installed
Any idea what is missing?
Daniel Williams
(101 rep)
Mar 18, 2025, 02:54 PM
1
votes
3
answers
973
views
Update file with multiple values automatically
I have a hosted zone and record set that route to multiple addresses. I'd like to update the record set with adding or removing one IP address in the list. Unfortunately, AWS CLI doesn't provide the option of deleting/adding the value of resource record in route53 { "Comment": "Update the A record s...
I have a hosted zone and record set that route to multiple addresses. I'd like to update the record set with adding or removing one IP address in the list. Unfortunately, AWS CLI doesn't provide the option of deleting/adding the value of resource record in route53
{
"Comment": "Update the A record set",
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "mydomain.com",
"Type": "A",
"TTL": 300,
"ResourceRecords": [
{
"Value": "XX.XX.XX.XX"
}
]
}
}
]
}
I can add multiple IP addresses into your json like this manually. ***But I want to add multiple IPs to the json file using bash automatically.***
{
"Comment": "Update the A record set",
"Changes": [{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "mydomain.com",
"Type": "A",
"TTL": 300,
"ResourceRecords": [{
"Value": "XX.XX.XX.XX"
},
{
"Value": "XX.XX.XX.XX"
}
]
}
}]
}
Nani
(373 rep)
Feb 13, 2019, 07:27 PM
• Last activity: Mar 10, 2025, 10:16 PM
0
votes
0
answers
15
views
Port forwarding through an AWS Direct Connect
I have my VPC connected to our corporate network via Direct Connect (this is shared from our main account using Transit Gateways), using a firewall on my corporate network I am trying to port forward an EC2 instance. I have created Security groups for the instance and Network ACLs are set to Allow A...
I have my VPC connected to our corporate network via Direct Connect (this is shared from our main account using Transit Gateways), using a firewall on my corporate network I am trying to port forward an EC2 instance. I have created Security groups for the instance and Network ACLs are set to Allow ALL 0/0.
Using flow logs on the network interface I can see the TCP SYN come through and then the server sending the SYN-ACK back out. But taking a LAN packet capture on the firewall I cant see the SYN-ACK coming back through the Direct Connect.
I should add internal traffic flows fine between AWS and Internal networks.
I am not a network engineer. What might I have missed?
Tom
(1 rep)
Jan 16, 2025, 12:56 AM
Showing page 1 of 20 total questions