date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,444,351,101,000 |
Is there any way to force ssh to change it's working dir in ~/.ssh/config or by using other configuration files?
I have a lot of servers with different environments. Each environment is installed in a specific directory and it would be really helpful to be in this specific directory right after login.
Unfortunately, s... |
On the server, in .profile or whatever is run when you log in:
if [ -n "$USE_DIR_A" ]; then
cd dir_a
elif [ -n "$USE_DIR_B" ]; then
cd dir_b
fi
Then, on the local machine, set both variables:
export USE_DIR_A=yes
export USE_DIR_B=yes
and, set your .ssh/config like this:
Host env1
User me
Port 2222
# here dir... | force ssh to change dir after login based on config |
1,444,351,101,000 |
I would like to use my ssh config to use a google cloud compute instance as a jumpbox to connect to another box. However, I am having problems getting a config that will allow me to even connect to the google cloud compute instance.
The desired functionality is ssh gcloud would connect me to the gcloud instance. ssh... |
I figured out working syntax, I can connect directly to the gcloud compute instance using the name by adding to my ssh config:
Host gcloud
User me
ProxyCommand gcloud compute --project "myproject" ssh --zone "myzone" me@gcloud --command="nc 0.0.0.0 22"
Now I can say ssh gcloud
To use it as a jumpbox I can add... | ssh config to start session with google cloud compute instance |
1,444,351,101,000 |
I have a bunch of Linux machines behind 2 gateways. To connect to set one I do
ssh -o ProxyCommand="ssh gateway1 nc %h %p" machines_behind_1
ssh -o ProxyCommand="ssh gateway2 nc --proxy %h %p --proxy-type socks4" machines_behind_2
To simplify this process, I thought I would create a environment variable to hold the ... |
When you write $PGWA without quotes, this splits the value of PGWA at whitespace¹. Quote characters have no special meaning there, so you end up with the words -o, ProxyCommand="ssh, gateway1, nc, %h and %p".
See Why does my shell script choke on whitespace or other special characters? for more explanations.
A variabl... | Syntax error with variable containing quotes |
1,444,351,101,000 |
I set up a reverse SSH tunnel to access a node, node1, behind a NAT. I have set up an EC2 instance, myEC2, to act as the intermediary. From my laptop, when I want to access node1, I have to SSH into the EC2 in order to then SSH into the node.
The workflow is like this:
In node1, make sure to run: ssh -i key.pem -R 30... |
You're actually using myEC2 as a jump host.
You could ssh to node1 from your laptop with:
ssh -p 3000 -J ubuntu@myEC2 xavier@localhost
The corresponding ssh_config entries would look like:
Host node1
Hostname localhost
User xavier
Port 3000
IdentityFile key.pem
ProxyJump ubuntu@myEC2
Note that the IdentityFile there... | SSH config for connecting to host via reverse SSH tunnel |
1,444,351,101,000 |
Background
I use a 4096-bit RSA key-pair for authorizing access to my server. By ssh_config files I am referring to ~/.ssh/config and /etc/ssh/ssh_config.
Here's what my ~/.ssh/config looks like:
Host gg-root
HostName 172.47.95.122
Host ss-root
HostName 172.47.95.123
# Common for my servers
Host gg-root ss-r... |
ssh-add does not honour the configuration file. It just adds the key to the agent.
The ssh client would try to use the key ~/.ssh/id_rsa_bull when connecting to either of gg-root or ss-root (due to the IdentityFile configuration). If that key is available in the agent, then it will be used from there, otherwise the ... | Does ssh-add honor the declarations made in ssh_config file(s)? |
1,444,351,101,000 |
i cannot run a command before connect with ssh to remote server using ~/.ssh/config file.
I have tried with options "ProxyCommand" and "LocalCommand" but it doesn't work.
ProxyCommand: seems it run the command, but after that doesn't ask me the password of ssh connection
LocalCommand: run the command only if the conn... |
See these answers: https://unix.stackexchange.com/a/44343 (using ProxyCommand) and https://askubuntu.com/a/1268036 (using Match host ... exec)
| SSH config file - Run command before connection |
1,444,351,101,000 |
In my ~/.ssh/config file I have the following option:
RemoteCommand /bin/sh -c 'tmux has-session && exec tmux attach || exec tmux'
This automatically starts tmux and connects to an existing session if possible when connecting via ssh.
This causes sshfs to fail to connect with the error read: Connection reset by peer.
... |
Suppose you used a different hostname when you want to use tmux eg
for sshfs :
ssh user@remotehost
but for tmux
ssh user@remotehost_tmux
and then in your ~/.ssh/config have a section specific for the host remotehost_tmux
eg.
# Global Options
#UseRoaming no
# Hostname specific options
Host <hostname>_tmux
Remot... | Is it possible to have conditional options in ~/.ssh/config based on the calling application (ssh or sshfs)? |
1,444,351,101,000 |
I'm trying to restrict an SSH-tunnel user.
# sudo cat /home/user/.ssh/config
Banner none
ChrootDirectory /home/%u
PasswordAuthentication no
AllowTcpForwarding yes
X11Forwarding no
AllowAgentForwarding no
ForceCommand /bin/false
However, none of these seem to have any effect.
When I prepend /home/user/.ssh/authorized... |
Regarding /home/user/.ssh/config, that's purely for ssh client itself, used on the machine initiating the ssh connection. So not useful here.
Question has been updated saying you've discounted the prospect of adding Match User or Match Group entries into /etc/ssh/sshd_config, because you want a user-specific config.
... | Put `ForceCommand` in a user-specific configuration file |
1,444,351,101,000 |
If there is no -F switch and there is an /home/me/.ssh/config file that I can expect the settings in /etc/ssh/ssh_config to be ignored or do the settings in my home directory just supplement the global configuration the way they would if I specified them with a -o stanza?
For reference, The ssh man page says that the... |
I can expect the settings in /etc/ssh/ssh_config to be ignored?
Yes. ssh reads -F command-line option, which will set the config variable:
case 'F':
config = optarg;
break;
and later on calls the process_config_files function, which either:
reads config specified on command-line, or
reads the other two (/e... | Does the default per user .ssh/config file override all options in system wide ssh_config? [duplicate] |
1,444,351,101,000 |
I would like to use my ssh config to use a google cloud cli (gcloud) to connect to google compute instances. (This is a follow-on to another question I asked, that had a working solution, but didn't address this part of my question)
The desired functionality is ssh <instance-name>.gc would connect me to the gcloud in... |
I figured out some working syntax, maybe it could be cleaned up, but it works.
Host *.gc
User me
ProxyCommand gcloud compute --project "myproject" ssh --zone "myzone" me@$(basename %h .gc) --command="nc 0.0.0.0 22"
| ssh config to start session with google cloud compute instance using gcloud cli command |
1,444,351,101,000 |
I would like to connect to each server using the root user and to machin server using me user.
I edit .ssh/config
User root
Host machin
Hostname machin
User me
When I type
ssh machin
I get
root@machin's password:
What is wrong with my config?
|
According to the ssh_config manual page:
Since the first obtained value for each parameter is used, more
host-specific declarations should be given near the beginning of the
file, and general defaults at the end.
You should change the order of your configuration values, first set the host-specific ones then the ... | ssh config change user for one host |
1,405,459,443,000 |
The ssh-keygen generates the following output:
The key fingerprint is:
dd:e7:25:b3:e2:5b:d9:f0:25:28:9d:50:a2:c9:44:97 user@machine
The key's randomart image is:
+--[ RSA 2048]----+
| .o o.. |
| o +Eo |
| + . |
| . + o |
| S o = * o|
| . o @.|
| . =... |
This was explained in this question: https://superuser.com/questions/22535/what-is-randomart-produced-by-ssh-keygen.
It doesn't really have any use for the user generating the key, rather it's for ease of validation. Personally. would you rather look at this: (Please note this is a host key example)
2048 1b:b8:c2:f4:7... | What's the purpose of the randomart image for user (not host) SSH keys? |
1,405,459,443,000 |
Specifically, why are the first 25 characters of ssh Ed25519 public keys always the same?
For example, if I make 5 keys with ssh-keygen -o -a 100 -t ed25519, the first 25 characters are always AAAAC3NzaC1lZDI1NTE5AAAAI.
I assume this is a preamble or header of some sort, but I would love to know the actual answer.
|
The string is base64 encoded. When decoded, it produces the string \0\0\0\vssh-ed25519\0. This identifies the type of the key. In this case an EdDSA key.
| Why do portions of SSH public (and private) keys overlap? |
1,405,459,443,000 |
Is there a way to convert existing pair of OpenSSH keys to the SSH2 (ssh.com format) pair of keys?
UPD: since there are some answers about ssh-keygen suddenly appeared, I'll explain where I came from (also it will be a nice answer on "what have you tried?").
$> diff --report-identical-files <(ssh-keygen -e -f ~/.ssh/... |
This tutorial titled: SSH: Convert OpenSSH to SSH2 and vise versa appears to offer what you're looking for.
Convert OpenSSH key to SSH2 key
Run the OpenSSH version of ssh-keygen on your OpenSSH public key to convert it into the format needed by SSH2 on the remote machine. This must be done on the system running OpenSS... | Convert OpenSSH private key into SSH2 private key |
1,405,459,443,000 |
I try to find a script to decrypt (unhash) the ssh hostnames in the known_hosts file by passing a list of the hostnamses.
So, to do exactly the reverse of:
ssh-keygen -H -f known_hosts
Or also, to do the same as this if the ssh config HashKnownHosts is set to No:
ssh-keygen -R know-host.com -f known_hosts
ssh-keyscan... |
Lines in the known_hosts file are not encrypted, they are hashed. You can't decrypt them, because they're not encrypted. You can't “unhash” them, because that what a hash is all about — given the hash, it's impossible¹ to discover the original string. The only way to “unhash” is to guess the original string and verify... | How to decrypt hostnames of a crypted .ssh/known_hosts with a list of the hostnames? |
1,405,459,443,000 |
When I log in to an SSH server/host I get asked whether the hash of its public key is correct, like this:
# ssh 1.2.3.4
The authenticity of host '[1.2.3.4]:22 ([[1.2.3.4]:22)' can't be established.
RSA key fingerprint is SHA256:CxIuAEc3SZThY9XobrjJIHN61OTItAU0Emz0v/+15wY.
Are you sure you want to continue connecting (... |
ssh
# ssh -o "FingerprintHash sha256" testhost
The authenticity of host 'testhost (256.257.258.259)' can't be established.
ECDSA key fingerprint is SHA256:pYYzsM9jP1Gwn1K9xXjKL2t0HLrasCxBQdvg/mNkuLg.
# ssh -o "FingerprintHash md5" testhost
The authenticity of host 'testhost (256.257.258.259)' can't be established.
EC... | How to compare different SSH fingerprint (public key hash) formats? |
1,405,459,443,000 |
I am trying to add a public key to a server but I don't want to restart the sshd service for it to take effect. The reason is that restarting the ssh service seems to be disruptive for other users who could use the ssh service at that time. Most documentation suggest to add a public key to $HOME/.ssh/authorized_keys a... |
Is the restart of sshd needed?
Not usually. Linux distributions usually ship with a default configuration that allows public key authentication, so you usually don't even have to edit configuration to enable it, and so restarting is unnecessary. Even in the case that you had to do something with sshd_config, you'd o... | Add key to authorized_users without needing to restart sshd |
1,405,459,443,000 |
I build container from below Dockerfile:
FROM ubuntu:14.04
...
RUN apt-get update && apt-get install -y vim
#RUN ssh-keygen -f /root/.ssh/id_rsa -N strongpass123$%^
RUN ssh-keygen -f /root/.ssh/id_rsa
...
I do it quite rarely, but there is many command before using of ssh-keygen and after it.
I know that I can do it... |
Generally, you should not include any secrets in Docker images. See this answer for more on this topic.
Docker does not support interactive builds for good reasons as explained in this issue.
If you really need to do this, you can use docker commit like so:
docker build -t thirsty_darwin_base /path/to/Dockerfile
dock... | Can I build a Docker container from Dockerfile in an interactive way with allocation of some pseudo TTY? |
1,405,459,443,000 |
I need to add a check if the hostname is already present in the known_hosts file.
Normally I would do something like that:
ssh-keygen -H -F hostname
However, that does not seem to work for me in this particular case. I connect to the host using port 2102, like that:
ssh user@myhost -p 2102
I was asked to add the hos... |
You can use this format: [hostname]:2121, as it is stored in the known_hosts file (note, you need to use the square brackets!):
ssh-keygen -H -F "[hostname]:2121"
Proof of concept (transcript of my minimal test case):
$ echo "[hostname]:2121 ssh-rsa AAA...==" > known_hosts
$ ssh-keygen -Hf known_hosts
known_hosts up... | Check presence of a hostname under custom port in known_hosts |
1,405,459,443,000 |
I used in my bash script the follwing cli , in order to send the public key to remote machine
sshpass -p $pass scp /root/.ssh/authorized_keys root@$remote_host:~/.ssh/authorized_keys
but since we want to append the public keyes from other host then I am searching the approach top append
in bash I know that the optio... |
Use ssh together with tee -a file:
< /root/.ssh/authorized_keys sshpass -p "$pass" ssh root@"$remote_host" "tee -a ~/.ssh/authorized_keys"
or ssh with cat >> file if you prefer:
< /root/.ssh/authorized_keys sshpass -p "$pass" ssh root@"$remote_host" "cat >> ~/.ssh/authorized_keys"
Both tee and cat will read from std... | how to append public keys to remote host instead of copy it |
1,405,459,443,000 |
When i try to convert SSH2 RSA format based private key to .pem format, using openssl i am getting the below error.
[jbadmin@xxxxxxx .ssh2]$ openssl req -x509 -key /home/jbadmin/.ssh2/id_rsa_2048_a -nodes -days 365 -newkey rsa:2048 -out id_rsa_2048_a.pem
unable to load Private Key
139994671441736:error:0906D06C:PEM ro... |
Solution: I used the below command to get it worked
$ ssh-keygen-g3 --key-format openssh2 --import-private-key /home/jbadmin/.ssh2/id_rsa_2048_a /home/jbadmin/.ssh2/id_rsa_2048_a_openssh.pem
Imported private key in /home/jbadmin/.ssh2/id_rsa_2048_a to /home/jbadmin/.ssh2/id_rsa_2048_a_openssh.pem.
| Converting SSH2 RSA Private Key to .pem using openssl |
1,405,459,443,000 |
I generated my public/private key pair using
ssh-keygen -t rsa -b 2048 -v
and then needed a .pem file and followed this https://serverfault.com/questions/706336/how-to-get-a-pem-file-from-ssh-key-pair
ssh-keygen -f id_rsa -e -m pem
-----BEGIN RSA PUBLIC KEY-----
but then i found this https://gist.github.com/mingf... |
That's how they are written; OpenSSH emits the public key material via a PEM_write_RSAPublicKey(stdout, k->rsa) call in the do_convert_to_pem function of ssh-keygen.c, while OpenSSL operates instead on the given private key. With OpenSSH, I'd imagine that the majority of cases would be to convert the public key into a... | pem file difference - ssh-keygen vs openssl |
1,405,459,443,000 |
When I connect to my Dropbear SSH server for the first time, I get the following message:
me@laptop:~$ ssh me@server
The authenticity of host 'server' can't be established.
RSA key fingerprint is SHA256:NycCxoRiiSAGA7Rvlnuf1gU8pazIpXJKZ3ukdivyam8.
Are you sure you want to continue connecting (yes/no)?
To make sure t... |
Locate the host key file on the server:
me@server:~$ ls /etc/dropbear/
authorized_keys config dropbear_rsa_host_key
Use dropbearkey to get the public key portion and fingerprint of that host key:
me@server:~$ sudo dropbearkey -y -f /etc/dropbear/dropbear_rsa_host_key
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAA... | How to verify fingerprint of Dropbear RSA host key? |
1,405,459,443,000 |
Short Question
I'm assuming that ssh-keygen -r hostname uses a default public key. I would have thought that it would default to ~/.ssh/id_rsa.pub, but that does not appear to be the case. So what is it doing?
Long Version
My experience with the OpenSSH command-line utilities is that they either prompt the user for an... |
ssh-keygen -r generates a SSHFP record. That's something you put in a DNS entry to say indicate the host key corresponding to a host name. This allows someone who wants to log into your machine to know what host key to expect, assuming that they trust the DNS record (which in practice means that it must be obtained us... | What does `ssh-keygen -r` do if a public key is not specified? |
1,405,459,443,000 |
I configured my server to not allow password authentication. Now I have a new machine in a remote location, how is it possible for me to generate an ssh key and do an ssh-copy-id to the server if the server doesn't allow password authentication?
|
If the new server only supports key authentication, you've jumped the gun as stated by @dr01.
Assuming your new server still allows password connections, the only "key exchange" that seems possible is this:
1) generate your key on newmachine
2) log into existing server using your already configured key
3) scp newuser@... | How to copy public key to the server that doesn't allow password? |
1,405,459,443,000 |
Does gnome-keyring support SSH private keys that are saved in the newer OpenSSH file format? Will Gnome Keyring automatically import those private keys?
In more detail: When generating a SSH private key, ssh-keygen can save the private key in the newer OpenSSH format (rather than the "more compatible PEM format"). W... |
Things have changed slightly now. As a result GNOME 3.28 now wraps OpenSSH's ssh-agent, which gives it the same level of support as OpenSSH.
Reference - Archlinux wiki - GNOME/Keyring
Known issues
Cannot handle ECDSA and Ed25519 keys
As of January 2018, GNOME Keyring doesn't handle ECDSA nor
Ed25519 keys. You can t... | Does Gnome Keyring support new-format OpenSSH private keys? |
1,405,459,443,000 |
I created a key for logging into a server (using ssh-keygen) with the name id_rsa, and so in my .ssh directory there is id_rsa.pub and id_rsa.
The reason I used this name, is because when I tried other names, they didn't work with my server (I couldn't log in for some reason).
I setup a new server today (and generated... |
Generally speaking SSH keys identify clients, not servers (well, at least for the keys in ~/.ssh). The recommended approach is to generate one key per client, as you’ve done effectively, and to add all the appropriate public keys to ~/.ssh/authorized_keys on the servers/accounts you need to access.
So on your Macbook ... | How to merge keys, or handle keys with the same file name? |
1,405,459,443,000 |
I use the ssh-keygen -t rsa to generate the RSA key pairs. I see that in the id_rsa.pub file, I see the username and the hostname.
But I want to know that what elements will affects the key pairs. For example, if I change the host ip, need I regenerate the key pairs? And the hostname? or even I reinstall the operating... |
The key is randomly generated. There's nothing more special to its origin than that. Meaning that as long as only you hold the private key, there is no need to replace it.
In SSH, a user key is generally used to identify a combination of user & origin system. Meaning the key is not shared among users on the same syste... | What elements affects the key pairs generated by ssh-keygen? |
1,405,459,443,000 |
Is there an easy way to generate hashed hostnames to be added to the ~/.ssh/known_hosts file?
I'd like to add a @cert-authority line to the ~/.ssh/known_hosts file.
Obviously the ssh-keygen command would not get the CA cert.
I think it also needs a connection to the server,
and I'm not sure I can get it to hash a wil... |
If you want to change the hostname for an existing hashed host, edit your known_hosts file, replacing the hashed hostname with the plaintext hostname you wish associated with that key, and rehash the file:
ssh-keygen -H
If you want to generate hashes for a list of hostnames without disturbing your known_hosts, creat... | Generate hashed name for SSH known_hosts |
1,405,459,443,000 |
I have generated the keys in Ubuntu 14.04 system using the following commands to use with ssh.
ssh-keygen -t rsa -b 2048
openssl rsa -in id_rsa -outform pem > pk_rsa.pem
openssl rsa -in pk_rsa.pem -pubout -out my_key.pem
I have copied the my_key.pem to my local which is OSX. Trying to ssh into the Ubuntu using the... |
You are conflating two different technologies, openssh and openssl. It appears you need only the former.
As you have already created an ssh key pair, you just need to copy the public key to the server you intend to ssh to. The correct way to do this is:
$ ssh-copy-id username@<server-ip>
Replace username and <ser... | SSH asking me for passphrase which doesn't have any passphrase |
1,405,459,443,000 |
I'm looking for a way to set a specific SSH key while logging to a remote host with a particular username. Is this possible within the SSH config file?
For example:
Use key "id_rsa-test" for username "testuser":
ssh testuser@host1
ssh testuser@host2
ssh testuser@host3
Use key "id_rsa" for all other users.
ssh root@ho... |
Thank you @xhienne (comment link) for your suggestion.
Adding the following to ssh_config appears to have solved the problem:
Match User testuser
IdentityFile ~/.ssh/id_rsa-test
This block should be placed above Host * to send id_rsa-test ahead of id_rsa for testuser.
| Use X SSH key when logging in to Y remote user? |
1,405,459,443,000 |
After running successfully, my build script attempts to copy the final binary onto my FTP server using the scp command. Since the build takes a while, I don't want to be prompted for my password every time, so I tried to set up an SSH-keypair.
[wbarlow@build-machine]$ ssh-keygen
Generating public/private rsa key pair.... |
Config settings for the SSH server are often in /etc/ssh/sshd_config but the first thing I would check is the location and the permissions of the public key and its parent directory that you copied to the server.
Noting that correct permissions of authorized_keys on the remote are critical for ssh to work - and henc... | How to know if I can use ssh keypairs? |
1,405,459,443,000 |
I just recently started a VPS using Fedora. Upon creation of the VPS I was asked if I wanted to use SSH keys (which I did). Now, to connect as root to the VPS, I do not need to enter a password.
Now I want to create a pair (or just reuse the same key) for user1 for use while using ssh. First I tried to paste the id... |
You can use the option -i to specify to ssh which identity file it should use.
Also have you checked with ssh - v what really happen? I mean the keys are really not used or are they used but doesn't match?
| Fedora, where to put my ssh keys to login? [duplicate] |
1,405,459,443,000 |
On a remote server I want to create a normal user and ONLY allow access via a key but I do NOT want to create the account with a password first and then disable password access later. In my admin account on the remote server I have done the following:
sudo adduser --disabled-password normaluser
Trying to connect as '... |
Make sure your key is added to /home/normaluser/.ssh/authorized_keys
Authorized keys are per user, meaning that just because a key can be used to log into another user doesn't mean you can use it to log in as any user.
| How to generate keys after creating user with adduser --disabled-password |
1,405,459,443,000 |
I created a public/private key pair using the ssh-keygen -t rsa in my ~/.ssh folder.
I then copied the key over using the ssh-copy-id [email protected] command and received this notification.
Number of key(s) added: 2
I tried logging in but was still prompted for a password. I ran a find / -name id_rsa.pub com... |
Your .ssh directory can't be world accessible:
chmod 700 ~/.ssh
should fix it
| ssh public key not getting copied over |
1,405,459,443,000 |
I would like to generate an ssh key pair for a service account on one machine to access another machine via ssh.
When I generate the key with my user, my username is embedded in the public key.
E.g. This has [email protected] in the public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDHt9bVJZZ78NE8xYXDfPyXE4+1ajONSRzBAW7... |
In ssh speak, that's a comment, not a name. But I find "name" more fitting, as that's exactly what it's used for... so.
you can just change the name, arbitrarily, using ssh-keygen -c. Not part of the key itself.
you can specify the "name" with the -C command line option to ssh-keygen.
For future readers / reference... | how to create an ssh key-pair for a service account |
1,405,459,443,000 |
How to convert RFC4716 private keys to PEM private keys in ubuntu 20.04?
For our project we generated ssh keys on a device running the latest openssh software. JSch complained about authentication:
Exception com.jcraft.jsch.JSchException: Auth fail
After a lot of research, including building a minimal git client we d... |
$ cat /tmp/test
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEArKk9jKvP/kwZq5GAog449OK5LzjppL5DbQhlJcqntzqu88+6WDHr
lQM0IKyHgEkRDim8MrmisK2eIJrmj99STJEBPu7jgJ0q2ASToSeFiU8FB+yrV9ZmelwJ7f
1rD5vp3TlROAc08pIKb2YVHE4KfLzAncGXVETldTuGDAHgXQWIlhZD... | How to convert RFC4716 private keys to PEM private keys? |
1,405,459,443,000 |
I have two systems
Personal MacOS Laptop to be referred as system-Laptop having user laptopuser. It does not have "NAT"
Server Linux to be referred as system-Server having user serveruser having static IP anyone can connect to.
system-Server needs to send ssh commands to system-Laptop using a reverse SSH tunnel as... |
Firstly, the easiest way to copy SSH keys is by using ssh-copy-id command. Do this for both users.
Secondly, to create a reverse tunnel, use the following command (executed on laptop):
ssh -fnN -R 3322:localhost:22 serveruser@system-server
Then lastly, connect to the tunneled service. No password will be asked if ssh... | Reverse SSH works but not passwordless. Getting password prompt |
1,405,459,443,000 |
I'm trying to get two server to connect via ssh keys.
These two servers had working ssh key authentication before, but one of them failed and was restored from a backup.
Since then, the key does not seem to be working.
I've tried the following:
Making sure permissions are set correctly
Removing all remote entries of ... |
First of all you can use -vvv option to get debugging info from ssh.
ssh -vvv user@host
Secondly most system will accept only few (about 6) tries, so if you have more ssh keys then you should point specific, because wrong keys might used available challenges from ssh server. (It's configurable by MaxAuthTries paramet... | SSH key accepted but remote host asks for password |
1,405,459,443,000 |
I thought it was not be possible to view the content of a password-protected private key file without actually inputing a password.
Very surprisingly though, I can still see the content of my private key file even though it's well password-protected. Steps:
$ ssh-keygen -t ed25519 -o -a 100
I then input my password. ... |
There is a difference between an encrypted key (which is password protected) and a non-encrypted key. All keys are still plaintext files. Below I have generated a key, with no password, and then secured it by adding a password, and you can see how the contents of the file on disk is different:
$ ssh-keygen -f ./id_e... | SSH Password-protected Private Key Still Visible |
1,405,459,443,000 |
I know this is a bit weird. I generated ssh keys on my server, but I still want to force clients to enter a passphrase to be able to SSH to the server,even if they have the key. Is that even possible? Can I set a password on top of the key, and force clients to use both to SSH?
|
Without knowing the version of OpenSSH you're running, or the distro, it's difficult to answer. However, there are many ways to achieve this. One such way, if you're running a recent version of OpenSSH, is to use the AuthenticationMethods directive in you /etc/ssh/sshd_config file. Example:
AuthenticationMethods publi... | Force ssh to ask for password and public key |
1,405,459,443,000 |
How to generate SSHFP records for a Dropbear instance at OpenWrt? I have dropbearconvert and openssh-keygen installed, but nothing works. Always invalid format or similar errors. There are two host key files available:
/etc/dropbear/dropbear_dss_host_key
/etc/dropbear/dropbear_rsa_host_key
Any ideas how to get a SSHF... |
Dropbear uses its own format for key storage and public keys are not on file.
The dropbearkey binary can be used to generate keys and convert between formats.
dropbearkey -y -f /etc/dropbear/dropbear_rsa_host_key > /tmp/ssh_host_rsa_key.pub
ssh-keygen -r host.example.net -f /tmp/ssh_host_rsa_key.pub
See https://githu... | How to generate SSHFP records with OpenWrt/Dropbear? |
1,303,753,299,000 |
I see POSIX mentioned often and everywhere, and I had assumed it to be the baseline UNIX standard.. until I noticed the following excerpt on a Wikipedia page: The Open Group
The Open Group is most famous as the
certifying body for the UNIX
trademark, and its publication of
the Single UNIX Specification
techn... |
POSIX first was a standard in 1988 long before the Single UNIX Specification. It was one of the attempts at unifying all the various UNIX forks and UNIX-like systems. POSIX is an IEEE Standard, but as the IEEE does not own the UNIX® trademark, the standard is not UNIX® though it is based on the existing UNIX API at ... | What exactly is POSIX? |
1,303,753,299,000 |
Is there an official POSIX, GNU, or other guideline on where progress reports and logging information (things like "Doing foo; foo done") should be printed? Personally, I tend to write them to stderr so I can redirect stdout and get only the program's actual output. I was recently told that this is not good practice s... |
Posix defines the standard streams thus:
At program start-up, three streams shall be predefined and need not be opened explicitly: standard input (for reading conventional input), standard output (for writing conventional output), and standard error (for writing diagnostic output). When opened, the standard error str... | Do progress reports/logging information belong on stderr or stdout? |
1,303,753,299,000 |
I am having some issues in using an answer provided on this site for this question about a sed command to replace a blank line with two other lines of content, and it was brought up if the sed command on Mac OS (10.6.7 for me) is different. I don't think that it is, but was wondering if others on this site thought dif... |
The behavior of shell utilities does differ in minor ways between unix variants. There are many unix variants, with a complex history. There are standardisation efforts such as the POSIX standard and its superset the Single UNIX specification. Most systems nowadays implement POSIX:2001, also known as the Single UNIX S... | Differences between sed on Mac OSX and other "standard" sed? |
1,303,753,299,000 |
Java community use 4 spaces as the unit of indentation. 1
Ruby community use 2 spaces that is generally agreed-upon. 2
What's the standard for indentation in shell scripts? 2 or 4 spaces or 1 tab?
|
There is no standard indentation in shell scripts that matters.
Slightly less flippant answer:
Pick a standard in your team that you can all work to, to simplify things.
Use something your editor makes easy so you don't have to fight to stick to the standard.
| What's the standard for indentation in shell scripts? [closed] |
1,303,753,299,000 |
What resources exist for portable shell programming? The ultimate answer is to test on all targeted platforms, but that's rarely practical.
The POSIX / Single UNIX specification is a start, but it tells neither you what the level of support of each implementation is, nor what common extensions exist. You can read the ... |
The autoconf manual has a section on
portable shell programming.
Although that's not specifically targeting POSIX, it's probably the
most complete collection of what to do and not to do when attempting
to write portable shell code.
| Resources for portable shell programming |
1,303,753,299,000 |
I would like to know which are the standard commands available in every Linux system.
For example if you get a debian/ubuntu/redhat/suse/arch/slackware etc, you will always find there commands like:
cd, mkdir, ls, echo, grep, sed, awk, ping etc.
I know that some of the mentioned commands are shell-builtin but others a... |
Unfortunately there is no guarantee of anything being available.
However, most systems will have GNU coreutils. That alone provides about 105 commands. You can probably rely on those unless it's an embedded system, which might use BusyBox instead.
You can probably also rely on bash, cron, GNU findutils, GNU grep, gz... | Which are the standard commands available in every Linux based distribution? |
1,303,753,299,000 |
I was wondering how the "GUI" of a command line application is communicated over a network. Most of the time, it's quite simple (plain text / input) but sometimes it's more complex (aptitude).
Is it defined by some sort of standard so that anyone can write their own terminal and that all terminal implementations beha... |
Console programs typically use curses or one of its successors¹ to build the sorts of text user interfaces you're talking about.
These libraries use one of two databases, called termcap and terminfo.² These databases contain maps that tell the library what codes to send to get desired actions with a large number of di... | What protocol/standard is used by terminals? |
1,303,753,299,000 |
If a shell is asked to perform a probably useless (or partially useless) command known to terminate, such as cat hugeregularfile.txt > /dev/null, can it skip that command's execution (or execute a cheaper equivalent, say, touch -a hugeregularfile.txt)?
More generally, is the shell similar to C compilers in that it may... |
No, that would be a bad idea.
cat hugeregularfile.txt > /dev/null and touch -a hugeregularfile.txt are not the same. cat will read the whole file, even if you redirect the output to /dev/null. And reading the whole file might be exactly what you want. For example in order to cache it so that later reads will be signif... | Is the shell permitted to optimize out useless terminating commands? |
1,303,753,299,000 |
I was wondering, is there any differences between Debian Standard and GNOME versions?
Isn't Debian under GNOME by default?
|
Debian Live Standard is Debian without the Graphical User Interface.
Debian Live Gnome is Debian Standard with Gnome.
| What's the difference between Debian Standard and Gnome? |
1,303,753,299,000 |
What is the practical usage of /etc/networks file? As I understand, one can give names to networks in this file. For example:
root@fw-test:~# cat /etc/networks
default 0.0.0.0
loopback 127.0.0.0
link-local 169.254.0.0
google-dns 8.8.4.4
root@fw-test:~#
However, if I try to use this network n... |
As written in the manual page, the /etc/networks file is to describe symbolic names for networks. With network, it is meant the network address with tailing .0 at the end. Only simple Class A, B or C networks are supported.
In your example the google-dns entry is wrong. It's not a A,B or C network. It's an ip-address... | practical usage of /etc/networks file |
1,303,753,299,000 |
I am looking for specific details as to why isn't GNU/Linux currently SUS (Single UNIX Specification) v3 or even better SUS v4 compliant?
What application APIs and user utilities does it miss or implement in a non-SUS compliant way?
|
To get a certification you need to pay, and it's actually really expensive. That's why BSD-like and GNU/Linux OS vendors don't apply for it.
So there isn't even a reason to check whether GNU/Linux is compliant or not.
http://en.wikipedia.org/wiki/Single_UNIX_Specification#Non-registered_Unix-like_systems
Most of all, ... | Why isn't GNU/Linux SUS v3+ compliant? |
1,303,753,299,000 |
I was wondering if there is a convention for file type extensions for shell scripts you want to source instead of run. For example:
If I want to run this script in a subshell.
./script.sh
If I want to remember to run this script from the current shell.
. script.source
Is there a convention (like POSIX for ex... |
I'd use .sh (for files in the POSIX sh language, .bash for non-sh-compatible bash files, that is the extension identifies the language the script is written in) for files intended to be sourced (or more generally not intended to be executed), and no extension for files that are meant to be executed.
You can also add a... | An official standard / convention for a file extension for shell scripts to source |
1,303,753,299,000 |
I am looking for official documents on all POSIX standards and specifications. I would like to be able t read the docs to get a better understanding of UNIX systems and how they work at a low level. I've seen links here and there to opengroup.org, which I'm assuming is the entity behind the standards (however, I've he... |
SUSv2
SUSv3
POSIX 2008
| Where can I find official POSIX and UNIX documentation? |
1,303,753,299,000 |
Is it legal to print null bytes using awk's printf function according to POSIX? The POSIX standard of awk does not seem to explicitly mention it either way. Real world implementations differ in how they behave:
+$ gawk 'BEGIN { x = sprintf("\000"); print(length(x)); }'
1
+$ busybox awk 'BEGIN { x = sprintf("\000"); pr... |
There are at least 4 relevant pieces of text in the POSIX.2018 specification of awk:
Emphasis (bold text) is mine in all the quoted text below:
Input files to the awk program from any of the following sources shall be text files
That means that if the input contains NUL characters (which would make it non-text as pe... | What is POSIX awk's stance on null byte in variables/printf? |
1,303,753,299,000 |
I came across a confusing variation in the understanding what options and arguments are with regard to the syntax of commands.
For instance, I encountered definitions like:
command -a -b -c d e f
some differ between -a -b -c, call them options or switches and d e f by calling them arguments.
command -a -b -c d e f
s... |
Adapted from the POSIX standard's "Utility Argument Syntax" section:
utility_name [-a] [-b] [-c option_argument]
[-d|-e] [-f[option_argument]] [operand...]
The utility in the example is named utility_name. It is followed by options, option-arguments, and operands.
The arguments that consist of - characte... | Confusion about changing meaning of arguments and options, is there an official standard definition? |
1,303,753,299,000 |
In the "Command Search and Execution" section, the POSIX specification says that PATH is searched when finding a utility to execute (with some exceptions). Does the specification mention anywhere that PATH will be initialized to a value that guarantees that all standard utilities will be found?
Or do I need to do som... |
Yes and no. In a POSIX environment, the utilities must behave as described by the specification. In practice, this means that conforming versions of the utilities must be present in $PATH. However, when running your program on a POSIX-compliant system, you may be running it in a non-conforming environment. In practice... | Does POSIX guarantee that the standard utilities are in PATH? |
1,303,753,299,000 |
Does POSIX mandate that stdin is 0, stdout is 1 and stderr is 2 or is this only a convention? Do other systems diverge from that convention or is it a safe assumption?
|
It seems that they are standardized in the POSIX spec,
POSIX.1-2017 by proxy of unistd.h
The header shall define the following symbolic constants for file streams:
STDERR_FILENO File number of stderr; 2.
STDIN_FILENO File number of stdin; 0.
STDOUT_FILENO File number of stdout; 1.
But also the POSIX docs on "std... | Does POSIX standardize the file descriptor numbers? |
1,303,753,299,000 |
Is the behavior of .* to include . and .. defined in LSB or POSIX or some other specification?
|
Quoting from the Single Unix specification version 2, volume ”Commands & Utilities", §2.13.3:
If a filename begins with a period (.) the period must be explicitly matched by using a period as the first character of the pattern or immediately following a slash character. (…) It is unspecified whether an explicit perio... | Is the behaviour of .* to include . and .. defined in LSB or POSIX or some other specification? |
1,303,753,299,000 |
I've been frustrated before with differences in output from the which command across different platforms (Linux vs. Solaris vx. OS X), with different shells possibly playing into the matter as well. type has been suggested as a better alternative, but how portable would that be?
In the past I've written functions whi... |
In the 21st century, especially if you're targeting machines that are likely to have bash or zsh, you can count on type being available. (It didn't exist in extremely old unices, as in, from the 1970s or early 1980s.) You can't count on its output meaning anything, but you can count on its returning 0 if there is a co... | What is the best way to detect (from a script) whether software is installed? |
1,303,753,299,000 |
Under some answers, I see comments that recommend avoiding shell specific commands in answers.
How do I know which commands, operators, etc exist in all shells? Is there a list of standards?
man builtins gives a list of commands. Are those the only commands that I can use in a portable shell script
that works in all ... |
Greg's Wiki has a post on adapting bash scripts for Dash that points out a lot of 'bashisms' - extra features that are non-standard but are a part of bash. Avoiding those bashisms can help to make your script friendlier to different environments. This particularly answers some of your questions. For instance, yes, the... | What is not shell specific? |
1,303,753,299,000 |
When I run xprop I get a class string that has two values, one of them i3 calls an instance, the other a class, for example on chromium-browser the xprop utility will return something like this,
WM_CLASS(STRING) = "chromium-browser", "Chromium-browser"
What is the official guidance on a window and these two fields? F... |
The actual behavior is defined by the spec entitled the Inter-Client Communication Conventions Manual (ICCM). Basically the class name is specified by the person who makes the app. The instance name can be specified by the user and its specified resources should override the class name specified resources.
Here is wha... | WM_CLASS vs WM_INSTANCE? |
1,303,753,299,000 |
One answer to this question mentions the UNIX 03 certification of OSX. Now AFAIK the standard file system of OSX is/was HFS, which "saves the case of a file that is created or renamed but is case-insensitive in operation" (i.e. it's case-preserving but case-insensitive).
Does the UNIX certification or POSIX require a ... |
According to the POSIX specification:
The system may provide non-standard extensions. These are features not
required by POSIX.1-2008 and may include, but are not limited to:
--snip--
Non-conforming file systems (for example, legacy file systems for which _POSIX_NO_TRUNC is false, case-insensitive file systems, or... | Does the UNIX standard require case-sensitive filesystems? |
1,303,753,299,000 |
I moved /root to /home/root and changed the appropriate entry in /etc/passwd in my Linux system quite some time ago and everything's worked until recently when I discovered that at least the firejail application hardcodes the root home directory and stops working otherwise under some circumstances. I presume it will b... |
POSIX doesn’t have much to say about the administrative user; when privileges are discussed, they are discussed in terms of process privileges (since that’s what really matters in POSIX-style systems). It acknowledges the existence of the root user but doesn’t define any requirements on its home directory.
The FHS exp... | Is /root a hard requirement for a modern Linux system? What about POSIX? UNIX? |
1,303,753,299,000 |
man git-format-patch makes reference of the UNIX mailbox format which is a term I am unfamiliar with.
A google search for "UNIX mailbox format" and similar expressions lists many hits with the term mbox in it.
There is even a man page (man mbox) for mbox.
I am lead to conclude that mbox and the UNIX mailbox format are... |
Can someone confirm (or deny) my assumption?
Yes, Both are same.
UNIX mbox format is used by AsyncOS when messages are archived (in anti-spam and anti-virus configuration) and logged (in the message filter log() action).
mbox is traditional UNIX mailbox format. Users' INBOX mboxes are commonly stored in /var/spool/m... | What is the unix mailbox format? |
1,303,753,299,000 |
Moved from Stack Overflow, where I realize it was off-topic since it was asking for sources - far as I can tell, the rules forbid that there but not here.
I know that the kernel in Android is now mostly the Linux kernel with a few exceptions like wakelocks (as described by John Stultz.) But is it close enough to be co... |
The LSB, POSIX, and the Single UNIX Specification all significantly involve userland. Simply using a kernel that is also used as the basis of a "unix-like", "mostly POSIX compliant" operating system -- GNU/Linux -- is not sufficient to make Android such as well. There are, however, some *nix-ish elements, such as th... | Is Android compatible with the Linux Standard Base? |
1,303,753,299,000 |
An excerpt from the man man page:
The default action is to search in all of the available sections following a pre-defined order ("1 n l 8 3 2 3posix 3pm 3perl 5 4 9 6 7" by default)
What are the n, l and 3pm sections of the manual for?
|
The 3pm section is not used anymore. It is defined as manual pages concerning modul packages of perl in an old version of the Debian Perl Policy, noteably in version 1.2. Here is a site where you can read that old deprecated policy (see §3.1 and §1.4). In the latest Debian Perl Policy it is defined in §2.4 that module... | What are the 'n', 'l', '3pm' sections of the manual for? |
1,303,753,299,000 |
I have several GNU/Linux installations that share home and data directories. Over time some user files in these directories have received the group ID 100 (users group under some variants of Linux), others have the group ID 1000 (also the users group, under other variants).
Now I wish to unify the users group ID betw... |
LSB specifies some group names, but users is not one of them.
http://refspecs.linux-foundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/usernames.html
On a completely new setup, you might prefer to avoid using 1000. The way useradd works, it would allocate each user a group, and the numeric identifiers for use... | Recommended GID for users group in Linux (100 or 1000)? |
1,303,753,299,000 |
Is there a standard for $PATH and the order of things that are supposed to be in there? out of the box Arch Linux doesn't have /usr/local/bin in the $PATH. I want to add it but I'm not sure if there's a predefined pecking order for system paths.
Also where is the right place to do this? for right now I modified /etc/p... |
Arch is a minimalistic linux distribution, so normally there are no other special configuration files which are getting included in some strange placces, modified by system configuration wizards.
/etc/profile is the right place to do this for a system wide configuration.
This file is intended to be used for
ALL com... | modify path globally |
1,303,753,299,000 |
Is there a standard way to make a program start when a user logs in?
On Ubuntu, for example, you can place a .desktop file in ~/.config/autostart and the application will launch on startup.
Does this apply to other distros as well?
|
This is not distro specific so much as Desktop Environment or Window Manager specific. First of all, there is the situation of users logging into a text console or remote tty via ssh. What gets run when those users login is usually controlled by their shells rc files and the system shell profiles.
Then there is the gr... | Is there a standard way to have a program start when a user logs in on Linux? |
1,303,753,299,000 |
From the Wikipedia "ANSI escape code" article:
The name "ANSI escape sequence" dates from 1981 when ANSI adopted ECMA-48 as the standard ANSI X3.64 (and later, in 1997, withdrew it).
Does anybody know why the standard has been withdrawn. I tried to follow the link in the article but didn't find anything.
|
I found this paragraph in a withdrawal letter for FIPS which might be why it was withdrawn:
excerpt from withdrawal letter
It is no longer necessary for the government to mandate standards
that duplicate industry standards. Federal government departments and
agencies are directed by the National Technology Tran... | Why has the ANSI 3.64 standard been withdrawn? |
1,303,753,299,000 |
Possible Duplicate:
What's the point in adding a new line to the end of a file?
What is considered better behaviour: to leave the last letter of the last line to be the last byte of a file, or to press Enter at the end to let there be a lf? Why?
|
(Copied from my comment on the question, as requested.)
See Why should files end with a newline? - Stack Overflow. The "TL;DR": POSIX says so, and it's pretty logical to have a line end in and end-of-line character.
See the linked Stack Overflow question for practical consequences.
| Should I end my text/script files with a newline? [duplicate] |
1,303,753,299,000 |
I'm from a windows background where I'm used to creating separate domain service accounts for running various services. I like to keep things need so I would name them
DOMAIN\service.whatever
I'm about to create a daemon account for running hadoop on Centos linux, I'm just playing around on a home VM but would like t... |
Usually just the name of the package or program, so hadoop in this case.
Daemons are usually added as a system account using useradd -r, which gives them a userid lower than human users (on my system, system accounts start at 100, human users start at 1000).
Looking at the user names for system accounts in /etc/passwd... | Is there a common naming convention for daemon user accounts? |
1,303,753,299,000 |
I have found some very good answers here on the differences between [ and [[ in 'if' statements. For specific named shells, it seems to be a good idea to use [[ over [ (and it is faster, too).
I'm still unclear on portability, however. If my goal is to write a script for POSIX compatible shells, scripts that I would... |
If my goal is to write a script for POSIX compatible shells, scripts that I would begin with #!/bin/sh, how permissible is this [[ syntax.
Not at all. Many modern Linux-based systems use dash as /bin/sh by default, which is fully POSIX-compliant and no more, and so [[ will not work. This includes every recent Debian... | Single or double brackets and portability |
1,303,753,299,000 |
I've got a program that requires some unprintable characters like 0x0F (ctrl+o) as input to execute the intended part of the program.
0 000 00 NUL � Null char
1 001 01 SOH  Start of Heading
2 002 02 STX ... |
this command did the job
printf '\x0f\x11' | program
| Unprintable characters as input in command line |
1,303,753,299,000 |
In most scripts (but mainly bash) it's commonplace to see some arguments that are configured like so:
bash-4.3:$ command --longer-argument -la
Where did this originate from? I'm mainly just curious as to why this became effectively a unanimous standard. Is it mainly for readability?
Also, why not use something like
b... |
This can be helpful (for tar but I think it can be extended to other programs as well):
https://www.gnu.org/software/tar/manual/html_section/tar_21.html
Long options are meant to be obvious and easy to remember, and their meanings are generally easier to discern than those of their corresponding short options (see be... | bash: --argument vs -arg [duplicate] |
1,303,753,299,000 |
What is the most portable or standard way to send an email from the console or a script on Linux, and possibly Unix?
|
To do this, you can use the mailx command. Below is an usage example:
mailx -v -s "Subject" -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S smtp=smtp://<server_name>:25 -S from="[email protected]" -S smtp-auth-user=<username> \
-S smtp-auth-password=<password> [email protected]
This example is using S... | Standard and portable way to send email from console? |
1,303,753,299,000 |
I've developed a few Bash scripts on a LFS system which should now be made to work on a minimal installation of Sun Solaris 10. Is there a guide somewhere with at least some general tips for conversion, and even better, a "conversion table" for common commands and options? This answer would be a good example of a sing... |
Search the web for "sun application porting assistant 1.0 final release". I believe it is still downloadable from Oracle web site:
It is a static source code analysis and code scanning tool that can be used to identify incompatible APIs between the Linux and Solaris platforms. Sun Application Porting Assistant's robus... | Shell scripts Linux -> Solaris conversion guide |
1,303,753,299,000 |
There are at least two standards of Executable and Linkable Format
(ELF), one of them
System V Application Binary Interface AMD64 Architecture Processor Supplement (With LP64 and ILP32 Programming Models) Version 1.0
Tool Interface Standard (TIS) Executable and Linking Format (ELF)
Specification Version 1.2
The old... |
The TIS/ELF one covers ELF in general, while the System V ABI is a supplement which documents the x86_64 Application Binary Interface.
The second document does not contain any information about x86_64 since the architecture didn't exist at the time it was written.
| Different standards of ELF (SysV vs TIS) and Linux? |
1,303,753,299,000 |
I'm writing an application from which I want to run a user-specified pager. The standard way to do this seems to be to look at the PAGER environment variable.
I'm unclear as to whether this is a program name or a program name together with arguments. I tried to find standards mentioning this, but could not.
My gut fe... |
My gut feeling is that I should split on spaces and execute.
Good instincts. You're calling exec(3); it's up to you how to interpret the environment variables you support. By supporting options, you save the user the trouble of writing a script to tuck them into a single $PAGER name.
A good example to follow migh... | Can $PAGER contain spaces? |
1,422,548,436,000 |
Beside the root (which I guess IS guaranteed), is there any other username guaranteed to exist on Unix system? Linux system? Fixed UIDs for those users? If not guaraneed, are there at least any recommendations?
My sampling of several Linux distros showed that users such as 'bin', 'daemon', 'sys', 'www-data' and 'nobod... |
nothing is guaranteed. root - is usually on linux/unix systems, but - i saw systems where uid=0 was used by "admin".
Usually - there are users like root, nobody, daemon, bin, sys. www-data is on debian/ubuntu, but for example on redhat/centos/fedora/pld there is apache user instead. Recomendations/fixed uids for users... | Are there any user guaranteed to exist on the system |
1,422,548,436,000 |
The so-called "standard streams" in Linux are stdin, stdout, and stderr. They must be called "standard" for a reason. Are there non-standard streams? Are those non-standard streams fundamentally treated differently by the kernel?
|
In this context, a “stream” is an open file in a process. (The word “stream” can have other meanings that are off-topic here.)
The three standard streams are the ones that are supposed to be already open when a program starts. File descriptor 0 is called standard input because that's where a program is supposed to rea... | Are there "non-standard" streams in Linux/Unix? |
1,422,548,436,000 |
Both POSIX and SUS (Single UNIX Specification) define a line as
A sequence of zero or more non-<newline> characters plus a terminating <newline> character.
Many distributions are more oriented towards LSB than POSIX. LSB includes a lot of POSIX/SUS standards but not all exactly.
Must lines also be terminated with a... |
From the chapter on "Scope":
The Linux Standard Base (LSB) defines a system interface for compiled applications and a minimal environment for support of installation scripts. Its purpose is to enable a uniform industry standard environment for high-volume applications conforming to the LSB.
[...]
The LSB is primarily... | Is a NEWLINE character at line end required by LSB (Linux Standard Base)? |
1,422,548,436,000 |
Is it true that find is not supposed to be doing even the most simple path unification/simplifications operations, such as coalescing multiple successive slashes together (which would be equivalent to the original form)?
For example the output of find ./// is:
.///
.///somefile
[…]
(tested with find from GNU and busy... |
If you don't have utilities that can understand NUL characters, then this historical behavior can be used to distinguish between files. The output of find will never contain two slashes in a row unless they are provided as part of the initial path. This means that output like
.//path/to/file
./name/more
tells you tha... | Any reason why find does not merge multiple slashes into one? |
1,422,548,436,000 |
From what I can understand of LSB documentation, neither wget or netcat are standard tools always available in an LSB environment.
Is there some other way to make a http request without being dependent on anything else than LSB?
What would be the most safe tool to be dependent on if I want to make it as simple as poss... |
I see that the LSB includes both Perl and Python...Python, at least, includes http tools in the standard library. I didn't investigate to see if the LSB mandates libwww-perl.
If you don't want to write anything yourself and you're happy with output to stdout, you can do this:
python -murllib http://example.com/
An... | bash script with network request in pure lsb environment |
1,422,548,436,000 |
Related to a StackOverflow question I have. Since it's more or less really a SO question through and through, I won't go into the whole spiel. My platform question is this: Is there an industry standard somewhere that specifies how various aspects of PAM should operate?
|
It's specified by the OpenGroup (the body specifying Unix) and by the Linux Standard Base.
I don't know how well those are followed on the various Unices/Linuces though.
The Wikipedia page is also a good reference.
| Is there a PAM Standard? |
1,422,548,436,000 |
Possible Duplicate:
Resources to learn linux architecture in detail?
I migrated to UNIX (Linux, Ubuntu) and I'm trying to understand the organisation of files and directories. I stumbled upon File Hierarchy Standard (quite old it seems) and it made me wonder if this is the ACTUAL standard that is used.
Also may I ... |
Here it is: The FHS 2.3 Specification
| Where can I find the Official File Hierarchy Standard for UNIX? [duplicate] |
1,422,548,436,000 |
Background
If think most of us agree that filters and pipes are the very foundation of Unix systems.
Pipes and filters are very powerful tools. Almost all Unix utilities use the standard input and output streams by default to make it possible to use them within pipelines.
It is a convention for utilities within Unix ... |
Pipelines don't work for source code because you can't process input as it comes in. You need the entire file loaded before processing begins. It gets even worse when you need multiple files for compilation (.h files for example). If you were reading from stdin you would need to stream in all of the needed files wi... | Why doesn't cc (the C compiler) and similar utilities use standard streams by default? [closed] |
1,422,548,436,000 |
Are basic system administrator utilities such as useradd or adduser standardized? If so, where can I find the specs? (POSIX doesn't seem to encompass those, but I might need to take a better look).
|
No, these utilities are not standardized. A quick look through the useradd(8) manual on RHEL6 versus OpenBSD reveals that while there are similarities, various flags differ in purpose. For a broader view, http://bhami.com/rosetta.html lists under "managing users" a variety of different commands, depending on the parti... | Are basic system administrator utilities such as useradd or adduser standardized? |
1,422,548,436,000 |
This question is somewhat similar to this: Unix/Linux command syntax
Suppose I have a program foo that takes arguments -a and -b. If both a and b take a string argument what is the meaning of this
foo -b -a bar
If multiple b:s are allowed
foo -b -a -b
??
Is there a true specification of the command line syntax somew... |
Unless you can find something that says option arguments can't start with a minus sign, then the only possible interpretation is
-b=-a
bar
See also: POSIX Utility Conventions.
| Standard command line syntax ambigiuty in interpretation rules? |
1,422,548,436,000 |
I use the following syntax in order to send standard output and standard error to $log file
log=/var/tmp/install.log
info=/tmp/info.log
exec > $log 2>&1
how to redirect both standard output and standard error also to /tmp/info.log file ?
|
The task is to preserve the log output even if an application deletes the log file.
By creating a second name for the log file with ln, the data in the log will be available under two names. If one of the names is deleted, the data is still available under the other name.
In a script:
log=/var/tmp/install.log
info=/t... | how to send standard output and standard error to two files |
1,422,548,436,000 |
Postfix (and lots of other stuff) claim they offer sendmail compatible interface. Since I want to write my own sendmail implementation, I was wondering what that actually means. Is there anything RFC-like describing what sendmail-compatible actually means? Like what arguments it should support and stuff?
|
There are no formal specs, but in practice a "sendmail compatible interface" means you have a MTA with a local mail injection agent named sendmail, and that if you replace the real sendmail(8) with it everything will keep running without taking notice of the change. This means implementing at the very least sendmail(... | Sendmail compatibility interface |
1,422,548,436,000 |
I am trying to understand how busybox's awk works so I'm looking into the standard and hit weird thing which I do not fully understand why is legal. Standard ( https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html , in section User-Defined Functions ) states that
When invoking a function, no white space... |
Check the definition of the FUNC_NAME in the same spec you're quoting from:
12. The token NAME shall consist of a word that is not a keyword or a
name of a built-in function and is not followed immediately
(without any delimiters) by the ( character.
13. The token FUNC_NAME shall consist of a word t... | Why is it legal to have white space before builtin function in awk? |
1,422,548,436,000 |
I am writing a converter which takes Linux Audit logs as input. I tried to find the most recent dictionary file where all the valid names of the fields are defined.
I've found such a file[1] but the main website[2] says:
Specs
The specifications have moved to github. The following will be left in place for a while an... |
From your github link, follow "Audit Event Parsing Library" which has a link the the dictionary at https://github.com/linux-audit/audit-documentation/blob/master/specs/fields/field-dictionary.csv
The raw CSV version is at
https://raw.githubusercontent.com/linux-audit/audit-documentation/master/specs/fields/field-dicti... | Where can I find the most recent dictionary of standard Linux Audit event fields? |
1,422,548,436,000 |
man pages are a phenomenal resource while programming in C on Linux. While looking at someone else's code, if you see something foreign you can immediate research it in another terminal with
$ man 3 fileno
or whatever the syntax you don't understand is.
Is there a standard way to get "man" pages for other programmin... |
Not reliably (or portably); on OpenBSD man -s ... lets you search by section, though outside of system or C related things, there are only sections for Fortran, Perl, and Tcl/Tk. Still, a search for say strftime in the Perl section will not find anything, as that call is hiding inside POSIX (or various other modules),... | `man` pages for languages other than C (e.g, python, R, javascript, etc)? |
1,422,548,436,000 |
I can see that uppercase letter means default here. Is there a standard for this? I'd like to read the full standards.
|
It isn't a written standard, it is, however, a de facto standard, meaning it had been used and found useful, so it came to be the common way to do things.
As Alex said - from common sense.
| What's the standard used by yum prompt "Is this ok [y/N]:"? |
1,422,548,436,000 |
I have asked a question insert a string to a list variables in text file [use sed]
In which @RomanPerekhrest showed me a different regex syntax.
\(=([^)]*\)) can capture [^)]* as group 1 . This is confusting for me .
You can check the result on https://regex101.com/r/DRChkE/2
https://regex101.com/r/LItVNg/1
This... |
You're looking for Perl-style aka PCRE regular expressions but that isn't a POSIX conforming syntax and not supported by typical implementations of the standard command-line tools like sed. What is supported are the syntax known as Basic Regular Expression (BRE) and Extended Regular Expression (ERE). In sed the former... | How to make sed regex syntax work as python or javascript? [duplicate] |
1,422,548,436,000 |
Call me a dreamer, but imagine a world
where "every" CLI tool we use had an option to produce a stable output, say in JSON.
Programmatic use of CLI tools like ls, free, df, fdisk would be a breeze.
The way GNU standardized argument syntax conventions,
can it standardize the output along the lines of
"--json produce... |
You would advocate for this on the mailing lists dedicated to the specific tools you are interested in.
The available GNU mailing lists are available here: https://lists.gnu.org/mailman/listinfo/
If one or other of the tools you are interested in is not represented by any GNU mailing list, then you would have to inves... | How to advocate for GNU to add a "--json" parameter for all CLI commands to be compliant? [closed] |
1,422,548,436,000 |
For example, 'foo bar' would be quoted as `foo bar', or ``foo bar''. Is it encouraged or general practice to use this quoting syntax? It seems to be quite common in some documentation.
|
Please, no. WRT regular text: single quotes, fine. Double quotes, okay. Backticks are only used literally (eg, as they are with the shell) and not as quotes. There are also the extended charset characters “ (left double quote) and ” (right double quote), but since they are not on a normal keyboard, the " is usuall... | Is it normal to use the grave (`) symbol, followed by an apostraphe (') to quote? [duplicate] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.