======================================================================================== my own ubuntu OS sydridgm@sydridgm-Linux:~$ whoami sydridgm sydridgm@sydridgm-Linux:~$ id uid=1000(sydridgm) gid=1000(sydridgm) groups=1000(sydridgm),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),124(sambashare) sydridgm@sydridgm-Linux:~$ id -u sydridgm 1000 sydridgm@sydridgm-Linux:~$ groups sydridgm sydridgm : sydridgm adm cdrom sudo dip plugdev lpadmin sambashare sydridgm@sydridgm-Linux:~$ man useradd sydridgm@sydridgm-Linux:~$ man useradd sydridgm@sydridgm-Linux:~$ groups sydridgm adm cdrom sudo dip plugdev lpadmin sambashare sydridgm@sydridgm-Linux:~$ more .profile # ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. # see /usr/share/doc/bash/examples/startup-files for examples. # the files are located in the bash-doc package. # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. #umask 022 # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi sydridgm@sydridgm-Linux:~$ ============================================================================================== Ubuntu instance sydridgm@sydridgm-Linux:~$ instance ami-6de0dd04 { "OwnerId": "144521539183", "ReservationId": "r-0bbe7f1f88615e480", "Groups": [], "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": "", "KernelId": "aki-b6aa75df", "State": { "Code": 0, "Name": "pending" }, "EbsOptimized": false, "LaunchTime": "2017-02-14T00:57:16.000Z", "PrivateIpAddress": "172.31.0.176", "ProductCodes": [], "VpcId": "vpc-a55a00c2", "StateTransitionReason": "", "InstanceId": "i-02bdeff90fcf0d50e", "ImageId": "ami-6de0dd04", "PrivateDnsName": "ip-172-31-0-176.ec2.internal", "KeyName": "devenv-key", "SecurityGroups": [ { "GroupName": "devenv-sg", "GroupId": "sg-4799293b" } ], "ClientToken": "", "SubnetId": "subnet-a3f652ea", "InstanceType": "t1.micro", "NetworkInterfaces": [ { "Status": "in-use", "MacAddress": "0a:b0:de:14:3e:4a", "SourceDestCheck": true, "VpcId": "vpc-a55a00c2", "Description": "", "NetworkInterfaceId": "eni-ef73d80f", "PrivateIpAddresses": [ { "PrivateDnsName": "ip-172-31-0-176.ec2.internal", "Primary": true, "PrivateIpAddress": "172.31.0.176" } ], "PrivateDnsName": "ip-172-31-0-176.ec2.internal", "Attachment": { "Status": "attaching", "DeviceIndex": 0, "DeleteOnTermination": true, "AttachmentId": "eni-attach-1d53835f", "AttachTime": "2017-02-14T00:57:16.000Z" }, "Groups": [ { "GroupName": "devenv-sg", "GroupId": "sg-4799293b" } ], "Ipv6Addresses": [], "SubnetId": "subnet-a3f652ea", "OwnerId": "144521539183", "PrivateIpAddress": "172.31.0.176" } ], "SourceDestCheck": true, "Placement": { "Tenancy": "default", "GroupName": "", "AvailabilityZone": "us-east-1c" }, "Hypervisor": "xen", "BlockDeviceMappings": [], "Architecture": "i386", "StateReason": { "Message": "pending", "Code": "pending" }, "RootDeviceName": "/dev/sda1", "VirtualizationType": "paravirtual", "RootDeviceType": "ebs", "AmiLaunchIndex": 0 } ] } sydridgm@sydridgm-Linux:~$ aws ec2 describe-instances --instance-ids i-02bdeff90fcf0d50e --query 'Reservations[0].Instances[0].PublicIpAddress' "52.90.126.142" sydridgm@sydridgm-Linux:~$ cd bin/ec2/ sydridgm@sydridgm-Linux:~/bin/ec2$ ssh -i devenv-key.pem ubuntu@52.90.126.142 The authenticity of host '52.90.126.142 (52.90.126.142)' can't be established. ECDSA key fingerprint is SHA256:/yHlwLcKeQ0eaHM3n8Mc3+2IyS5uSMrRb6qnlenkWbY. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '52.90.126.142' (ECDSA) to the list of known hosts. The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. ubuntu@ip-172-31-0-176:~$ uname -a Linux ip-172-31-0-176 3.13.0-5-generic #20-Ubuntu SMP Mon Jan 20 19:58:23 UTC 2014 i686 i686 i686 GNU/Linux ubuntu@ip-172-31-0-176:~$ whoami ubuntu ubuntu@ip-172-31-0-176:~$ id uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),102(netdev) ubuntu@ip-172-31-0-176:~$ groups ubuntu adm dialout cdrom floppy sudo audio dip video plugdev netdev ubuntu@ip-172-31-0-176:~$ sudo adduser sydridgm adm cdrom sudo dip plugdev adduser: Only one or two names allowed. ubuntu@ip-172-31-0-176:~$ sudo adduser sydridgm sudo adduser: The user `sydridgm' does not exist. ubuntu@ip-172-31-0-176:~$ sudo adduser adduser: Only one or two names allowed. ubuntu@ip-172-31-0-176:~$ sudo adduser sydridgm Adding user `sydridgm' ... Adding new group `sydridgm' (1001) ... Adding new user `sydridgm' (1001) with group `sydridgm' ... Creating home directory `/home/sydridgm' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for sydridgm Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y ubuntu@ip-172-31-0-176:~$ cd .. ubuntu@ip-172-31-0-176:/home$ ls sydridgm ubuntu ubuntu@ip-172-31-0-176:/home$ ls -l total 8 drwxr-xr-x 2 sydridgm sydridgm 4096 Feb 14 01:27 sydridgm drwxr-xr-x 4 ubuntu ubuntu 4096 Feb 14 01:05 ubuntu ubuntu@ip-172-31-0-176:/home$ cd sydridgm/ ubuntu@ip-172-31-0-176:/home/sydridgm$ ls ubuntu@ip-172-31-0-176:/home/sydridgm$ whoami ubuntu ubuntu@ip-172-31-0-176:/home/sydridgm$ id sydridgm uid=1001(sydridgm) gid=1001(sydridgm) groups=1001(sydridgm) ubuntu@ip-172-31-0-176:/home/sydridgm$ su sydridgm Password: sydridgm@ip-172-31-0-176:~$ whoami sydridgm sydridgm@ip-172-31-0-176:~$ groups sydridgm sydridgm : sydridgm sydridgm@ip-172-31-0-176:~$ usermod -u 1000 sydridgm usermod: UID '1000' already exists sydridgm@ip-172-31-0-176:~$ usermod -u 1002 ubuntu usermod: Permission denied. usermod: cannot lock /etc/passwd; try again later. sydridgm@ip-172-31-0-176:~$ groups sydridgm sydridgm@ip-172-31-0-176:~$ su ubuntu Password: su: Authentication failure sydridgm@ip-172-31-0-176:~$ exit exit ubuntu@ip-172-31-0-176:/home/sydridgm$ usermod -u 1002 ubuntu usermod: user ubuntu is currently used by process 1150 ubuntu@ip-172-31-0-176:/home/sydridgm$ id uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),102(netdev) ubuntu@ip-172-31-0-176:/home/sydridgm$ usermod -u 1001 ubuntu usermod: UID '1001' already exists ubuntu@ip-172-31-0-176:/home/sydridgm$ usermod -u 1002 ubuntu usermod: user ubuntu is currently used by process 1150 ubuntu@ip-172-31-0-176:/home/sydridgm$ su root Password: su: Authentication failure ubuntu@ip-172-31-0-176:/home/sydridgm$ ubuntu@ip-172-31-0-176:/home/sydridgm$ ubuntu@ip-172-31-0-176:/home/sydridgm$ su sydridgm Password: sydridgm@ip-172-31-0-176:~$ sudo usermod -u 1002 ubuntu [sudo] password for sydridgm: sydridgm is not in the sudoers file. This incident will be reported. sydridgm@ip-172-31-0-176:~$ exit exit ubuntu@ip-172-31-0-176:/home/sydridgm$ su Password: su: Authentication failure ubuntu@ip-172-31-0-176:/home/sydridgm$ ubuntu@ip-172-31-0-176:/home/sydridgm$ exit logout Connection to 52.90.126.142 closed. sydridgm@sydridgm-Linux:~/bin/ec2$ ssh -i devenv-key.pem root@52.90.126.142 Please login as the user "ubuntu" rather than the user "root". ^CConnection to 52.90.126.142 closed. sydridgm@sydridgm-Linux:~/bin/ec2$ ssh -i devenv-key.pem ubuntu@52.90.126.142 Welcome to Ubuntu Trusty Tahr (development branch) (GNU/Linux 3.13.0-5-generic i686) * Documentation: https://help.ubuntu.com/ System information as of Tue Feb 14 01:40:55 UTC 2017 System load: 0.0 Processes: 62 Usage of /: 9.8% of 7.75GB Users logged in: 0 Memory usage: 5% IP address for eth0: 172.31.0.176 Swap usage: 0% Graph this data and manage this system at: https://landscape.canonical.com/ Get cloud support with Ubuntu Advantage Cloud Guest: http://www.ubuntu.com/business/services/cloud 0 packages can be updated. 0 updates are security updates. New release '14.10' available. Run 'do-release-upgrade' to upgrade to it. *** /dev/xvda1 will be checked for errors at next reboot *** Last login: Tue Feb 14 01:05:52 2017 from host-studentw-137-77.dhcp.stevens-tech.edu ubuntu@ip-172-31-0-176:~$ ls ubuntu@ip-172-31-0-176:~$ cd .. ubuntu@ip-172-31-0-176:/home$ ls sydridgm ubuntu ubuntu@ip-172-31-0-176:/home$ groups ubuntu adm dialout cdrom floppy sudo audio dip video plugdev netdev ubuntu@ip-172-31-0-176:/home$ sudo usermod -a -G adm sydridgm ubuntu@ip-172-31-0-176:/home$ sudo usermod -a -G cdrom sydridgm ubuntu@ip-172-31-0-176:/home$ sudo usermod -a -G sudo sydridgm ubuntu@ip-172-31-0-176:/home$ sudo usermod -a -G dip sydridgm ubuntu@ip-172-31-0-176:/home$ sudo usermod -a -G plugdev sydridgm ubuntu@ip-172-31-0-176:/home$ groups sydridgm sydridgm : sydridgm adm cdrom sudo dip plugdev ubuntu@ip-172-31-0-176:/home$ su sydridgm Password: sydridgm@ip-172-31-0-176:/home$ cd sydridgm@ip-172-31-0-176:~$ ls -la total 24 drwxr-xr-x 2 sydridgm sydridgm 4096 Feb 14 01:34 . drwxr-xr-x 4 root root 4096 Feb 14 01:27 .. -rw------- 1 sydridgm sydridgm 126 Feb 14 01:38 .bash_history -rw-r--r-- 1 sydridgm sydridgm 220 Feb 14 01:27 .bash_logout -rw-r--r-- 1 sydridgm sydridgm 3637 Feb 14 01:27 .bashrc -rw-r--r-- 1 sydridgm sydridgm 675 Feb 14 01:27 .profile sydridgm@ip-172-31-0-176:~$ more .profile # ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. # see /usr/share/doc/bash/examples/startup-files for examples. # the files are located in the bash-doc package. # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. #umask 022 # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi sydridgm@ip-172-31-0-176:~$ vim .profile sydridgm@ip-172-31-0-176:~$ more .profile # ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. # see /usr/share/doc/bash/examples/startup-files for examples. # the files are located in the bash-doc package. # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. #umask 022 # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi sydridgm@ip-172-31-0-176:~$ ===================================================================================== OmniOS instance sydridgm@sydridgm-Linux:~/bin/ec2$ instance ami-50ecc847 { "OwnerId": "144521539183", "ReservationId": "r-0e7ef53d77d1b0348", "Groups": [], "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": "", "KernelId": "aki-b4aa75dd", "State": { "Code": 0, "Name": "pending" }, "EbsOptimized": false, "LaunchTime": "2017-02-14T01:02:08.000Z", "PrivateIpAddress": "172.31.15.9", "ProductCodes": [], "VpcId": "vpc-a55a00c2", "StateTransitionReason": "", "InstanceId": "i-040d37dd4079b18aa", "ImageId": "ami-50ecc847", "PrivateDnsName": "ip-172-31-15-9.ec2.internal", "KeyName": "devenv-key", "SecurityGroups": [ { "GroupName": "devenv-sg", "GroupId": "sg-4799293b" } ], "ClientToken": "", "SubnetId": "subnet-a3f652ea", "InstanceType": "t1.micro", "NetworkInterfaces": [ { "Status": "in-use", "MacAddress": "0a:83:95:03:77:06", "SourceDestCheck": true, "VpcId": "vpc-a55a00c2", "Description": "", "NetworkInterfaceId": "eni-9041ea70", "PrivateIpAddresses": [ { "PrivateDnsName": "ip-172-31-15-9.ec2.internal", "Primary": true, "PrivateIpAddress": "172.31.15.9" } ], "PrivateDnsName": "ip-172-31-15-9.ec2.internal", "Attachment": { "Status": "attaching", "DeviceIndex": 0, "DeleteOnTermination": true, "AttachmentId": "eni-attach-4d41910f", "AttachTime": "2017-02-14T01:02:08.000Z" }, "Groups": [ { "GroupName": "devenv-sg", "GroupId": "sg-4799293b" } ], "Ipv6Addresses": [], "SubnetId": "subnet-a3f652ea", "OwnerId": "144521539183", "PrivateIpAddress": "172.31.15.9" } ], "SourceDestCheck": true, "Placement": { "Tenancy": "default", "GroupName": "", "AvailabilityZone": "us-east-1c" }, "Hypervisor": "xen", "BlockDeviceMappings": [], "Architecture": "x86_64", "StateReason": { "Message": "pending", "Code": "pending" }, "RootDeviceName": "/dev/sda", "VirtualizationType": "paravirtual", "RootDeviceType": "ebs", "AmiLaunchIndex": 0 } ] } sydridgm@sydridgm-Linux:~/bin/ec2$ aws ec2 describe-instances --instance-ids i-03691d0cfd29f7d0f --query 'Reservations[0].Instances[0].PublicIpAddress' "52.206.245.26" sydridgm@sydridgm-Linux:~/bin/ec2$ ssh -i devenv-key.pem root@52.206.245.26 The authenticity of host '52.206.245.26 (52.206.245.26)' can't be established. RSA key fingerprint is SHA256:KqnlxUkNFxKZoO6Eqel+9VfBoc2POK1dZOeMxCJnrCE. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '52.206.245.26' (RSA) to the list of known hosts. Last login: Wed Nov 2 19:36:13 2016 from 108.48.124.82 OmniOS 5.11 omnios-r151020-b5b8c75 November 2016 root@ip-10-152-178-106.ec2.internal:/root# uname -a SunOS ip-10-152-178-106.ec2.internal 5.11 omnios-r151020-b5b8c75 i86pc i386 i86xpv root@ip-10-152-178-106.ec2.internal:/root# ====================================================================================================================== FreeBSD instance sydridgm@sydridgm-Linux:~$ instance ami-d0b520b8 { "OwnerId": "144521539183", "ReservationId": "r-0bdb946bec4d7f29e", "Groups": [], "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": "", "Platform": "windows", "State": { "Code": 0, "Name": "pending" }, "EbsOptimized": false, "LaunchTime": "2017-02-14T00:56:09.000Z", "PrivateIpAddress": "172.31.1.4", "ProductCodes": [], "VpcId": "vpc-a55a00c2", "StateTransitionReason": "", "InstanceId": "i-01b9eab15ba29e3ae", "ImageId": "ami-d0b520b8", "PrivateDnsName": "ip-172-31-1-4.ec2.internal", "KeyName": "devenv-key", "SecurityGroups": [ { "GroupName": "devenv-sg", "GroupId": "sg-4799293b" } ], "ClientToken": "", "SubnetId": "subnet-a3f652ea", "InstanceType": "t1.micro", "NetworkInterfaces": [ { "Status": "in-use", "MacAddress": "0a:61:d1:cd:69:b2", "SourceDestCheck": true, "VpcId": "vpc-a55a00c2", "Description": "", "NetworkInterfaceId": "eni-4771daa7", "PrivateIpAddresses": [ { "PrivateDnsName": "ip-172-31-1-4.ec2.internal", "Primary": true, "PrivateIpAddress": "172.31.1.4" } ], "PrivateDnsName": "ip-172-31-1-4.ec2.internal", "Attachment": { "Status": "attaching", "DeviceIndex": 0, "DeleteOnTermination": true, "AttachmentId": "eni-attach-01508043", "AttachTime": "2017-02-14T00:56:09.000Z" }, "Groups": [ { "GroupName": "devenv-sg", "GroupId": "sg-4799293b" } ], "Ipv6Addresses": [], "SubnetId": "subnet-a3f652ea", "OwnerId": "144521539183", "PrivateIpAddress": "172.31.1.4" } ], "SourceDestCheck": true, "Placement": { "Tenancy": "default", "GroupName": "", "AvailabilityZone": "us-east-1c" }, "Hypervisor": "xen", "BlockDeviceMappings": [], "Architecture": "i386", "StateReason": { "Message": "pending", "Code": "pending" }, "RootDeviceName": "/dev/sda1", "VirtualizationType": "hvm", "RootDeviceType": "ebs", "AmiLaunchIndex": 0 } ] } sydridgm@sydridgm-Linux:~$ aws ec2 describe-instances --instance-ids InstanceId --query 'Reservations[0].Instances[0].PublicIpAddress' An error occurred (InvalidInstanceID.Malformed) when calling the DescribeInstances operation: Invalid id: "InstanceId" sydridgm@sydridgm-Linux:~$ alias alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' alias instance='aws ec2 run-instances --security-group-ids sg-4799293b --count 1 --instance-type t1.micro --key-name devenv-key --image-id' alias l='ls -CF' alias la='ls -A' alias ll='ls -alF' alias ls='ls --color=auto' alias rm='trash' sydridgm@sydridgm-Linux:~$ aws ec2 describe-instances --instance-ids InstanceId i-01b9eab15ba29e3ae --query 'Reservations[0].Instances[0].PublicIpAddress' An error occurred (InvalidInstanceID.Malformed) when calling the DescribeInstances operation: Invalid id: "InstanceId" sydridgm@sydridgm-Linux:~$ aws ec2 describe-instances --instance-ids i-01b9eab15ba29e3ae --query 'Reservations[0].Instances[0].PublicIpAddress' "54.237.196.56" sydridgm@sydridgm-Linux:~$ cd bin/ec2/ sydridgm@sydridgm-Linux:~/bin/ec2$ ssh -i devenv-key.pem freebsd@54.237.196.56 The authenticity of host '54.237.196.56 (54.237.196.56)' can't be established. ECDSA key fingerprint is SHA256:EpKyfxSdFE+D8lAOvxSn4UkVOjibuageoON+JCUm5SU. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '54.237.196.56' (ECDSA) to the list of known hosts. Password for freebsd@ip-172-31-1-4: sydridgm@sydridgm-Linux:~/bin/ec2$ ssh -i devenv-key.pem root@54.237.196.56 Password for root@ip-172-31-1-4: sydridgm@sydridgm-Linux:~/bin/ec2$ ssh -i devenv-key.pem ec2-user@54.237.196.56 FreeBSD 10.1-RELEASE-p35 (GENERIC) #0: Sat May 28 03:02:45 UTC 2016 Welcome to FreeBSD! Release Notes, Errata: https://www.FreeBSD.org/releases/ Security Advisories: https://www.FreeBSD.org/security/ FreeBSD Handbook: https://www.FreeBSD.org/handbook/ FreeBSD FAQ: https://www.FreeBSD.org/faq/ Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ FreeBSD Forums: https://forums.FreeBSD.org/ Documents installed with the system are in the /usr/local/share/doc/freebsd/ directory, or can be installed later with: pkg install en-freebsd-doc For other languages, replace "en" with a language code like de or fr. Show the version of FreeBSD installed: freebsd-version ; uname -a Please include that output and any error messages when posting questions. Introduction to manual pages: man man FreeBSD directory layout: man hier Edit /etc/motd to change this login announcement. If you are in the C shell and have just installed a new program, you won't be able to run it unless you first type "rehash". -- Dru $ ls $ cd .. $ ls ec2-user $ cd ec2-user/ $ ls $ uname -a FreeBSD ip-172-31-1-4 10.1-RELEASE-p35 FreeBSD 10.1-RELEASE-p35 #0: Sat May 28 03:02:45 UTC 2016 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386 $ ========================for ubuntu================================ check the user id (UID) >> id heck groups >> groups check username >> whoami login as another user >> su passwd: