Questions tagged [unix]
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs.
1,960
questions
13
votes
14
answers
72k
views
Is it possible to prevent SCP while still allowing SSH access?
Using Solaris and Linux servers and OpenSSH, is it possible to prevent users from copying files using "scp" while still allowing shell access with "ssh"?
I realize that 'ssh $server "cat file" ' type ...
15
votes
4
answers
5k
views
Is there a mechanism in Unix (or Linux) to stop an in-progress core dump?
Let's say a (very) large process is crashing and dumping core, and we know the cause from other information (possibly an assert message, maybe something else).
Is there a way to stop the core dump ...
229
votes
8
answers
271k
views
When does /tmp get cleared?
I'm taking to putting various files in /tmp, and I wondered about the rules on deleting them?
I'm imagining it's different for different distributions, and I'm particularly interested in Ubuntu and ...
0
votes
0
answers
66
views
Kubernetes- execution phase preflight: couldn't validate the identity of the API Server
I am trying to create a bare metal Kubernetes cluster of one master node and three worker nodes. The nodes are Ubuntu VMs running in a VMWare Workstation lab environment. The master node is ...
0
votes
1
answer
234
views
kubectl get nodes --kubeconfig admin.kubeconfig returns "No resources found"
I am a newbie in Kubernetes. I am not even very familiar with basic kubernetes commands, but the installation is a starting point for my learning journey. I wanted to avoid installing something like ...
-1
votes
0
answers
17
views
windows10 server NFS winNFSd.exe with NFS client unix access with username e password
-n°1 macchina CNC unix
-n°1 pc windows10 with winNFSd.exe
I managed to access the Windows 10 PC with Ubuntu like this:
sudo mount -t nfs -o vers=3 192.168.1.16:/pr /media/win
sudo mount -t nfs -o ...
0
votes
1
answer
51
views
FreeBSD user has no permission on .ssh directory
I have a problem on FreeBSD 14.0 - the ~/.ssh/ directory is owned by me, but I can not access it as myself:
$ ls -al .ssh
ls: .: Permission denied
ls: ..: Permission denied
ls: authorized_keys: ...
30
votes
4
answers
35k
views
Should I create ZFS zpools with whole disks or partitions?
I am making zpools on FreeBSD machine. While creating zpools I observe these two cases:
If I take raw disks and create zpool then I am able to form zpools and they are working perfectly.
If I format ...
64
votes
9
answers
245k
views
How to change owner of mount point
We have moved mysql data directory to another disk, so now /var/lib/mysql is just a mount point to another partition. We set the owner of the /var/lib/mysql directory to mysql.mysql.
But everytime we ...
373
votes
19
answers
606k
views
How do I get the current Unix time in milliseconds in Bash?
How do I get the current Unix time in milliseconds (i.e number of milliseconds since Unix epoch January 1 1970)?
1
vote
1
answer
9k
views
nginx 12 FastCGI sent in stderr Primary script unknown
I am struggling for two days with my nginx configuration. I read a lot but could not find the right question.
I got this from the error log:
2018/08/30 09:36:29 [error] 1525#1525: *12 FastCGI sent ...
0
votes
1
answer
4k
views
Unable to clear sendmail mqueue-client
drwxr-xr-x 2 smmsp smmsp 4.0K May 6 23:31 mqueue
drwxrws--- 2 smmsp smmsp 29M May 8 10:40 mqueue-client
As you can see mqueue-client is filled with 29 megabytes of unsent mail. This seems to be ...
43
votes
5
answers
21k
views
Faking the date for a specific shell session
I'm certainly trying to achieve something weird here, but I want to fake the date locally for a shell session on GNU/Linux.
I need to black-box test how a program behaves at different dates, and ...
30
votes
2
answers
42k
views
Is it possible to set a timeout on openssl's s_client command?
I've got a script which uses openssl's s_client command to pull certificates for a big set of hosts. Some of these hosts will inevitably be unreachable because of a firewall. Is it possible to set ...
0
votes
1
answer
5k
views
How to store SSH key without attempting to login with password using Plink?
The below command is used to attempt to store the SSH key, even though we tried to force exit in the command, still it is asking password.
echo y | plink -ssh [email protected] "exit".
The server's ...
4
votes
1
answer
5k
views
Solaris 10 NFS client mount error "NFS compound failed for server 10.0.2.18: error 5 (RPC: Timed out)"
I have a Solaris 5.10 (I think that's considered Solaris 10) server - we'll call it "Bill" - which I own, but a vendor supports the additional software installed. They have to manually stop services ...
0
votes
1
answer
29
views
argument to pgrep from cmdline returns 2 PID's and argument from global variable value returns 1 PID
1.first case(processName as argument from cmd i.e java)
command from cmd with arguments : ./a.sh getProcessId contains java
code:
getProcessId(){
matchType=$1
#defaulting matchArg to x i.e exact ...
0
votes
2
answers
396
views
Adding users to Unix groups only if said groups exist (puppet)
I tried using the 'group' attribute of the 'user' resource like so :
user {
"user":
group => ["docker", "www-data"]
}
If the groups 'docker' and 'www-data' exist ...
0
votes
1
answer
4k
views
timestamp in shell code script
I'm new in shell coding and hopefully I'm in the right place to ask this question. I'm working with a shell script which collect daily file and send them via ftp. In the filename there are both date ...
0
votes
1
answer
173
views
pgrep -f from shell script is returning 2 pid instead of 1
code :
function main {
[ -z "$@" ] && { getProcessId "$@" } || "$@"
}
getProcessId(){
matchType=$1
#defaulting matchArg to x i.e exact match
matchArg=x
...
0
votes
2
answers
129
views
change shell to /usr/bin/false in IBM aix os
I would define the program run for the user at session initiation into /usr/bin/false in /etc/passwd. The default value parameter is /usr/bin/ksh.
When I try to modify it with commands:
bash-5.1# ...
1
vote
2
answers
5k
views
Why can't I cd to a root owned folder, as a member of the root group? [closed]
I verified I'm a member of root:
user_me@host1:~$ sudo useradd -G root user_me
useradd: user 'user_me' already exists
However, I can't cd to /root/testing from my user:
user_me@host1:~$ cd /root/...
0
votes
0
answers
74
views
not able to send mail with attachment from linux ubuntu : 20.04 by using email mailutils (sendmail keyword)
code :
subject="Service resilience service status"
body="Service is down"
from="[email protected]"
to="[email protected]"
attachment="/home/ubuntu/...
5
votes
2
answers
14k
views
In UNIX, how can I cat a file located in a different server?
In UNIX, how can I cat a file located in a different server? Can anybody please help me?
Thanks,
Prasenjit
0
votes
2
answers
7k
views
Postgres /root": Permission denied
why on ubuntu 14.10 every time that i try to start the postgres on:
sudo -p 'sudo password: ' -u postgres /usr/lib/postgresql/9.4/bin/initdb -D /mnt/postgresql/9.4/data
show this:
could not ...
11
votes
5
answers
15k
views
Execute command when a file changes
I have a scenario where I am uploading .csv files to a specific folder, /tmp/data_upload, every day, and the old files are replaced by the new one.
I need to run a Python script once the data is ...
-2
votes
1
answer
58
views
Is it bad that I don't update the server? [closed]
I am running an application on my server with the help of Nodejs, and it has many dependencies such as Chrome.
I have not updated my server for two years. I am afraid that if I do, my code will fail ...
3
votes
3
answers
21k
views
sftp entire directory (directory having many directories recursively)
When I am trying to sftp the directory structure ( Here the directory is having other directories recursively). I am not getting all the files.
Can you please suggest me the way to do this?
1
vote
1
answer
1k
views
Email server configuration still complaining the connection isn't secure
This is a follow up to another question I had, but its quite different so I thought I'd start a new post.
Emails bouncing - 454 TLS not available due to temporary reason
I'm trying to work out why I ...
1
vote
1
answer
177
views
nginx fowarding 20% (spaces) instead of + in url
I have an NGINX config that takes url's converts them with regular expression, this works fine. The issue is that while forwarding to the new atlassian instance the + from the URL is turned into %20 ...
0
votes
0
answers
27
views
Need help in logrotation
I have custom logrotation as below..
cat /etc/logrotate.d/apache
#
#
/var/log/apache/apache.log
{
daily
rotate 30
size 1G
compress
missingok
...
2
votes
1
answer
3k
views
Postfix+saslauthd: pam_unix(smtp:auth): authentication failure
I'm run postfix 2.10 + Cyrus sasl 2.1 + Dovecot 2.2 on Oracle Linux 7.
Dovecot works with saslauthd normally, but Postfix always failed on authentication, wish someone can help to check what problem ...
23
votes
4
answers
19k
views
dmesg time vs system time time isn't correct
I hope that here is somebody that can help me with this strange problem.
I think that i know why it is happening but i don't know how to solve it. Maybe it is because the BIOS time isn't set correct ...
56
votes
5
answers
98k
views
Create Unix Named Socket from the Command Line
Is there a command similar to mkfifo but for domain sockets?
0
votes
1
answer
279
views
is /etc/sudoers writable or not
The default permission in /etc/sudoers file is readonly for root and group root as in picture is obvious :
So when you open it with any test editor it can't be written and give error read only.
now ...
1
vote
0
answers
132
views
Mount a remote GPU locally on Rocky Linux
I am doing some work on a server which has 1TB RAM, 100CPUs, and 1000TB storage. My work involves very large datasets.
One specific I am trying to run would benefit immensely from a GPU, it is ML ...
1
vote
3
answers
690
views
How to have an environment variable with quotes in crontab?
I have a minimum example of my problem, which is trying to install a crontab that looks like this:
FOO="foo\"bar\"bin"
0 0 1 * * ls
by running crontab crontab (I have it in a ...
6
votes
5
answers
33k
views
Getting full path of executables in 'ps auxwww' output
Consider the following lines from a "ps auxwww" output:
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
root 4262 0.0 0,1 76592 1104 s005 Ss 10:...
236
votes
3
answers
252k
views
How do I do 'mount --bind' in /etc/fstab?
I'm trying to add mount --bind /proc/ /chroot/mysql/proc to /etc/fstab. How can I do this?
0
votes
1
answer
273
views
Passing a user input to an ssh command
I'm currently trying to create a shell script that will execute a mysqldump on a remote mysql database and then copy the output file back to my local machine. The problem I'm running into is that I ...
0
votes
0
answers
111
views
Apache 2.4 unixgroup authentication not working
Require unix-group is not working for me when configuring the VirtualHost for my Apache server. Whenever I log in using pwauth, the server still authenticates users who are not members of the group ...
0
votes
1
answer
956
views
Send STDERR to console and file, STDOUT to file only
I have some script with STDOUT and STDERR output. By default, both STDOUT and STDERR goes to console:
./script.sh
I can redirect STDOUT to file, leaving STDERR output in console:
./script.sh > log....
6
votes
4
answers
3k
views
Can I create and manipulate unix "screens" in a script?
I have a work environment on my Ubuntu laptop in which I want to use three different screens.
Eg. in terminal, I usually write
screen -S mywork
run_server_1
then, ctrl-a c to create a second ...
3
votes
2
answers
383
views
Flexible sudo access
I want to be able to give a user on a system I administrate the ability to access file X, using command Y using sudo.
Is there a way to do this while allowing some flexibility over the arguments to ...
0
votes
0
answers
90
views
How to Find which Program is generating given .dat File
I have a file in a folder on the server with ".dat" extension. I want to find which program file is generating this file.
How should I find this using putty?
0
votes
0
answers
95
views
Linux Debian ACL, is default mask overriden by something in FTP?
I have an Linux Debain 10 server running an web project.
The project (parent) folder is as follows:
ls -la:
drwxrwxr--+ 7 some_user some_group 4096 Jul 21 11:01 .
getfacl:
# file: .
# owner: ...
4
votes
2
answers
2k
views
Date and time zone on Linux
I ran the date command and it gave the following output:
root@localhost:~$ date
Thu Dec 30 14:19:47 UTC 2010
Then, I modified the date using date -s which gave the following output:
root@localhost:~$ ...
6
votes
3
answers
39k
views
Cron job errors with "No such file or directory" even when the file DOES actually exist?
I am getting the following three lines in an error message in /var/mail/username after the following job runs in crontab...
15 * * * * /Applications/MAMP/htdocs/iconimageryidx/includes/...
18
votes
8
answers
55k
views
How to get the fully qualified name (FQN) on Unix in a bash script?
I have tested hostname on several servers (RedHat, Ubuntu), and hostname -f has proven unreliable, returning sometime the short name only (as described in this question).
I can see the fqn in the ...
10
votes
5
answers
158k
views
Most simple way of extracting substring in Unix shell?
What's the most simple way to extract substring on Unix shell (with regex)?
Simple means:
less feature
less options
less study
Update
I realized regex itself is conflicting with simplicity, and I ...